The CTransInPlaceInputPin class implements the input pin of a transform-inplace filter (CTransInPlaceFilter). This is part of a transform filter that transforms data in place rather than making a copy of it. The CTransInPlaceFilter::InputPin member function returns a pointer to CTransInPlaceInputPin object.
Typically, you can create objects of a class derived from CTransInPlaceInputPin without modifying this class. That is, you can usually override member functions in the CTransInPlaceFilter class that member functions of the CTransInPlaceInputPin class call, and not have to derive your own classes for either of the pin classes.
However, if you want to override this class and derive your filter class from CTransInPlaceFilter, you must override the CTransInPlaceFilter::GetPin member function to create pins of your derived class.
Protected Data Members
m_bReadOnly Flag to indicate if the stream is read-only. m_pTIPFilter Pointer to the CTransInPlaceFilter object that owns this pin.
Member Functions
CTransInPlaceInputPin Constructs a CTransInPlaceInputPin object. PeekAllocator Retrieves a pointer to the default allocator. ReadOnly Retrieves m_bReadOnly to indicate whether a stream is read-only.
Overridable Member Functions
CheckMediaType Determines if the pin can use a specified media type.
EnumMediaTypes Provides a media type enumerator from the downstream filter.
Implemented IMemInputPin Methods
GetAllocator Retrieves the upstream allocator. GetAllocatorRequirements Passes requests for allocator requirements downstream. NotifyAllocator Receives notification of which allocator the connected output pin will use.
Determines if the media type is acceptable.
Syntax
HRESULT CheckMediaType( const CMediaType *pmt );
Parameters
- pmt
- Pointer to the media type being checked.
Return Value
Returns an HRESULT value that depends on the implementation of the owning filter's CTransformFilter::CheckInputType member function. HRESULT can be one of the following standard constants, or other values not listed.
E_FAIL Failure. E_POINTER Null pointer argument. E_INVALIDARG Invalid argument. E_NOTIMPL Method isn't supported. S_OK or NOERROR Success.
Remarks
This member function overrides the CTransformInputPin::CheckMediaType member function. It first calls the owning filter's CheckInputType member function. (This is a purely virtual function which must be overridden when deriving a class from the CTransformFilter class. The overridden CheckInputType member function determines which media types the input pin supports.) Then, if the filter's output pin is not connected, this member function agrees to any media type. If the output pin is connected, it asks the downstream connected input pin if it accepts this type and returns the result.
The CheckInputType member function must be overridden by the class of the owning filter.
Constructs a CTransInPlaceInputPin object.
Syntax
CTransInPlaceInputPin( TCHAR *pObjectName, CTransInPlaceFilter *pFilter, HRESULT *phr, LPCWSTR pName );
Parameters
- pObjectName
- Pointer to the name of the CTransInPlaceInputPin class object.
- pFilter
- Pointer to the CTransInPlaceFilter 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 terminated; but in any case the destructor will be called by the creator when the HRESULT error is detected.
- pName
- Pointer to the name of the pin.
Return Value
No return value.
Remarks
This member function doesn't create the pins. The pins are created when they are first required. All external attempts to access pins (by enumeration or by CBaseFilter::FindPin) go through CTransInPlaceFilter::GetPin, which creates the pins initially.
Provides an enumerator for media types by retrieving one from downstream.
Syntax
HRESULT EnumMediaTypes( IEnumMediaTypes **ppEnum );
Parameters
- ppEnum
- [out] 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. When asked by a connected output pin of the upstream filter for this pin's media type enumerator, this member function simply retrieves the allocator from the input pin connected to its output pin (if it is connected).
Retrieves the upstream allocator.
Syntax
HRESULT GetAllocator( IMemAllocator **ppAllocator );
Parameters
- ppAllocator
- Address of a pointer to the returned allocator.
Return Value
Returns a NOERROR if the method retrieves an allocator being used by the downstream filter. If no such allocator exists, returns S_OK if the method retrieves an allocator being used by the output pin of the in-place transform filter. If neither of these types of allocators can be retrieved, returns VFW_E_NO_ALLOCATOR.
Remarks
This member function overrides the CBaseInputPin::GetAllocator member function and implements the IMemInputPin::GetAllocator method. If an allocator has already been agreed upon, this member function supplies that allocator. Otherwise, if the downstream input pin can supply an allocator, it does so. If no allocator is available, this member function returns VFW_E_NO_ALLOCATOR.
Passes requests for allocator requirements downstream.
Syntax
HRESULT GetAllocatorRequirements( ALLOCATOR_PROPERTIES *pProps );
Parameters
- pProps
- Pointer to the ALLOCATOR_PROPERTIES structure containing the required size, count, and alignment of the allocator.
Return Value
Returns E_NOTIMPL if the filter's output pin is not connected. Otherwise, returns an HRESULT that indicates whether the allocator properties were successfully received. HRESULT can be one of the following standard constants, or other values not listed.
E_FAIL Failure. E_POINTER Null pointer argument. E_INVALIDARG Invalid argument. E_NOTIMPL Method isn't supported. S_OK or NOERROR Success.
Remarks
This member function overrides the CBaseInputPin::GetAllocatorRequirements member function and implements the IMemInputPin::GetAllocatorRequirements method. If the downstream input pin can supply allocator requirements, it does so.
Receives notification of which allocator will be used by the connected output pin.
Syntax
HRESULT NotifyAllocator( IMemAllocator *pAllocator, BOOL bReadOnly );
Parameters
- pAllocator
- Pointer to the IMemAllocator object to use. This might or might not be the same CTransInPlaceInputPin object that the input pin provided in the CTransInPlaceInputPin::GetAllocator member function (the output pin could provide its own allocator).
- bReadOnly
- Flag to indicate whether the samples from this allocator are read-only. TRUE means they are.
Return Value
Returns NOERROR if successful. Returns E_POINTER if the pointer is invalid. Otherwise, returns an error due to calling CTransInPlaceOutputPin::ReceiveAllocator.
Remarks
This member function overrides the CBaseInputPin::NotifyAllocator member function and implements the IMemInputPin::NotifyAllocator method. This member function remembers the allocator and passes it to the output pin because they both must share the same allocator.
Retrieves a pointer to the default allocator.
Syntax
IMemAllocator * PeekAllocator(void)
Return Value
Returns the m_pAllocator data member inherited from CBaseInputPin.
Remarks
This function does not increment the reference count.
Retrieves m_bReadOnly to indicate whether a stream is read-only.
Syntax
const BOOL ReadOnly(void)
Return Value
Returns TRUE if the stream is read-only; returns FALSE otherwise.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.