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. |
Determines if the media type is acceptable.
HRESULT CheckMediaType(
const CMediaType* pmt
);
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.
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.
Returns a pointer to the input pin to which this output pin is connected.
IMemInputPin * ConnectedIMemInputPin( )
Returns the m_pInputPin data member inherited from CBaseOutputPin.
Constructs a CTransInPlaceOutputPin object.
CTransInPlaceOutputPin(
TCHAR *pObjectName,
CTransInPlaceFilter *pFilter,
HRESULT * phr,
LPCWSTR pName
);
No return value.
Negotiates the allocator to use (uses the allocator from the upstream output pin).
HRESULT DecideAllocator(
IMemInputPin * pPin,
IMemAllocator ** ppAlloc
);
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.
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.
Provides a media type enumerator from the upstream filter.
HRESULT EnumMediaTypes(
IEnumMediaTypes **ppEnum
);
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.
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.
Returns a pointer to the default allocator.
IMemAllocator * PeekAllocator( )
Returns the m_pAllocator data member inherited from CBaseOutputPin.
This member function does not increment the reference count.
Receives notification of which allocator will be used.
HRESULT ReceiveAllocator(
IMemAllocator * pAllocator,
BOOL bReadOnly
);
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.
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.