tags:

views:

195

answers:

1

I have write a DirectShow video transform filter, which is inserted between a video decoder and a video render filter. It will add a photo frame around the input picture. So the output picutre's size and aspect ratio is different from the input one.

Unfortunately, I found the video render would maintain the original aspect ratio and so the displayed picture with a photo frame was stretched. In GraphEdit, I found the video render filter with a check box named "Maintain Aspect Ratio". Uncheck it and the out picture will not be stretched. That's what I want. But I don't know how to do it in my code. I had query the interface IVideoWindow but found it wasn't able to set the aspect ratio. So I ask for help here.

Thanks.


Thank you, Jeremiah Morrill. Yes, IVMRAspectRatioControl7/9 is what I want. But it seems, to get the interface, I must get the filter Video Mixing Renderer Filter 7/9 firstly. I want to set the aspect ratio on the "Video Renderer" filter instead of "Video Mixing Renderer Filter 9".

I don't need to chage format dynamicly. My filter graph is

Source -> Demux -> Decoder -> MyFilter -> VideoRenderer

No matter the Decoder output's resolution, MyFilter's output resolution is always same as the desktop screen. I found, if I use intelligence connection, I will encounter the problem I have described. But if I connect MyFilter to VideoRenderer manually, the video resolution is correct, i.e., same as the screen.

A: 

Maybe you are looking for IVMRAspectRatioControl7/9 interface (queried out of the VMR renderer)?

Also, what you are describing sounds very odd. Is your output pin supplying the correct video sizes in the media type after the input pin media type is set? Also, if you are changing resolutions after the pins are hooked up, you may want to read about dynamic format changes.

Jeremiah Morrill
Thanks. Yes, IVMRAspectRatioControl7/9 can do what I want. But my question is how to set aspect ratio on "Video Renderer" filter because I can set it on GraphEdit.
Cook Schelling