ActiveX HWND、DirectX WindowLess 模式
我想在 ActiveX 控件中渲染视频(而不是在弹出的 DirectShow 窗口中)。我有:
IID_IVMRWindowlessControl
IID_IVMRFilterConfig9
CLSID_VideoMixingRenderer9
我想设置 WindowLess 模式,但我不知道如何获取...的 HWND,确切地说,是什么? IEFrame、HTML 元素?
hr = pWc->SetVideoClippingWindow(???);
有人有什么提示吗?
问候。
I would like to render video in ActiveX control (not in pop-up DirectShow window). I have:
IID_IVMRWindowlessControl
IID_IVMRFilterConfig9
CLSID_VideoMixingRenderer9
I would like to set WindowLess mode, but I don't know how to get HWND of..., exactly, of what? IEFrame, HTML element?
hr = pWc->SetVideoClippingWindow(???);
Anyone with some hint?
Regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,将其添加到 ActiveX 控件的构造函数中:
您的 ActiveX 控件将有一个名为 m_hWnd 的成员变量,您可以将其用作呈现目标。如果没有将 m_bWindowOnly 变量设置为 true,ActiveX 控件将不会创建自己的窗口。
最后,选择您的渲染器(例如 VMR9)
请注意,我的图形对象是一个自定义对象,并且 GetVideoRenderer() 是我自己的函数之一 - 它返回一个 IBaseFilter*。
我花了很长时间才找到这个。 ATL 的文档很少,这很遗憾,因为它是一项出色的技术。无论如何,希望这有帮助!
First of all, add this to the constructor of your ActiveX control:
Your ActiveX control will have a member variable called m_hWnd that you'll be able to use as a render target. without the m_bWindowOnly variable set true, the ActiveX control won't create its own window.
Finally, pick your renderer (VMR9 for example)
Please note that my graph object is a custom object and that GetVideoRenderer() is one of my own functions - it returns an IBaseFilter*.
It took me ages to find this one out. ATL is poorly documented, which is a shame, because it's an excellent technology. Anyways, hope this helps!
freefallr 的信息非常有帮助,但我认为它不能完全回答您的问题。无窗口 ActiveX 控件的技巧是您没有获得窗口。当您绘制时,您基本上只会获得一个设备上下文,并且您必须响应来自浏览器的调用,并且仅在它告诉您时才进行绘制。
所需的接口位于:http://msdn .microsoft.com/en-us/library/ms682300%28v=VS.85%29.aspx
更多信息请参见:http://msdn.microsoft.com/en-us/library/aa751970%28VS.85%29.aspx#OC96_and_Windowless_
一段时间以来,我们一直想在 FireBreath (http://firebreath.org) 中添加对此的支持;我们在所有 npapi 浏览器中都支持它,但看起来我们(尚)不支持 IE。如果您找到更多详细信息,请在此处发布摘要=]
freefallr's info is extremely helpful, but I don't think it answers your question completely. The trick with windowless activex controls is that you don't get a window. When you draw you'll just basically get a device context and you have to respond to call from the browser and only draw when it tells you to.
The interfaces required are here: http://msdn.microsoft.com/en-us/library/ms682300%28v=VS.85%29.aspx
more info here: http://msdn.microsoft.com/en-us/library/aa751970%28VS.85%29.aspx#OC96_and_Windowless_
We've been meaning to add support for this in FireBreath (http://firebreath.org) for awhile; we have support for it in all npapi browsers, but looks like we don't (yet) support IE. If you find more details, post a summary here =]