IGraphConfig::RemoveFilterEx method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The RemoveFilterEx method removes a filter from the filter graph.

Syntax

HRESULT RemoveFilterEx(
  [in] IBaseFilter *pFilter,
  [in] DWORD       Flags
);

Parameters

[in] pFilter

Pointer to the IBaseFilter interface of the filter to remove from the graph.

[in] Flags

Combination of flags from the REM_FILTER_FLAGS enumerated type.

Return value

Returns S_OK if successful, or an HRESULT value indicating the cause of the failure.

Remarks

This method extends the IFilterGraph::RemoveFilter method by accepting a flag that specifies the behavior of the method. This flag enables an application to remove a filter without disconnecting the pins automatically, which improves performance when moving groups of connected filters into a new graph.

By default, this method disconnects the filter before removing it from the graph. Use the REMFILTERF_LEAVECONNECTED flag to leave the filter connected.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IGraphConfig Interface