Microsoft DirectX 8.0 |
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_bReadOnly | Flag that specifies whether the input stream is read-only. |
m_pTIPFilter | Pointer to the filter that created this pin. |
Public Methods | |
CTransInPlaceInputPin | Constructor method. |
CheckMediaType | Determines if the pin accepts a specific media type. |
PeekAllocator | Retrieves a pointer to the pin's allocator. |
ReadOnly | Indicates whether the input stream is read-only. |
IPin Methods | |
EnumMediaTypes | Enumerates the pin's preferred media types. |
IMemInputPin Methods | |
GetAllocator | Retrieves the memory allocator proposed by this pin. |
NotifyAllocator | Specifies an allocator for the connection. |
GetAllocatorRequirements | Retrieves the allocator properties requested by the pin. |
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;
Pointer to the filter that created this pin.
Syntax
CTransInPlaceFilter * const m_pTIPFilter;
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.
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.
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_OK Success. E_OUTOFMEMORY Insufficient memory. E_POINTER NULL pointer. VFW_E_NOT_CONNECTED The output pin is not connected.
Remarks
This method returns the IEnumMediaTypes interface from downstream input pin.
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_OK Success. VFW_E_NO_ALLOCATOR No 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.
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_OK Success. 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.
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_OK Success E_FAIL Failure E_POINTER NULL pointer argument
Remarks
The filter attempts to use the same allocator for both pin connections.
- If the output pin is not connected, the input pin automatically accepts the allocator. When the output pin is connected, the filter will reconnect the input pin. At that point, the filter will try again to use a single allocator.
- If the output pin is connected, the input pin accepts the allocator. The output pin also uses the same allocator. It calls NotifyAllocator on the downstream input pin.
The previous case has the following exception:
- If the proposed allocator is read-only (that is, the bReadOnly parameter is TRUE) and the filter needs to modify the samples, then the filter must use two different allocators. In this case, if the upstream filter is proposing to use the downstream filter's allocator, the method returns E_FAIL.
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.
Indicates whether the input stream is read-only.
Syntax
const BOOL ReadOnly(void);
Return Value
Returns the value of the m_bReadOnly member variable.