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
Name | Description |
m_pTIPFilter | Pointer to the CTransInPlaceFilter object that owns this pin. |
m_bReadOnly | Flag to indicate if the stream is read-only. |
Member Functions
Name | Description |
CTransInPlaceInputPin | Constructs a CTransInPlaceInputPin object. |
PeekAllocator | Returns a pointer to the default allocator. |
ReadOnly | Returns m_bReadOnly to indicate whether or not a stream is read-only. |
Overridable Member Functions
Name | Description |
CheckMediaType | Determines if the pin can use a specified media type. |
Implemented IPin Methods
Name | Description |
EnumMediaTypes | Provides a media type enumerator from the downstream filter. |
Implemented IMemInputPin Methods
Name | Description |
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.
HRESULT CheckMediaType(
const CMediaType* pmt
);
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:
Value | Meaning |
E_FAIL | Failure. |
E_POINTER | Null pointer argument. |
E_INVALIDARG | Invalid argument. |
E_NOTIMPL | Method isn't supported. |
S_OK or NOERROR | Success. |
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.
CTransInPlaceInputPin(
TCHAR *pObjectName,
CTransInPlaceFilter *pFilter,
HRESULT * phr,
LPCWSTR pName
);
No return value.
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.
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. 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.
HRESULT GetAllocator(
IMemAllocator ** ppAllocator
);
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.
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.
HRESULT GetAllocatorRequirements(
ALLOCATOR_PROPERTIES * pProps
);
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:
Value | Meaning |
E_FAIL | Failure. |
E_POINTER | Null pointer argument. |
E_INVALIDARG | Invalid argument. |
E_NOTIMPL | Method isn't supported. |
S_OK or NOERROR | Success. |
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.
HRESULT NotifyAllocator(
IMemAllocator * pAllocator,
BOOL bReadOnly
);
Returns NOERROR if successful. Returns E_POINTER if the pointer is invalid. Otherwise, returns an error due to calling CTransInPlaceOutputPin::ReceiveAllocator.
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.
Returns a pointer to the default allocator.
IMemAllocator * PeekAllocator( )
Returns the m_pAllocator data member inherited from CBaseInputPin.
This method does not increment the reference count.
Returns m_bReadOnly to indicate whether or not a stream is read-only.
const BOOL ReadOnly( )
Returns TRUE if the stream is read-only. Returns FALSE otherwise.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.