Discussion:
Seeking with custom renderer
(too old to reply)
Dan Stoyanov
2011-01-31 13:22:29 UTC
Permalink
Hi all,

I have a simple dshow graph that plays a media file (dv compression)
using a custom renderer.The graph plays fine but I am having problems
with seeking. Seeking caps are all fine, the seek itself works with
SetPositions but when the graph is in a paused state I cant get the
new fame (at new position) to be delivered to my renderer. If the
graph is running seeking works as it should.

I think the problem is something related to the flushing mechanism
required. All my renderer does is derive from CBaseVideoRenderer. I
have not done any overriding of IMediaSeeking methods. Does anyone
know what I need to do to in order to get the grame at the new
position?

I have tried to pause the graph after calling SetPositions, also to
StopWhenReady. None of these work for me. So I suspect it is something
related to using a custom renderer because if I use the VMRs these
work fine.

Thanks a lot for any help,
Dan
Dan Stoyanov
2011-01-31 15:39:43 UTC
Permalink
Just to follow up - I seem to have resolved this problem by defining
the stop time as well. My previous code used:

REFERENCE_TIME gotoFrame = (REFERENCE_TIME)(frame);
hr = Ms-
SetPositions(&gotoFrame ,AM_SEEKING_AbsolutePositioning,NULL,AM_SEEKING_NoPositioning);
This didnt work. However, by specifying the stop time to be the same
as the start, everything updates as desired:

REFERENCE_TIME gotoFrame = (REFERENCE_TIME)(frame);
hr = Ms-
SetPositions(&gotoFrame ,AM_SEEKING_AbsolutePositioning,&gotoFrame,AM_SEEKING_AbsolutePositioning);
I am not sure if this is the correct way of doing thing. I havent seen
it talked about anywhere on the forums (I did my trawling before
posting). I suppose it doesnt keep the graph in a paused state and
hence may not be good?!

Anyway, the method does not work with MPEG2 videos. It only works on
sending the video position to 0, not for anywhere else in the video. I
find this strange because even samples like the DShow Player are able
to do some seeking in those videos (not great but it works).

Any feedback would be much appreciated!

Thanks, dan

Loading...