嗯......我想通了...如果有人有一个更好的例子,请在这里发布,我会将其标记为已接受的答案。
图表:
如果您呈现这GrapgEdit(或别的东西),它显示的第一个(INPUT 0)流和它下面的第二个(输入1),但我希望他们能同时可见!
为此,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);
在此之后,流被渲染在削波的左上角和右下角的部分窗口,并且它们都被正确显示和渲染!
如果要显示更多视频流,则只需SetNumberOfStreams
即可,并为每个视频流配置NormalizedRect
。通过这种方式,我可以使用一个VMR9实例渲染更多流,而且我不需要担心RAM耗尽。
现在VMR9的真实凉意显示出来...:d的xD
PS 它看起来像16流是极限...