CTransInPlaceInputPin Class


CTransInPlaceInputPin class hierarchy

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.


CTransInPlaceInputPin::CheckMediaType

CTransInPlaceInputPin Class

Determines if the media type is acceptable.

HRESULT CheckMediaType(
  const CMediaType* pmt
  );

Parameters
pmt
Media type being checked.
Return Values

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.

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.


CTransInPlaceInputPin::CTransInPlaceInputPin

CTransInPlaceInputPin Class

Constructs a CTransInPlaceInputPin object.

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

Parameters
pObjectName
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
Name of the pin.
Return Values

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.


CTransInPlaceInputPin::EnumMediaTypes

CTransInPlaceInputPin Class

Provides an enumerator for media types by retrieving one from downstream.

HRESULT EnumMediaTypes(
  IEnumMediaTypes **ppEnum
  );

Parameters
ppEnum
[out] 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. 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).


CTransInPlaceInputPin::GetAllocator

CTransInPlaceInputPin Class

Retrieves the upstream allocator.

HRESULT GetAllocator(
  IMemAllocator ** ppAllocator
  );

Parameters
ppAllocator
Returned allocator.
Return Values

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.


CTransInPlaceInputPin::GetAllocatorRequirements

CTransInPlaceInputPin Class

Passes requests for allocator requirements downstream.

HRESULT GetAllocatorRequirements(
  ALLOCATOR_PROPERTIES * pProps
  );

Parameters
pProps
ALLOCATOR_PROPERTIES structure containing the required size, count, and alignment of the allocator.
Return Values

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 NOERRORSuccess.

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.


CTransInPlaceInputPin::NotifyAllocator

CTransInPlaceInputPin Class

Receives notification of which allocator will be used by the connected output pin.

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 if the samples from this allocator are read-only.
Return Values

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.


CTransInPlaceInputPin::PeekAllocator

CTransInPlaceInputPin Class

Returns a pointer to the default allocator.

IMemAllocator * PeekAllocator( )

Return Values

Returns the m_pAllocator data member inherited from CBaseInputPin.

Remarks

This method does not increment the reference count.


CTransInPlaceInputPin::ReadOnly

CTransInPlaceInputPin Class

Returns m_bReadOnly to indicate whether or not a stream is read-only.

const BOOL ReadOnly( )

Return Values

Returns TRUE if the stream is read-only. Returns FALSE otherwise.

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