views:

37

answers:

1

I have a DirectShow source filter for receiving a Network stream containing RFC2435 data (MJPEG over RTP).

The properties of the source filter's output pin need to be set-up prior to receiving the stream which is the only source of the image's dimension data. The dimensions for the output pin are currently set to some default values (640x480).

Is it possible to modify the properties of the Output Pin to reflect the new image's dimensions after the output pin has already been created and connected to another filter which decodes the MJPEG data?

A: 

I believe the answer is to use the 'Dynamic Format Change' mechanism which can be used to switch media types. This can be done several different ways depending on whether the graph is active or stopped. The following page on MSDN explains the details.

http://msdn.microsoft.com/en-us/library/dd388731(VS.85).aspx

Jonathan Websdale
Having said this is the answer, it's proving hard to find an example of this mechanism in use!
Jonathan Websdale
look at www.gdcl.co.uk/gmfbridge -- this sample changes media types both by attaching a media type to a sample and by calling ReceiveConnection on the output pin -- this latter form is required when connected to the video renderer, since you need it to change the buffer size.
Geraint Davies
Thanks, just found the thread on http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/41589cca-772d-4b43-a56a-8fb7daf953ccNow deriving a new InputPin class from CTransformInputPin so that I can implement the ReceiveConnection method but will probably then run into an issue with allocators by the way the discussion thread went!
Jonathan Websdale