Compartilhar via


CBaseMediaFilter Class (Compact 2013)

3/26/2014

CUnknown Class

     IMediaFilter Interface

          CBaseMediaFilter Class

This is an abstract base class that provides support for the IMediaFilter interface.

The CBaseMediaFilter class handles State_Stopped, State_Paused, and State_Running state transitions.

Typically, this class is used for plug-in distributors rather than filters with pins. Derive your filter classes from the CBaseFilter class (or base classes derived from this) instead of from this class.

All member functions in this class that return HRESULT and accept a pointer as a parameter return E_POINTER when passed a null pointer.

Protected Data Members

Member

Description

m_clsid

Class identifier (CLSID) used for serialization using IPersist.

m_pClock

Pointer to a reference clock used for synchronization.

The reference count of the clock object must be incremented using AddRef.

Pass NULL if no reference clock is available.

m_State

Current state of the filter, which can be State_Stopped, State_Paused, or State_Running.

m_tStart

Offset from the stream time to the reference time.

Member Functions

Member function

Description

CBaseMediaFilter

Constructs a CBaseMediaFilter object.

IsActive

Determines if the filter is active (running or paused) or stopped.

Overrideable Member Functions

Member function

Description

StreamTime

Returns the current stream time.

Implemented IPersist Methods

Method

Description

GetClassID

Returns the class identifier of this filter.

Implemented IMediaFilter Methods

Method

Description

GetState

Retrieves the current state of the filter.

GetSyncSource

Retrieves the current reference clock in use by this filter.

Pause

Instructs the filter to transition to the new (paused) state.

Run

Instructs the filter to transition to the new (running) state.

SetSyncSource

Informs the filter of the reference clock it should synchronize activity with.

Stop

Instructs the filter to transition to the new (stopped) state.

Implemented INonDelegatingUnknown Methods

Method

Description

NonDelegatingQueryInterface

Passes out references to interfaces supported by CBaseFilter.

To pass out pointers to interfaces supported in a derived filter class, override this.

Requirements

Header

dshow.h,
Streams.h

Library

ole32.lib,
Ole32auth.lib,
Strmbase.lib,
Strmiids.lib,
uuid.lib

See Also

Reference

DirectShow Classes