问题
I want to adjust the video to display on a specified window, for example 320*240.
I must use VMR-9 Renderless mode to render to a surface. I am using the IVMRMixerControl9->SetOutputRect() method to adjust the video size. So I must get the native video size. But I don't know how.
The GetOutputRect method always return 0 and 1. The get_VideoHeight and get_VideoWidth method return E_NOINTERFACE. But I do build a filterGraph with a video file.
Do I have the wrong idea or there are other method?
Thanks in advance!
回答1:
Not sure if this would help you, but have you looked at the VMR's windowless mode? You can specify the handle for a window (such as a UserControl) to show the video. On the IVMRWindowlessControl9 interface, you can call GetNativeVideoSize to get the native window size and set the size from there and then call SetVideoPosition to specify where the video should go. In my case, I am using the ClientRectangle of the UserControl as the destination rectangle and the native video size as the source rectangle.
来源:https://stackoverflow.com/questions/4989273/how-can-i-adjust-the-video-to-a-specified-size-in-vmr9-renderless-mode