DirectShow Animated Header -- CTransformOutputPin Class DirectShow Animated Header -- CTransformOutputPin Class* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: CTransformInputPin Class
*Next Topic: CTransInPlaceFilter Class

CTransformOutputPin Class


CTransformOutputPin class hierarchy

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.


CTransformOutputPin::BreakConnect

CTransformOutputPin Class

Informs the derived class when the connection is broken.

HRESULT BreakConnect( );

Return Values

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


CTransformOutputPin::CheckConnect

CTransformOutputPin Class

Informs the derived class when the connection process is starting.

HRESULT CheckConnect(
  IPin *pPin
  );

Parameters
pPin
Pointer to the IPin interface of the connecting pin.
Return Values

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.


CTransformOutputPin::CheckMediaType

CTransformOutputPin Class

Determines if the input pin supports a specified media type.

HRESULT CheckMediaType(
  const CMediaType* mtIn
  );

Parameters
mtIn
Pointer to a media type object.
Return Values

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.


CTransformOutputPin::CompleteConnect

CTransformOutputPin Class

Informs the derived class when the connection process has completed.

HRESULT CompleteConnect(
  IPin *pReceivePin
  );

Parameters
pReceivePin
Pointer to the output pin that is being connected to.
Return Values

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.


CTransformOutputPin::CTransformOutputPin

CTransformOutputPin Class

Constructs a CTransformOutputPin object.

CTransformOutputPin(
  TCHAR *pObjectName,
  CTransformFilter *pTransformFilter,
  HRESULT * phr,
  LPCWSTR pName
  );

Parameters
pObjectName
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
Name of the pin.
Return Values

No return value.


CTransformOutputPin::CurrentMediaType

CTransformOutputPin Class

Retrieves the media type currently assigned to the filter.

CMediaType& CurrentMediaType( );

Return Values

Returns the value of CBasePin::m_mt.


CTransformOutputPin::DecideBufferSize

CTransformOutputPin Class

Determines the number and size of buffers required.

HRESULT DecideBufferSize(
  IMemAllocator * pAlloc,
  ALLOCATOR_PROPERTIES * ppropInputRequest
  );

Parameters
pAlloc
Allocator assigned to the transfer.
ppropInputRequest
Requested allocator properties for count, size, and alignment, as specified by the ALLOCATOR_PROPERTIES structure.
Return Values

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.


CTransformOutputPin::GetMediaType

CTransformOutputPin Class

Returns the media type for the output pin to use.

HRESULT GetMediaType(
  int iPosition,
  CMediaType *pMediaType
  );

Parameters
iPosition
Position of the media type in the media type list.
pMediaType
Returned media type object.
Return Values

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.

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.


CTransformOutputPin::NonDelegatingQueryInterface

CTransformOutputPin Class

Returns an interface and increments the reference count.

HRESULT NonDelegatingQueryInterface(
  REFIID riid,
  void ** ppv
  );

Parameters
riid
Reference identifier.
ppv
Pointer to the interface.
Return Values

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.


CTransformOutputPin::Notify

CTransformOutputPin Class

Notifies the recipient that a quality change is requested.

HRESULT Notify(
  IBaseFilter * pSelf,
  Quality q
  );

Parameters
pSelf
Pointer to the filter that is sending the quality notification.
q
Quality notification structure.
Return Values

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.


CTransformOutputPin::QueryId

CTransformOutputPin Class

Retrieves an identifier for the pin.

HRESULT QueryId(
  LPWSTR * Id
  );

Parameters
Id
Pin identifier.
Return Values

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.


CTransformOutputPin::SetMediaType

CTransformOutputPin Class

Sets the media type for the connection to use.

HRESULT SetMediaType(
  const CMediaType* mt
  );

Parameters
mt
Pointer to an output media type to be used.
Return Values

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.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page