从 DirectShow 过滤器发送消息到属性页
我编写了一个 Directshow 过滤器,它派生自 CTransInPlace 并实现单个属性页。将数据从属性页传递到过滤器并将数据从过滤器拉到属性页效果很好(使用定义的接口),但我想从过滤器向属性页发送通知以表示发生了某些事情(在此情况下,均衡器中发生了削波)。
我现在遇到了麻烦,因为我没有从过滤器内引用属性页,并且属性页是由 GraphEdit 实例化的。
向属性页发送某种类型的消息或通知的最佳方式是什么?
I've written a Directshow filter that derives from CTransInPlace and implements a single property page. Passing data to the filter from the property page and pulling data from the filter to the property page works great (using a defined interface), but I want to send a notification from the filter to the property page to signify something has happened (in this case, clipping has occurred in an equalizer).
I'm having trouble at this point, because I have no reference to the property page from within the filter, and the property page is instantiated by GraphEdit.
What's the best way to send some type of message or notification to the property page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在过滤器中实现回调函数。看一下样本采集器过滤器。有一种类似的情况:
samplegrabber过滤器实现了 ISampleGrabber 接口,其中包括 SetCallback 函数。需要接收回调的类,需要实现 ISampleGrabberCB 接口。调用 SetCallback 时,您将传递一个指向 ISampleGrabberCB 接口的指针。现在,samplegrabber 过滤器可以调用该接口中的函数(BufferCB 或 SampleCB)。
You can implement a callback function in the filter. Take a look at the samplegrabber filter. There is a simular situation:
The samplegrabber filter implements the ISampleGrabber Interface which includes a SetCallback function. The class which needs to receive the callback, needs to implement the ISampleGrabberCB Interface. When calling SetCallback you pass a pointer to the ISampleGrabberCB Interface. Now the samplegrabber filter can call a function (BufferCB or SampleCB) in that interface.