共用方式為


IFilterGraph::RemoveFilter

 
Microsoft DirectShow 9.0

IFilterGraph::RemoveFilter

The RemoveFilter method removes a filter from the graph.

Syntax

  HRESULT RemoveFilter(
  IBaseFilter *pFilter
);

Parameters

pFilter

[in] Pointer to the filter to be removed from the graph.

Return Values

Returns one of the following values.

Value Description
S_OK Success.
E_FAIL Failure.
E_POINTER Null pointer argument.

Remarks

The Filter Graph Manager notifies the filter that it is being removed by calling the filter's IBaseFilter::JoinFilterGraph method with a NULL argument. It is not necessary to disconnect the filter's pins before calling RemoveFilter, but the filter graph should be in the Stopped state. If the filters are not stopped, RemoveFilter may fail to disconnect the pins and then fail to remove the filter from the graph. IGraphConfig::RemoveFilterEx enables an application to remove a filter without disconnecting the pins automatically, which improves performance if you want to move groups of connected filters into a new graph.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also