GetCurrentPosition in a graph that does not accept seeking

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.



.



Relevant Pages

  • Re: GetCurrentPosition in a graph that does not accept seeking
    ... Some times ago I wrote a simple filter whose task was to let me to check ... The graph alone did not accept seeking (I only got 0 as ... Now I want to reuse the graph to compress into ogg through Vorbis Encoder. ... you seem to overwrite LastSampleTimeEnd ...
    (microsoft.public.win32.programmer.directx.audio)
  • How to get the directshow trancoding graph status
    ... I'm using Graph Edit to test the status and convertion for my ... filter graph. ... As per the above graph, transcoding done, but progress status is not ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: create custom audio source filter for Windows Mobile
    ... I cannot add the filter to my graph. ... I will post any progress on the issue if I am good enough to make it ... Geraint has a sample internal filter that works on his site (see my Links ... Trim & respond inline (please don't top post or snip everything) ...
    (microsoft.public.win32.programmer.directx.video)
  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.win32.programmer.directx.video)
  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.multimedia.directx.dshow.programming)