Microsoft DirectX 8.0

CTransformOutputPin Class

CTransformOutputPin class hierarchy

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_pTransformFilterPointer to the owning filter.
Public Member Variables
m_pPositionHelper object to pass seek commands upstream.
Public Methods
CTransformOutputPinConstructor method.
~CTransformOutputPinDestructor method.
CheckConnectDetermines whether a pin connection is suitable.
BreakConnectReleases the pin from a connection.
CompleteConnectCompletes a connection to another pin.
CheckMediaTypeDetermines if the pin accepts a specific media type.
SetMediaTypeSets the media type for the connection.
DecideBufferSizeSets the buffer requirements.
GetMediaTypeRetrieves a preferred media type, by index value.
CurrentMediaTypeRetrieves the media type for the current pin connection.
IPin Methods
QueryIdRetrieves an identifier for the pin.
IQualityControl Methods
NotifyNotifies the pin that a quality change is requested.

CTransformOutputPin.m_pTransformFilter

CTransformOutputPin Class

Pointer to the owning filter.

Syntax

CTransformOutputPin *m_pTransformFilter;

CTransformOutputPin.m_pPosition

CTransformOutputPin Class

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.

CTransformOutputPin::BreakConnect

CTransformOutputPin Class

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.

CTransformOutputPin::CheckConnect

CTransformOutputPin Class

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_OKSuccess.
E_UNEXPECTEDThe 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.

CTransformOutputPin::CheckMediaType

CTransformOutputPin Class

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_OKSuccess.
E_INVALIDARGThe 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.

CTransformOutputPin::CompleteConnect

CTransformOutputPin Class

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.

CTransformOutputPin::CTransformOutputPin

CTransformOutputPin Class

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.

CTransformOutputPin::~CTransformOutputPin

CTransformOutputPin Class

Destructor method.

Syntax

~CTransformOutputPin(void);

CTransformOutputPin::CurrentMediaType

CTransformOutputPin Class

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.

CTransformOutputPin::DecideBufferSize

CTransformOutputPin Class

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.

CTransformOutputPin::GetMediaType

CTransformOutputPin Class

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_OKSuccess
VFW_S_NO_MORE_ITEMSIndex 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.

CTransformOutputPin::Notify

CTransformOutputPin Class

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_OKSuccess.
VFW_E_NOT_FOUNDCould 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).

CTransformOutputPin::QueryId

CTransformOutputPin Class

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_OKSuccess
E_OUTOFMEMORYInsufficient memory
E_POINTERNULL 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.

CTransformOutputPin::SetMediaType

CTransformOutputPin Class

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.