## CTransInPlaceOutputPin Class

The CTransInPlaceOutputPin class implements the output pin of a simple transform-inplace filter (CTransInPlaceFilter).

Protected Data Members

Name | Description
m_pTIPFilter | Pointer to the CTransInPlaceFilter object that owns this pin.

Member Functions

Name | Description
ConnectedIMemInputPin | Returns a pointer to the input pin to which this output pin is connected.
CTransInPlaceOutputPin | Construct a CTransInPlaceOutputPin object.
PeekAllocator | Returns a pointer to the default allocator.
ReceiveAllocator | Receives notification of which allocator will be used.

Overridable Member Functions

Name | Description
CheckMediaType | Determines if the media type is acceptable.
DecideAllocator | Negotiates the allocator to use (uses the allocator from the upstream output pin).

Implemented IPin Methods

Name | Description
EnumMediaTypes | Provides a media type enumerator from the upstream filter.

###

CTransInPlaceOutputPin::CheckMediaType

CTransInPlaceOutputPin Class

Determines if the media type is acceptable.

HRESULT CheckMediaType(
const CMediaType* pmt
);

##### Parameters

pmt
  Pointer to a media type object containing the proposed media type.

##### Return Values

Returns S_OK if the pin is not connected. Otherwise, returns S_TRUE if the media type is accepted or S_FALSE if it is not.

##### Remarks

This member function overrides the CTransformOutputPin::CheckMediaType member function. It calls the pure virtual CTransformFilter::CheckInputType member function to verify the media type (which you must implement in your derived class) because it does not change the media type from input to output. If it is not connected, it returns S_OK, which agrees to any media type; otherwise, it calls QueryAccept on the output pin of the upstream filter and returns the result.

###

CTransInPlaceOutputPin::ConnectedIMemInputPin

CTransInPlaceOutputPin Class

Returns a pointer to the input pin to which this output pin is connected.

IMemInputPin * ConnectedIMemInputPin( )

##### Return Values

Returns the m_pInputPin data member inherited from CBaseOutputPin.

###

CTransInPlaceOutputPin::CTransInPlaceOutputPin

CTransInPlaceOutputPin Class

Constructs a CTransInPlaceOutputPin object.

CTransInPlaceOutputPin(
TCHAR *pObjectName,
CTransInPlaceFilter *pFilter,
HRESULT * phr,
LPCWSTR pName
);

##### Parameters

pObjectName
  Name of the CTransInPlaceOutputPin object.
pFilter
  Pointer to the owning CTransInPlaceFilter filter.
phr
  Pointer to an HRESULT value in which to return resulting information.
pName
  Name of the pin.

##### Return Values

No return value.

###

CTransInPlaceOutputPin::DecideAllocator

CTransInPlaceOutputPin Class

Negotiates the allocator to use (uses the allocator from the upstream output pin).

HRESULT DecideAllocator(
IMemInputPin * pPin,
IMemAllocator ** ppAlloc
);

##### Parameters

pPin
  Pointer to the IMemInputPin interface of the downstream input pin.
ppAlloc
  Returned allocator pointer.

##### Return Values

Returns NOERROR if successful. Otherwise, returns VFW_E_NO_ALLOCATOR if there is no allocator, or an error from calling GetAllocator, InitAllocator, GetAllocatorRequirements, DecideBufferSize, or NotifyAllocator.

##### Remarks

This member function overrides the CBaseOutputPin::DecideAllocator member function. This implementation uses the allocator that is negotiated by its input pin because a transform-inplace filter does not supply its own allocator. It then calls IMemInputPin::NotifyAllocator on the downstream input pin with that allocator.

If you want to use your own allocator, it is better to derive from CTransformFilter than from CTransInPlaceFilter, because the purpose of a transform-inplace filter is to use an existing allocator.

###

CTransInPlaceOutputPin::EnumMediaTypes

CTransInPlaceOutputPin Class

Provides a media type enumerator from the upstream filter.

HRESULT EnumMediaTypes(
IEnumMediaTypes **ppEnum
);

##### Parameters

ppEnum
  Pointer to an enumerator for the media types.

##### Return Values

Returns NOERROR if successful, VFW_E_NOT_CONNECTED if there is no connection, or an HRESULT that indicates an error with the enumerator, such as E_POINTER or E_OUTOFMEMORY.

##### Remarks

This member function overrides the CBasePin::EnumMediaTypes member function and implements the IPin::EnumMediaTypes method. Transform-inplace filters use the media type enumerator from adjacent filters because they do not change the media type. This member function calls IPin::EnumMediaTypes on the output pin connected to the filter's input pin. If an application receives an enumerator, the application must release it when finished.

###

CTransInPlaceOutputPin::PeekAllocator

CTransInPlaceOutputPin Class

Returns a pointer to the default allocator.

IMemAllocator * PeekAllocator( )

##### Return Values

Returns the m_pAllocator data member inherited from CBaseOutputPin.

##### Remarks

This member function does not increment the reference count.

###

CTransInPlaceOutputPin::ReceiveAllocator

CTransInPlaceOutputPin Class

Receives notification of which allocator will be used.

HRESULT ReceiveAllocator(
IMemAllocator * pAllocator,
BOOL bReadOnly
);

##### Parameters

pAllocator
  Pointer to the IMemAllocator object to use.
bReadOnly
  Flag to indicate if the samples from this allocator are read-only.

##### Return Values

Returns NOERROR if the allocator has the correct properties and is not read-only. Returns S_OK if successful if the allocator has the correct properties but is read-only; otherwise, returns VFW_E_BADALIGN, VFW_E_ALREADY_COMMITTED, VFW_E_BUFFERS_OUTSTANDING, or E_FAIL if the allocator's properties don't match what is needed.

##### Remarks

This member function is called by the CTransInPlaceInputPin::NotifyAllocator member function to indicate to the output pin which allocator will be used. It is only called if the output pin is connected. The choice is propagated to input pins downstream if the allocator is not read-only. For read-only allocators, only the properties are passed downstream.

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