重新连接Directshow过滤器针 [英] Reconnect Directshow Filter Pin

查看:95
本文介绍了重新连接Directshow过滤器针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何重新连接过滤器引脚?

How to reconnect Filter Pins?

我创建了一个大小调整器过滤器(c ++),并添加了带有选项Pal(720X576)和Ntsc(720X480)的属性页。

I created a resizer filter (c++) and added a property page with options Pal(720X576) and Ntsc(720X480).(default is Pal).

在图形编辑中,我选择了一个视频文件并添加了我的调整大小过滤器,当我播放该图形时,它运行正常并在Pal中显示视频。
当我尝试将其更改为Ntsc时,无法正常工作。
为了使其正常工作,我需要先断开Resizer滤波器的引脚,然后更改输出设置,然后重新连接。(我手动执行此操作,并且视频正在Ntsc模式下播放。)

In Graph Edit i selected a video file and added My resizer filter to it, when i played the graph it is working fine and showing video in Pal. when i tried to change it to Ntsc, it is not working correctly. To make it work correctly i need to first disconnect the Resizer filter pins and then change the output settings and then reconnect it.(i do this manually and video is playing in Ntsc mode.)

是否可以重新连接Transform()中的过滤器或任何其他更好的建议。
请建议/指向仪式方向。

is it possible to reconnect the filter in Transform() or any other better suggestions. Please suggest/Point me in rite direction.

推荐答案

在图形停止时,您可以使用与创建图形相同的方式重新连接引脚:使用 IGraphBuilder :: Disconnect IGraphBuilder :: Connect 。您无法通过 Transform 方法执行此操作,因为停止的图形尚未调用它。

While the graph is stopped, you can reconnect pins the same way you build the graph: using IGraphBuilder::Disconnect, IGraphBuilder::Connect. You cannot do it from Transform method because stopped graph does not yet call it.

图形运行时,可以尝试动态地重新同意媒体类型的连接,但不能保证正常工作。请参见动态格式更改

When the graph is running you can try to dynamically re-agree media type connection, which is not guaranteed to work. See Dynamic Format Changes:


当过滤器切换媒体类型时,称为动态格式
更改。如果您正在编写DirectShow筛选器,则应了解
动态格式更改的机制。即使您的过滤器确实
不支持此类更改,如果另一个
过滤器要求使用新格式,它也应该正确响应。

When a filter switches media types, it is called a dynamic format change. If you are writing a DirectShow filter, you should be aware of the mechanisms for dynamic format changes. Even if your filter does not support such changes, it should respond correctly if another filter requests a new format.

这篇关于重新连接Directshow过滤器针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆