Microsoft DirectX 8.0

CSeekingPassThru Class

Helper object that creates CPosPassThru and CRendererPosPassThru objects.

Declaration: Seekpt.h

The CPosPassThru and CRendererPosPassThru classes are helper objects that pass seeking commands upstream. The CSeekingPassThru class is a helper object for creating these helper objects. DirectShow adds further support by packaging this class as a COM component. (See SeekingPassThru.)

This class exposes the ISeekingPassThru interface. The ISeekingPassThru::Init method initializes the object. After the object is initialized, the filter can query it for the IMediaSeeking and IMediaPosition interfaces.

Filters can call the CreatePosPassThru helper function to create and initialize an instance of this object. The following code example is taken from a filter's QueryInterface method. It creates the helper object and queries it for a seeking interface:

if (riid == IID_IMediaPosition || riid == IID_IMediaSeeking) {
    if (m_pPosition == NULL) 
    {
        HRESULT hr = CreatePosPassThru(GetOwner(), FALSE, 
                        m_pFilter->m_pPin, &m_pPosition);
        if (FAILED(hr)) 
            return hr;
    }
    return m_pPosition->QueryInterface(riid, ppv);
}
Public Methods
CSeekingPassThruConstructor method.
~CSeekingPassThruDestructor method.
CreateInstanceCreates an instance of the object.
ISeekingPassThru Methods
InitInitializes the object.

CSeekingPassThru::CSeekingPassThru

CSeekingPassThru Class

Constructor method.

Syntax

CPosPassThru(
    const TCHAR *pName,
    LPUNKNOWN pUnk,
    HRESULT *phr,
);

Parameters

pName
String containing the name of the object. See CBaseObject for more information.
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.
phr
Pointer to an HRESULT value. Ignored.

CSeekingPassThru::~CSeekingPassThru

CSeekingPassThru Class

Destructor method.

Syntax

~CPosPassThru(void);

CSeekingPassThru::CreateInstance

CSeekingPassThru Class

Creates an instance of the object. This method supports creation of the object through a class factory. For more information, see CFactoryTemplate.

Syntax

static CUnknown *CreateInstance(
    LPUNKNOWN pUnk, 
    HRESULT *phr
);

Parameters

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.
phr
Pointer to an HRESULT value. Ignored.

Return Value

Returns a pointer to a new CSeekingPassThru object.

CSeekingPassThru::Init

CSeekingPassThru Class

Initializes the object.

Syntax

HRESULT Init(
    BOOL bSupportRendering,
    IPin *pPin
);

Parameters

bSupportRendering
[in] Boolean value that specifies whether the filter is a renderer. Use the value TRUE if the filter is a renderer, or FALSE otherwise.
pPin
Pointer to the IPin interface on the filter's input pin.

Return Value

Returns one of the HRESULT values shown in the following table.

S_OKSuccess.
E_FAILObject was already initialized.
E_OUTOFMEMORY Not enough memory to create the object.

Remarks

If the value of bSupportRendering is TRUE, this method creates an instance of the CRendererPosPassThru class. Otherwise, it creates an instance of the CPosPassThru class.