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
Name | Description |
m_pTransformFilter | Pointer to the owning CTransformFilter object. |
Public Data Members
Name | Description |
m_pPosition | Pointer to a CPosPassThru object that implements the IMediaPosition interface to pass media position commands on to the upstream filter. |
Member Functions
Name | Description |
CTransformOutputPin | Constructs a CTransformOutputPin object. |
CurrentMediaType | Retrieves the media type currently assigned to the filter. |
Overridable Member Functions
Name | Description |
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 | Returns 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
Name | Description |
Notify | Receives a quality-control notification, typically from a downstream filter. This method is inherited from the IQualityControl interface through the CBasePin class. |
Implemented IPin Methods
Name | Description |
QueryId | Retrieves an identifier for the pin. |
Implemented INonDelegatingUnknown Methods
Name | Description |
NonDelegatingQueryInterface | Returns an interface and increments the reference count. |
Informs the derived class when the connection is broken.
HRESULT BreakConnect( );
Returns NOERROR.
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.
HRESULT CheckConnect(
IPin *pPin
);
Returns NOERROR by default.
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.
HRESULT CheckMediaType(
const CMediaType* mtIn
);
No return value.
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.
HRESULT CompleteConnect(
IPin *pReceivePin
);
Returns an HRESULT value.
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.
CTransformOutputPin(
TCHAR *pObjectName,
CTransformFilter *pTransformFilter,
HRESULT * phr,
LPCWSTR pName
);
No return value.
Retrieves the media type currently assigned to the filter.
CMediaType& CurrentMediaType( );
Returns the value of CBasePin::m_mt.
Determines the number and size of buffers required.
HRESULT DecideBufferSize(
IMemAllocator * pAlloc,
ALLOCATOR_PROPERTIES * ppropInputRequest
);
Returns an HRESULT value.
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.
Returns the media type for the output pin to use.
HRESULT GetMediaType(
int iPosition,
CMediaType *pMediaType
);
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.
Value | Meaning |
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.
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.
Returns an interface and increments the reference count.
HRESULT NonDelegatingQueryInterface(
REFIID riid,
void ** ppv
);
Returns a pointer to the interface.
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.
HRESULT Notify(
IBaseFilter * pSelf,
Quality q
);
Default base class implementation returns E_FAIL.
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 CTransformInputPin::PassNotify member function, which passes the notification to the upstream filter after verifying that it is connected upstream.
Retrieves an identifier for the pin.
HRESULT QueryId(
LPWSTR * Id
);
Returns an HRESULT value.
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.
HRESULT SetMediaType(
const CMediaType* mt
);
Returns an HRESULT value (NOERROR by default).
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.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.