0

Is it possible to disable filters which WPF's MediaElement is allowed to use?

I am disabling specific filters through IAMPluginControl using DirectShow.NET.

IAMPluginControl pluginControl
    = new DirectShowPluginControl() as IAMPluginControl;
if ( pluginControl == null )
{
    throw new InvalidOperationException(
        "Can't access DirectShow plugin filter control." );
}

bool disabled = pluginControl.SetDisabled(_directVobSub, true) == 0;
disabled &= pluginControl.SetDisabled(_directVobSubAutoloading, true) == 0;
disabled &= pluginControl.SetDisabled(_lavSplitter, true) == 0;

InitializeComponent();

I do this in the constructor of a video control, prior to calling InitializeComponent(). pluginControl indicates that the filters are in fact disabled, but this doesn't seem to affect to graph of MediaElement.

An important note is I can't see the graph explicitly. I am only guessing the graph is still using DirectVobSub as this should give a noticeable different visible result.

4

1 回答 1

0

Yes, this is possible starting from Windows 7.

I wasn't seeing any difference since still a different graph than expected was being created. DirectVobSub (auto-loading) persisted in showing up in the graph, but disabling any other filters works.

I didn't find any other way than to disable DirectVobSub through the registry.

P.s.: The 'effect' I was looking for is the possibility to dynamically change the playback rate of the video without visible delays after rate changes. Hooking DirectVobSub in the graph seems to prevent this from being possible.


As a reference for the older comments:

Before I thought that by setting the AVI Splitter as the preferred AVI filter, everything worked as expected, and that disabling DirectVobSub wasn't required. The actual reason it seemed to work at that point was since I was building x64 instead of x86, and DirectVobSub didn't intervene for this reason.

于 2011-10-24T12:38:10.560 回答