CBaseFilter.CBaseFilter(const TCHAR*, LPUNKNOWN, CCritSec*, REFCLSID, HRESULT*) constructor

[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.]

Constructor method.

Syntax

CBaseFilter(
   const TCHAR     *pName,
         LPUNKNOWN pUnk,
         CCritSec  *pLock,
         REFCLSID  clsid,
         HRESULT   *phr
);

Parameters

pName

Pointer to a string containing the name of the filter, for debugging purposes.

pUnk

Pointer to the owner of this object. If the object is aggregated, pass a pointer to the aggregating object's IUnknown interface. Otherwise, set this parameter to NULL.

pLock

Pointer to a CCritSec lock, used to serialize state changes.

clsid

Class identifier (CLSID) of the filter.

phr

Pointer to an HRESULT value. The constructor ignores this parameter.

Remarks

For the critical section object, you would typically do one of the following:

  • Derive a class that inherits both CBaseFilter and CCritSec. For pLock, pass the this pointer.
  • Derive a class that inherits CBaseFilter and contains a CCritSec member variable. For pLock, pass the address of that variable.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseFilter Class