使用CC解码器过滤器时,停止Directshow图会冻结WinXP [英] Stopping a Directshow graph freezes WinXP when using CC Decoder filter

查看:91
本文介绍了使用CC解码器过滤器时,停止Directshow图会冻结WinXP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行Windows XP x64的PC,我试图使用USB PCTV(Conexant Polaris)从模拟电视录制视频和音频以及隐藏式字幕。作为初始测试,我在GraphStudio中使用以下过滤器链构建了一个简单的图形:

I have a PC running Windows XP x64 and I am trying to record video+audio and closed caption from Analog TV using a USB PCTV (Conexant Polaris). As a initial test, I have built a simple graph in GraphStudio with the following chain of filters:

Crossbar > Video Capture > CC Decoder > Line 21 Decoder > Video Renderer

我可以播放此视频,并观看它呈现的视频显示正确的隐藏式字幕,但是几乎每次我在GraphStudio中单击停止,计算机将冻结并且必须重新启动它。

I can play this and see it render a video showing correct closed caption, but almost every time I hit stop in GraphStudio, the computer will freeze and I have to reboot it.

我还使用.NET 4 + DirectShowLib编写了一项服务。由于它是一项服务,因此没有要锁定的UI。我有以下链接:

I also have wrote a service, using .NET 4 + DirectShowLib. As it is a service, there is no UI to lock. I have the following chain:

Video Capture > Infinite Pin Tee Filter > ASF Writer
Video Capture > CC Decoder > SampleGrabber > NullRenderer

我使用IFilterGraph2.AddFilter()和ICaptureGraphBuilder2.RenderStream()方法创建过滤器实例并进行连接全部在一起。当我调用IMediaControl.Stop()时,该应用程序使计算机冻结。我已经尝试过使用DebugViewer,如StackOverflow其他文章中所建议的那样,但是我没有设法捕获任何信息。 Watson Dr转储中也没有信息。

I use IFilterGraph2.AddFilter() and ICaptureGraphBuilder2.RenderStream() methods to create filter instances and connect it all together. When I call IMediaControl.Stop(), the application causes the computer to freeze. I've tried using DebugViewer, as suggested in other posts at StackOverflow, but I have not managed to capture any information. There is also no information in Dr Watson dumps.

我在每个接口上都调用Marshal.ReleaseComObject()-尝试在MediaControl.Stop()之前和之后进行操作-,但是StackOverflow中的许多帖子都说我不应该这样做,所以我删除了那些调用,这对冻结没有帮助。我还尝试过在VBI引脚上调用MediaControl.Stop()和EndFlush()之前停止Video Capture过滤器:

I was calling Marshal.ReleaseComObject() on each interface -- tried doing that before and after the MediaControl.Stop() --, but many posts in StackOverflow said I should not do that, so I removed those calls, which didn't help with the freezing. I have also tried stopping the Video Capture filter before calling MediaControl.Stop() and calling EndFlush() at the VBI pin:

IEnumPins enumPins = null;
int hr = _source.EnumPins(out enumPins);
if (hr == 0)
{
    IPin[] pins = new IPin[1];
    int pcFetched = 0;
    while (enumPins.Next(1, pins, out pcFetched) == 0)
    {
        try
        {
            PinDirection pDir = new PinDirection();
            hr = pins[0].QueryDirection(out pDir);
            PinInfo pInfo = new PinInfo();
            hr = pins[0].QueryPinInfo(out pInfo);

            if (hr == 0 && pInfo.name == pinName)
                pins[0].EndFlush();
        }
        finally
        {
            Marshal.ReleaseComObject(pins[0]);
            pins[0] = null;
        }
    }
    Marshal.ReleaseComObject(enumPins);
    enumPins = null;
    pins = null;
}          

这个想法是,没有信号可能导致CC解码器滤波器出现死锁,

The idea was that no signal could cause a deadlock at the CC Decoder filter, but that didn't work.

我也尝试过使用Windows 7 x64计算机,其中CC Decoder过滤器由VBI Codec代替。更稳定。但是我想我不能在XP中使用VBI编解码器,可以吗?

I also have tried to use a computer with Windows 7 x64, where the CC Decoder filter is replaced by VBI Codec, which seems to be much more stable. But I guess I cannot use VBI Codec in XP, can I? Changing the OS is not an option for me.

当我无法访问过滤器的内部结构时,如何避免这些死锁?我认为EndFlush()解决方案应该有效,我在那做错了吗?我还想在XP中测试VBI编解码器,即使它不是针对该OS的,也有办法做到吗?

How can I avoid these deadlocks when I I have no access to the internals of the filters? I think the EndFlush() solution should have worked, have I done something wrong there? I would also like to test VBI Codec in XP, even though it is not meant for that OS, is there a way to do that?

谢谢。

推荐答案

冻结,需要重新启动(而不是简单地终止任务)才能解决问题,这表明驱动程序存在问题。视频捕获设备驱动程序据说已冻结,从而导致错误。最好的办法就是从硬件供应商那里获得更好的驱动程序。

Freeze which requires reboot (as opposed to simply killing the task) to get things fixed is an indication of driver issue. The video capture device driver is supposedly having freeze causing bugs. The best you can do is to get a better driver from hardware vendor.

这篇关于使用CC解码器过滤器时,停止Directshow图会冻结WinXP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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