The CTransInPlaceOutputPin class implements the output pin of a simple transform-inplace filter (CTransInPlaceFilter).
Protected Data Members
m_pTIPFilter Pointer to the CTransInPlaceFilter object that owns this pin.
Member Functions
ConnectedIMemInputPin Retrieves a pointer to the input pin to which this output pin is connected. CTransInPlaceOutputPin Construct a CTransInPlaceOutputPin object. PeekAllocator Retrieves a pointer to the default allocator. ReceiveAllocator Receives notification of which allocator will be used.
Overridable Member Functions
CheckMediaType Determines if the media type is acceptable. DecideAllocator Negotiates the allocator to use (uses the allocator from the upstream output pin).
EnumMediaTypes Provides a media type enumerator from the upstream filter.
Determines if the media type is acceptable.
Syntax
HRESULT CheckMediaType( const CMediaType *pmt );
Parameters
- pmt
- Pointer to a media type object containing the proposed media type.
Return Value
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.
Retrieves a pointer to the input pin to which this output pin is connected.
Syntax
IMemInputPin * ConnectedIMemInputPin(void)
Return Value
Returns the m_pInputPin data member inherited from CBaseOutputPin.
Constructs a CTransInPlaceOutputPin object.
Syntax
CTransInPlaceOutputPin( TCHAR *pObjectName, CTransInPlaceFilter *pFilter, HRESULT *phr, LPCWSTR pName );
Parameters
- pObjectName
- Pointer to the 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
- Pointer to the name of the pin.
Return Value
No return value.
Negotiates the allocator to use (uses the allocator from the upstream output pin).
Syntax
HRESULT DecideAllocator( IMemInputPin *pPin, IMemAllocator **ppAlloc );
Parameters
- pPin
- Pointer to the IMemInputPin interface of the downstream input pin.
- ppAlloc
- Address of a pointer to the returned allocator pointer.
Return Value
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.
Provides a media type enumerator from the upstream filter.
Syntax
HRESULT EnumMediaTypes( IEnumMediaTypes **ppEnum );
Parameters
- ppEnum
- Address of a pointer to an enumerator for the media types.
Return Value
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.
Retrieves a pointer to the default allocator.
Syntax
IMemAllocator * PeekAllocator(void)
Return Value
Returns the m_pAllocator data member inherited from CBaseOutputPin.
Remarks
This member function does not increment the reference count.
Receives notification of which allocator will be used.
Syntax
HRESULT ReceiveAllocator( IMemAllocator *pAllocator, BOOL bReadOnly );
Parameters
- pAllocator
- Pointer to the IMemAllocator object to use.
- bReadOnly
- Flag to indicate whether the samples from this allocator are read-only; TRUE means they are read-only.
Return Value
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.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.