Microsoft DirectX 8.0 |
Output pin used by the CTransformFilter class.
Declaration: Transfrm.h
Typically, you do not need to derive from this class. Most of the methods in this class call corresponding methods on the CTransformFilter class, which you can override. If you derive from this class, you must override the filter's CTransformFilter::GetPin method to create instances of your derived class.
Protected Member Variables | |
---|---|
m_pTransformFilter | Pointer to the owning filter. |
Public Member Variables | |
m_pPosition | Helper object to pass seek commands upstream. |
Public Methods | |
CTransformOutputPin | Constructor method. |
~CTransformOutputPin | Destructor method. |
CheckConnect | Determines whether a pin connection is suitable. |
BreakConnect | Releases the pin from a connection. |
CompleteConnect | Completes a connection to another pin. |
CheckMediaType | Determines if the pin accepts a specific media type. |
SetMediaType | Sets the media type for the connection. |
DecideBufferSize | Sets the buffer requirements. |
GetMediaType | Retrieves a preferred media type, by index value. |
CurrentMediaType | Retrieves the media type for the current pin connection. |
IPin Methods | |
QueryId | Retrieves an identifier for the pin. |
IQualityControl Methods | |
Notify | Notifies the pin that a quality change is requested. |
Pointer to the owning filter.
Syntax
CTransformOutputPin *m_pTransformFilter;
Helper object to pass seek commands upstream.
Syntax
IUnknown *m_pPosition;
Remarks
When the pin is first queried for the IMediaPosition or IMediaSeeking interface, it creates and aggregates a CPosPassThru helper object.
Releases the pin from a connection.
Syntax
HRESULT BreakConnect(void);
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method overrides the CBaseOutputPin::BreakConnect method. It calls the filter's CTransformFilter::BreakConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::BreakConnect method.
Determines whether a pin connection is suitable.
Syntax
HRESULT CheckConnect( IPin *pPin );
Parameters
- pPin
- Pointer to the output pin's IPin interface.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. E_UNEXPECTED The filter's input pin is not connected.
Remarks
This method overrides the CBaseOutputPin::CheckConnect method. It calls the filter's CTransformFilter::CheckConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::CheckConnect method to perform additional checks.
Determines if the pin accepts a specific media type.
Syntax
HRESULT CheckMediaType( const CMediaType *mtIn );
Parameters
- mtIn
- Pointer to a CMediaType object that contains the proposed media type.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. E_INVALIDARG The filter's input pin is not connected.
Remarks
This method implements the pure virtual CBasePin::CheckMediaType method. The method fails if the filter's input pin is not connected. Otherwise, it calls the filter's CTransformFilter::CheckTransform method, which is also pure virtual. The filter's derived class must implement CheckTransform, which determines if the proposed output media type is compatible with the input media type.
Completes a connection to another pin.
Syntax
HRESULT CompleteConnect( IPin *pReceivePin );
Parameters
- pReceivePin
- Pointer to the other pin's IPin interface.
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method overrides the CBaseOutputPin::CompleteConnect method. It calls the filter's CTransformFilter::CompleteConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::CompleteConnect method to perform additional checks.
Constructor method.
Syntax
CTransformOutputPin( TCHAR *pObjectName, CTransformFilter *pTransformFilter, HRESULT *phr, LPCWSTR pName );
Parameters
- pObjectName
- String containing the debug name of the object. For more information, see CBaseObject.
- pTransformFilter
- Pointer to the filter that created this pin, which must be a CTransformFilter object.
- phr
- Pointer to a variable that receives an HRESULT value indicating the success or failure of the method. Initialize the value to S_OK before creating the object. The value is changed only if an error occurs.
- pName
- Unicode string containing the pin name.
Remarks
The pName parameter specifies the pin name, which is returned by the IPin::QueryPinInfo method. However, the string is not used for the pin identifier. The pin identifier for this class is always Out. For more information, see QueryId.
Destructor method.
Syntax
~CTransformOutputPin(void);
Retrieves the media type for the current pin connection.
Syntax
CMediaType& CurrentMediaType(void);
Return Value
Returns a reference to the CBasePin::m_mt member variable.
Sets the buffer requirements.
Syntax
HRESULT DecideBufferSize( IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest );
Parameters
- pAlloc
- Pointer to the allocator's IMemAllocator interface.
- ppropInputRequest
- Pointer an ALLOCATOR_PROPERTIES structure that contains the input pin's buffer requirements.
Return Value
Returns an HRESULT value.
Remarks
This method overrides the CBaseOutputPin::DecideBufferSize method. It calls the filter's pure virtual CTransformFilter::DecideBufferSize method, which the filter's derived class must implement.
Retrieves a preferred media type, by index value.
Syntax
HRESULT GetMediaType( int iPosition, CMediaType *pMediaType );
Parameters
- iPosition
- Zero-based index value.
- pMediaType
- Pointer to a CMediaType object that receives the media type.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success VFW_S_NO_MORE_ITEMS Index out of range
Remarks
This method overrides the CBasePin::GetMediaType method. If the filter's input pin is not connected, the method returns VFW_S_NO_MORE_ITEMS. Otherwise, it calls the filter's CTransformFilter::GetMediaType method to retrieve the media type. The CTransformFilter::GetMediaType method is pure virtual; the filter's derived class must override it.
Notifies the pin that a quality change is requested. Implements the IQualityControl::Notify method.
Syntax
HRESULT Notify( IBaseFilter *pSelf, Quality q );
Parameters
- pSelf
- Pointer to the IBaseFilter interface of the filter that delivered the quality control message.
- q
- Quality structure that contains the quality control message.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. VFW_E_NOT_FOUND Could not find an object to accept the message.
Remarks
This method calls the filter's CTransformFilter::AlterQuality method. If the filter does not handle the quality message, this method calls the CBaseInputPin::PassNotify method on the filter's input pin. The PassNotify method passes the quality message upstream (or to a custom quality manager, if one was installed).
Retrieves an identifier for the pin. Implements the IPin::QueryId method.
Syntax
HRESULT QueryId( LPWSTR *Id );
Parameters
- Id
- Address of a variable that receives a string containing the pin identifier.
Return Value
Returns one of the HRESULT values shown in the following table.
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
The pin identifier is used for graph persistence. The pin identifier for this class is Out. This class overrides the behavior of the CBasePin class. In the CBasePin class, the pin identifier is the same as the pin name, specified in the class constructor. In the CTransformInputPin class, the pin identifier and the pin name are not the same.
Sets the media type for the connection.
Syntax
HRESULT SetMediaType( const CMediaType *mt );
Parameters
- mt
- Pointer to a CMediaType object that specifies the media type.
Return Value
Returns S_OK.
Remarks
This method overrides the CBasePin::SetMediaType method. It calls the filter's CTransformFilter::SetMediaType method to inform the filter.
The pin must verify that the media type is acceptable before calling this method.