Microsoft DirectX 8.0 |
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 | |
---|---|
CSeekingPassThru | Constructor method. |
~CSeekingPassThru | Destructor method. |
CreateInstance | Creates an instance of the object. |
ISeekingPassThru Methods | |
Init | Initializes the object. |
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.
Destructor method.
Syntax
~CPosPassThru(void);
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
Return Value
Returns a pointer to a new CSeekingPassThru object.
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_OK Success. E_FAIL Object 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.