Microsoft DirectX 8.0

CTransInPlaceInputPin Class

CTransInPlaceInputPin class hierarchy

Input pin used by the CTransInPlaceFilter class.

Declaration: Transip.h

Typically, you do not need to derive from this class. If you do, you must override the filter's CTransInPlaceFilter::GetPin method to create instances of your derived class.

Protected Member Variables
m_bReadOnlyFlag that specifies whether the input stream is read-only.
m_pTIPFilterPointer to the filter that created this pin.
Public Methods
CTransInPlaceInputPinConstructor method.
CheckMediaTypeDetermines if the pin accepts a specific media type.
PeekAllocatorRetrieves a pointer to the pin's allocator.
ReadOnlyIndicates whether the input stream is read-only.
IPin Methods
EnumMediaTypesEnumerates the pin's preferred media types.
IMemInputPin Methods
GetAllocatorRetrieves the memory allocator proposed by this pin.
NotifyAllocatorSpecifies an allocator for the connection.
GetAllocatorRequirementsRetrieves the allocator properties requested by the pin.

CTransInPlaceInputPin.m_bReadOnly

CTransInPlaceInputPin Class

Flag that specifies whether the input stream is read-only. The upstream filter specifies this information when it calls the NotifyAllocator method. By default, the value is FALSE.

Syntax

BOOL m_bReadOnly;

CTransInPlaceInputPin.m_pTIPFilter

CTransInPlaceInputPin Class

Pointer to the filter that created this pin.

Syntax

CTransInPlaceFilter * const m_pTIPFilter;

CTransInPlaceInputPin::CheckMediaType

CTransInPlaceInputPin Class

Determines if the pin accepts a specific media type.

Syntax

HRESULT CheckMediaType(
    const CMediaType *pmt
);

Parameters

pmt
Pointer to a CMediaType object that contains the proposed media type.

Return Value

Returns S_OK if the proposed media type is acceptable. Otherwise, returns S_FALSE or an error code.

Remarks

This method overrides the CTransformInputPin::CheckMediaType method. It calls the filter's CTransformFilter::CheckInputType method to check the input type. If the output pin is connected, this method also calls the IPin::QueryAccept method on the downstream input pin.

CTransInPlaceInputPin::CTransInPlaceInputPin

CTransInPlaceInputPin Class

Constructor method.

Syntax

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

Parameters

pObjectName
String containing the debug name of the object. For more information, see CBaseObject.
pFilter
Pointer to the filter that created this pin, which must be a CTransformFilter object.
phr
Pointer to a variable that receives an HRESULT value indicating the success or failure of the method. Initialize the value to S_OK before creating the object. The value is changed only if an error occurs.
pName
Unicode™ string containing the pin name.

Remarks

The pName parameter specifies the pin name, which is returned by the IPin::QueryPinInfo method. However, this string is not used for the pin identifier. The pin identifier for this class is always In. For more information, see QueryId.

CTransInPlaceInputPin::EnumMediaTypes

CTransInPlaceInputPin Class

Enumerates the pin's preferred media types. Implements the IPin::EnumMediaTypes method.

Syntax

HRESULT EnumMediaTypes(
    IEnumMediaTypes **ppEnum
);

Parameters

ppEnum
Address of a variable that receives a pointer to the IEnumMediaTypes interface.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

S_OKSuccess.
E_OUTOFMEMORYInsufficient memory.
E_POINTERNULL pointer.
VFW_E_NOT_CONNECTEDThe output pin is not connected.

Remarks

This method returns the IEnumMediaTypes interface from downstream input pin.

CTransInPlaceInputPin::GetAllocator

CTransInPlaceInputPin Class

Retrieves the memory allocator proposed by this pin. Implements the IMemInputPin::GetAllocator method.

Syntax

HRESULT GetAllocator(
    IMemAllocator **ppAllocator
);

Parameters

ppAllocator
Address of a variable that receives a pointer to the allocator's IMemAllocator interface.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

S_OKSuccess.
VFW_E_NO_ALLOCATORNo allocator is available.

Remarks

If the filter's output pin is connected, this method requests an allocator from the downstream filter's input pin.

If the filter's output pin is not connected, this method creates a temporary allocator. Later, when the output pin is connected, the filter will reconnect the input pin and renegotiate the allocator.

CTransInPlaceInputPin::GetAllocatorRequirements

CTransInPlaceInputPin Class

Retrieves the allocator properties requested by the pin. Implements the IMemInputPin::GetAllocatorRequirements method.

Syntax

HRESULT GetAllocatorRequirements(
    ALLOCATOR_PROPERTIES *pProps
);

Parameters

pProps
Pointer to an ALLOCATOR_PROPERTIES structure, which is filled in with the requirements.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

S_OKSuccess.
E_NOTIMPL The output pin is not connected, or the downstream input pin does not support the method.
E_POINTER Null pointer argument.

Remarks

If the output pin is connected, this method passes the call to the downstream input pin. Otherwise, it returns E_NOTIMPL.

CTransInPlaceInputPin::NotifyAllocator

CTransInPlaceInputPin Class

Specifies an allocator for the connection. Implements the IMemInputPin::NotifyAllocator method.

Syntax

HRESULT NotifyAllocator(
    IMemAllocator *pAllocator,
    BOOL bReadOnly
);

Parameters

pAllocator
Pointer to the allocator's IMemAllocator interface.
bReadOnly
Flag that specifies whether samples from this allocator are read-only. If TRUE, samples are read-only.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

S_OKSuccess
E_FAILFailure
E_POINTERNULL pointer argument

Remarks

The filter attempts to use the same allocator for both pin connections.

The previous case has the following exception:

CTransInPlaceInputPin::PeekAllocator

CTransInPlaceInputPin Class

Retrieves a pointer to the pin's allocator. The method does not increment the reference count on the interface.

Syntax

IMemAllocator *PeekAllocator(void)

Return Value

Returns the CBaseInputPin.m_pAllocator member variable.

CTransInPlaceInputPin::ReadOnly

CTransInPlaceInputPin Class

Indicates whether the input stream is read-only.

Syntax

const BOOL ReadOnly(void);

Return Value

Returns the value of the m_bReadOnly member variable.