简体   繁体   English

DirectShow图形中的消息传递

[英]Messaging in DirectShow Graph

I parse some information in my own source filter. 我在自己的源过滤器中解析一些信息。 I need send this information to my transform filter. 我需要将此信息发送到我的转换过滤器。 How can I do that? 我怎样才能做到这一点? Thanks. 谢谢。

There is no standard general messaging for a task defined that broad. 对于如此宽泛的任务,没有标准的通用消息传递。

  1. You can connect filters outside of pipeline and have them exchanged with messages of any kind 您可以在管道外部连接过滤器,并使它们与任何类型的消息交换
  2. With direct connection between the two, receiver might implement a custom interface sender would discover and use 通过两者之间的直接连接,接收方可以实现自定义接口,发送方可以发现并使用
  3. same as 2 above, but sender might walk around the graph to find the interface of interest (enumerating connected filters and pins) 与上面的2相同,但发送者可能会在图形中四处走动以找到感兴趣的接口(枚举连接的滤波器和引脚)
  4. Filters might take advantage of graph's IRegisterServiceProvider interface to expose and discover custom interfaces/services of interest 筛选器可能会利用图的IRegisterServiceProvider接口来公开和发现感兴趣的自定义接口/服务

I choose to use Mailslot. 我选择使用Mailslot。 It's work fine. 很好

If you are the source, then why not just extend the CMediaSample class with an own interface? 如果您是来源,那么为什么不使用自己的接口扩展CMediaSample类呢?

Or a second approach would be to send the MediaType with each sample and then save the extra bytes in the pbFormat block. 或者,第二种方法是随每个样本一起发送MediaType,然后将多余的字节保存在pbFormat块中。

If you need to send information on a sample basis, these two methods are the best and cleanest way. 如果您需要以示例方式发送信息,则这两种方法是最好,最简洁的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM