Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Wed, 17 Sep 2008 17:21:32 +0200,    group: microsoft.public.win32.programmer.directx.video        back       


VMR9 Run() Halt - Presentation Times?   
Hi all -  I've been working on this for many hours now and haven't 
figured it out. Here's the graph:

FSF -> Demux -> Decoder -> My Filter -> VMR9

On IMediaControl::Run() my filter begins receiving samples before Run() 
has been called in my filter. The incoming samples have sensible 
presentation times. 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.

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.

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.

Questions:

1) What is the expected behavior of a filter receiving samples before 
its Run() has been called?

2) If my filter has not had Run() is it likely that the VMR9 has not had 
Run() called either?

Thanks for any help/advice here...

_T
date: Wed, 17 Sep 2008 17:21:32 +0200   author:   TheSequoyan

Re: VMR9 Run() Halt - Presentation Times?   
On Wed, 17 Sep 2008 17:21:32 +0200, TheSequoyan wrote:

> 1) What is the expected behavior of a filter receiving samples before 
> its Run() has been called?

The graph won't transition from pause to run until the renderer is happy
that it has buffered enough samples.  Most filters shouldn't care about the
difference between pause and run, it's only really relevant to renderers.
 
> 2) If my filter has not had Run() is it likely that the VMR9 has not had 
> Run() called either?

Correct.  It sounds like the VMR is buffering and once buffering is
completed the graph will transition.

Note that stream times aren't valid unless you are in a running state.

-- 
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
date: Wed, 17 Sep 2008 14:29:54 -0400   author:   Chris P.

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

Re: VMR9 Run() Halt - Presentation Times?   
Chris & Alessandro -

Thank you for both of your replies. I've been working on this issue for 
the day or so since your posts and think I have resolved. I am not 100% 
sure but I think the issue relates to my filter's internal 
re-timestamping that is applied while 3:2 is running. If I turn off 3:2 
then everything is ok. I'm studying further...

Again, thanks for your posts. They were very helpful.

Cheers,
Thomas
date: Fri, 19 Sep 2008 16:18:40 +0200   author:   TheSequoyan

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us