Display active window for video in custom allocator
I am displaying video over panel using custom allocator sample, for some file it play video on some active window and this show separately . how can i avoid this unwan开发者_如何学运维ted window to be open.
Usually then video is played in ActiveMovie window when the decoder and renderer could not agree on the connection, so graph builder is using default renderer (if you are automatically constructing your graph by executing RenderFile method), which is played separately. Check your code in InitializeDevice method of your allocator, if InitializeDevice always failing then your video will be rendered in default renderer.
Make sure you are using VMR9Mode_Renderless mode. And if you are not using any mixing in VMR7/9 I suggest removing any calls to the SetNumberOfStreams method, it makes things simplier.
Quite good example of custom allocator usage can be found here.
What do you mean? When you start playing the file it opens a window that contains the actual video?
If so you probably want to investigate the Video Mixing Render filter. You can create your own custom allocator that allows you to intercept the present call which will then allow you to draw the video wherever, and however, you want.
Or, and personally i think this is easier, you want to investigate the dump filter example and then use that to build your own renderer. That way when you receive the frame you can do whatever you like with it without faffing about with internals. Its very simple writing filters if you don't want them to be available outside of your application.
Edit: Have you QueryInterfaced the IVMRFilterConfig9 interface and SetRenderingMode to VMR9Mode_Windowless?
精彩评论