好吧...我想通了...如果有人有更好的例子,请在此处发布,我会将其标记为已接受的答案。
The graph:
如果您在 GrapgEdit(或其他东西)中渲染它,它会在其下方显示第一个(Input0)流和第二个(Input1)流,但我希望它们同时可见!
为此,VMR9 必须进行这样的配置(错误处理和一些VMR9配置被省略):
//Setting VMR9 to run in WINDOWLESS MODE
filterConfig = (IVMRFilterConfig9)vmr;
filterConfig.SetRenderingMode(VMR9Mode.Windowless);
//Number of streams that I want to render together (mix)
filterConfig.SetNumberOfStreams(2);
//Get the MIXER CONTROL that will be used to configure video rendering surfaces
mixerCtrl = (IVMRMixerControl9)vmr;
//*** RENDER THE PINS SO THE GRAPH CONNECTS CORRECTLY (omitted) ***
//Define areas of the clipping window that will be covered by each video stream
NormalizedRect r1 = new NormalizedRect(0,0,0.5f, 0.5f);
NormalizedRect r2 = new NormalizedRect(0.5f, 0.5f, 1f, 1f);
//For each stream (0 and 1) set the output rect
mixerCtrl.SetOutputRect(0, ref r1);
mixerCtrl.SetOutputRect(1, ref r2);
After this, the streams are rendered in top left and bottom right portion of the clipping window, and they are both shown and rendered correctly!!!
如果你想显示更多视频流,只需SetNumberOfStreams
相应地,并配置NormalizedRect
为每一个。这样我就可以使用一个 VMR9 实例渲染更多流,而且不需要担心 RAM 耗尽。
现在 VMR9 真正的酷炫表现出来了...:D xD
PS看起来 16 个流已经是极限了......