|
|
|
date: Wed, 17 Sep 2008 17:21:32 +0200,
group: microsoft.public.win32.programmer.directx.video
back
Re: VMR9 Run() Halt - Presentation Times?
From: "TheSequoyan"
> On IMediaControl::Run() my filter begins receiving
> samples before Run() has been called in my filter. The
> incoming samples have sensible presentation times.
The graph never transitions directly from stopped to
running, but it transitions first from stopped to paused
then from paused to running. Processing in a filter starts
as soon as it is not stopped, regardless of whether it is
paused or running. For the graph to complete the transition
to paused, all filters must complete the transition. The
stock video renderers only complete the transition when they
have received at least 1 frame, which implies that the
upstream filters must process 1 or more samples before the
graph's transition from stopped to paused completes. The
transition from paused to running is instead immediate
(buffering has already completed during the transition to
paused).
It sound like you are either in between stopped to paused or
paused to running.
As Chris wrote, unless you are a renderer, you only have 2
real states: inactive (== stopped) and active (== paused ||
running). Which is reflected in the BaseClasses
(CBasePin::Active() and CBasePin::Inactive()).
> However the stream time is still a huge number, I take
> this to mean that not all filters have returned from
> Run() so the graph clock has not begun ticking.
That's not it. The stream time is only valid when the graph
is running but, as noted above, you are not yet running.
> If I let the samples through to the VMR9 it renders only
> the first several frames (actually the buffer size count
> of frames) - after sending buffer frame count frames it
> does not respond to the next receive on its input pin.
The video renderer blocks when paused, causing the streaming
to pause, otherwise, since the upstream filters do not
distinguish between paused and running, the graph will
always run.
> If I do not send the frames to the VMR9 (eg release the
> incoming sample and return S_OK) Run() is never called in
> my filter and the stream time never gets set/starts
> running properly.
As noted above, the video renderer will not complete the
transition to paused until it receives at least 1 sample. If
it doesn't complete the transition, the graph doesn't
complete it and, if it doesn't, the transition to running
never begins.
> 1) What is the expected behavior of a filter receiving
> samples before its Run() has been called?
As Chris wrote, unless you are a renderer you should only
care about stopped and !stopped, not about running.
> 2) If my filter has not had Run() is it likely that the
> VMR9 has not had Run() called either?
No, the graph asks the filters to change state starting from
the renderers and going upstream, which means the video
renderer will transition before you do.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
date: Wed, 17 Sep 2008 15:07:31 -0400
author: Alessandro Angeli
|
|