The CTransformOutputPin class implements the output pin of a simple transform filter. It is the class assigned to the m_pOutput data member of the CTransformFilter class. Typically, you can create objects of a class derived from CTransformFilter without modifying the CTransformOutputPin class. If you want to override this class and derive a class from CTransformFilter, use the class and then override the CTransformFilter::GetPin member function to create pins of your derived class.
Protected Data Members
m_pTransformFilter Pointer to the owning CTransformFilter object.
m_pPosition Pointer to a CPosPassThru object that implements the IMediaPosition interface to pass media position commands on to the upstream filter.
Member Functions
CTransformOutputPin Constructs a CTransformOutputPin object. CurrentMediaType Retrieves the media type currently assigned to the filter.
Overridable Member Functions
BreakConnect Informs the derived class when the connection is broken. CheckConnect Informs the derived class when the connection process is starting. CheckMediaType Determines if the pin can use a specified media type. CompleteConnect Informs the derived class when the connection process has completed. DecideBufferSize Determines the number and size of buffers required. GetMediaType Retrieves the media type that the output pin uses. SetMediaType Informs the derived class when the media type is established for the connection.
Implemented IQualityControl Methods
Notify Receives a quality-control notification, typically from a downstream filter. This method is inherited from the IQualityControl interface through the CBasePin class.
QueryId Retrieves an identifier for the pin.
Implemented INonDelegatingUnknown Methods
NonDelegatingQueryInterface Retrieves an interface and increments the reference count.
Informs the derived class when the connection is broken.
Syntax
HRESULT BreakConnect(void);
Return Value
Returns NOERROR.
Remarks
This member function overrides the CBaseOutputPin::BreakConnect member function and calls the CTransformFilter::BreakConnect member function. It then calls the base class implementation in CBaseOutputPin::BreakConnect. Override CTransformFilter::BreakConnect to undo anything carried out in the CTransformOutputPin::CheckConnect member function (for example, releasing interfaces previously added to the reference count).
Informs the derived class when the connection process is starting.
Syntax
HRESULT CheckConnect( IPin *pPin );
Parameters
- pPin
- Pointer to the IPin interface of the connecting pin.
Return Value
Returns NOERROR by default.
Remarks
This member function overrides the CBasePin::CheckConnect member function and calls the CTransformFilter::CheckConnect member function. It then calls the base class implementation in CBaseOutputPin::CheckConnect. Override CTransformFilter::CheckConnect to add additional interfaces.
Determines if the input pin supports a specified media type.
Syntax
HRESULT CheckMediaType( const CMediaType *mtIn );
Parameters
- mtIn
- Pointer to a media type object.
Return Value
No return value.
Remarks
This member function calls the pure-virtual CTransformFilter::CheckTransform member function, which must be overridden when deriving a class from the CTransformFilter class. The overridden CTransformFilter::CheckTransform member function determines which media types the output pin supports.
Informs the derived class when the connection process has completed.
Syntax
HRESULT CompleteConnect( IPin *pReceivePin );
Parameters
- pReceivePin
- Pointer to the output pin that is being connected to.
Return Value
Returns an HRESULT value.
Remarks
This member function overrides the CBaseOutputPin::CompleteConnect member function and calls the CTransformFilter::CompleteConnect member function, which returns NOERROR by default. It then calls the base class implementation in CBaseOutputPin::CompleteConnect. Override the CTransformFilter::CompleteConnect member function to retrieve any additional interfaces not retrieved by the base class that your output pin might need from the connected pin.
Constructs a CTransformOutputPin object.
Syntax
CTransformOutputPin( TCHAR *pObjectName, CTransformFilter *pTransformFilter, HRESULT *phr, LPCWSTR pName );
Parameters
- pObjectName
- Pointer to the name of the CTransformOutputPin object.
- pTransformFilter
- Pointer to the CTransformFilter class.
- phr
- Pointer to an HRESULT value in which to return resulting information. This should be modified only if a failure occurs. If it is a failure code on input, construction can be aborted, but in any case the destructor will be called by the creator when the HRESULT error is detected.
- pName
- Pointer to the name of the pin.
Return Value
No return value.
Retrieves the media type currently assigned to the filter.
Syntax
CMediaType& CurrentMediaType(void);
Return Value
Returns the value of CBasePin::m_mt.
Determines the number and size of buffers required.
Syntax
HRESULT DecideBufferSize( IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest );
Parameters
- pAlloc
- Pointer to the allocator assigned to the transfer.
- ppropInputRequest
- Pointer to the requested allocator properties for count, size, and alignment, as specified by the ALLOCATOR_PROPERTIES structure.
Return Value
Returns an HRESULT value.
Remarks
This member function overrides the CBaseOutputPin::DecideBufferSize member function and calls the pure virtual CTransformFilter::DecideBufferSize member function, which your derived class must override and implement. This member function is called from the CBaseOutputPin class during the connection process.
Retrieves the media type for the output pin to use.
Syntax
HRESULT GetMediaType( int iPosition, CMediaType *pMediaType );
Parameters
- iPosition
- Position of the media type in the media type list.
- pMediaType
- Pointer to the returned media type object.
Return Value
Returns an HRESULT value that depends on the implementation of the pure virtual CTransformFilter::GetMediaType member function. HRESULT can include one of the following constants.
NOERROR A media type is returned. S_FALSE Although the iPosition parameter typically is valid, it does not correspond to a media type that is currently valid. VFW_S_NO_MORE_ITEMS The iPosition parameter is beyond the valid range. Use other standard error values, such as E_INVALIDARG, for error cases.
Remarks
This member function overrides the CBasePin::GetMediaType member function and calls the pure virtual CTransformFilter::GetMediaType member function, which must be overridden to return media types supported by your filter. This is part of the implementation of CBasePin::EnumMediaTypes.
Retrieves an interface and increments the reference count.
Syntax
HRESULT NonDelegatingQueryInterface( REFIID riid, void **ppv );
Parameters
- riid
- Reference identifier.
- ppv
- Address of a pointer to the interface.
Return Value
Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful. If the query is unsuccessful and the requested interface is IMediaPosition or IMediaSeeking, returns an HRESULT from a call to CreatePosPassThru. If the query is unsuccessful and the interface is not IMediaPosition or IMediaSeeking, returns E_NOINTERFACE.
Remarks
This member function implements the INonDelegatingUnknown::NonDelegatingQueryInterface method. It overrides the CBasePin::NonDelegatingQueryInterface member function and passes references to the IPin, IQualityControl, IMediaPosition, IMediaSeeking, and IUnknown interfaces. Override this class to return other interfaces on the object in the derived class.
Notifies the recipient that a quality change is requested.
Syntax
HRESULT Notify( IBaseFilter *pSelf, Quality q );
Parameters
- pSelf
- Pointer to the filter that is sending the quality notification.
- q
- Quality notification structure.
Return Value
Default base class implementation returns E_FAIL.
Remarks
This member function implements the IQualityControl::Notify method and overrides the CBasePin::Notify member function. It calls the CTransformFilter::AlterQuality member function to determine if the filter can do something to adjust the quality of the media stream (such as discarding samples). If that member function returns S_FALSE, it calls the CBaseInputPin::PassNotify member function, which passes the notification to the upstream filter after verifying that it is connected upstream.
Retrieves an identifier for the pin.
Syntax
HRESULT QueryId( LPWSTR *Id );
Parameters
- Id
- Address of a pointer to the pin identifier.
Return Value
Returns an HRESULT value.
Remarks
This member function implements the IPin::QueryId method and overrides the CBasePin::QueryId member function. It returns the name "Out". The caller is responsible for freeing the memory by using the Microsoft® Win32® CoTaskMemFree function.
Sets the media type for the connection to use.
Syntax
HRESULT SetMediaType( const CMediaType *mt );
Parameters
- mt
- Pointer to an output media type to be used.
Return Value
Returns an HRESULT value (NOERROR by default).
Remarks
This member function overrides the CBasePin::SetMediaType member function and calls the CTransformFilter::SetMediaType member function with the direction set to output. Override CTransformFilter::SetMediaType to handle any conditions that you want handled at this time in the connection process.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.