GetCurrentPosition in a graph that does not accept seeking
- From: "Stefano Bonifazi" <stefboombastic@xxxxxxxxx>
- Date: Thu, 9 Feb 2006 22:37:15 +0100
Hi all :-)
Some times ago I wrote a simple filter whose task was to let me to check
the progress in a graph that compressed a generic audio file to mp3 through
the DirectShow LAME filter.
The graph alone (without my filter) did not accept seeking (I only got 0 as
current position). My simple filter worked in the following way:
In Receive:
HRESULT CSNullSeek::Receive(IMediaSample *pSample)
{
CheckPointer(pSample,E_POINTER);
REFERENCE_TIME st=0;
REFERENCE_TIME et=0;
HRESULT hr = pSample->GetTime(&st,&LastSampleEndTime);
return CTransInPlaceFilter::Receive(pSample);
}
stored the time (in LastSampleEndTime) of the last sample it received and
giving it back in its GetCurrentPosition (it exposed IMediaSeeking
interface)
STDMETHODIMP CSNullSeek::GetCurrentPosition(LONGLONG *pCurrent)
{
CheckPointer(pCurrent,E_POINTER);
*pCurrent=LastSampleEndTime;
return S_OK;
}
It only accepted TIME_FORMAT_MEDIA_TIME as time format. It worked fine and I
could check the progress fine!
Now I want to reuse the graph to compress into ogg through Vorbis Encoder.
The matter is that now I get only "small numbers" as current positions :(
I report the last 3 passes of my test
Current: 1967416 of 2114873470
Current: 1975888 of 2114873470
Current: 1976660 of 2114873470 (here compression is done!!)
where the big number should be the duration (in MEDIA TIME !?!) ... I also
tried to get the duration in TIME_FORMAT_SAMPLE .. I got a smaller number
but always bigger than the ones I get as current positions! What are then
those number I get? Is there a way to accomplish my goal?
Thank You very much in advance,
Stefano B.
.
- Follow-Ups:
- Re: GetCurrentPosition in a graph that does not accept seeking
- From: Geraint Davies
- Re: GetCurrentPosition in a graph that does not accept seeking
- Prev by Date: Re: Compressing with OGG directShow filter
- Next by Date: Re: directsound notification efficiency problem
- Previous by thread: DirectSound / Setting filter borders (bandpass)
- Next by thread: Re: GetCurrentPosition in a graph that does not accept seeking
- Index(es):
Relevant Pages
|