Microsoft DirectX 8.0 |
Input pin used by the CTransformFilter class.
Declaration: Transfrm.h
Typically, you do not need to derive from this class. Most of the methods in this class call corresponding methods on the CTransformFilter class, which you can override. If you derive from this class, you must override the filter's CTransformFilter::GetPin method to create instances of your derived class.
Protected Member Variables | |
---|---|
m_pTransformFilter | Pointer to the owning filter. |
Public Methods | |
CTransformInputPin | Constructor method. |
CheckConnect | Determines whether a pin connection is suitable. |
BreakConnect | Releases the pin from a connection. |
CompleteConnect | Completes a connection to another pin. |
CheckMediaType | Determines if the pin accepts a specific media type. |
SetMediaType | Sets the media type for the connection. |
CheckStreaming | Determines whether the pin can accept samples. Virtual. |
CurrentMediaType | Retrieves the media type for the current pin connection. |
IPin Methods | |
QueryId | Retrieves an identifier for the pin. |
EndOfStream | Notifies the pin that no additional data is expected. |
BeginFlush | Begins a flush operation. |
EndFlush | Ends a flush operation. |
NewSegment | Notifies the pin that media samples received after this call are grouped as a segment. |
IMemInputPin Methods | |
Receive | Receives the next media sample in the stream. |
Pointer to the owning filter.
Syntax
CTransformFilter *m_pTransformFilter;
Begins a flush operation. Implements the IPin::BeginFlush method.
Syntax
HRESULT BeginFlush(void);
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. VFW_E_NOT_CONNECTED Output pin is not connected.
Remarks
This method calls the pin's CBaseInputPin::BeginFlush method. Then it calls the filter's CTransformFilter::BeginFlush method to deliver the call downstream.
Releases the pin from a connection.
Syntax
HRESULT BreakConnect(void);
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method overrides the CBaseInputPin::BreakConnect method. It calls the filter's CTransformFilter::BreakConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::BreakConnect method.
Determines whether a pin connection is suitable.
Syntax
HRESULT CheckConnect( IPin *pPin );
Parameters
- pPin
- Pointer to the output pin's IPin interface.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success VFW_E_INVALID_DIRECTION Wrong pin direction
Remarks
This method overrides the CBasePin::CheckConnect method. It calls the filter's CTransformFilter::CheckConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::CheckConnect method to perform additional checks.
Determines if the pin accepts a specific media type.
Syntax
HRESULT CheckMediaType( const CMediaType *mtIn );
Parameters
- mtIn
- Pointer to a CMediaType object that contains the proposed media type.
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method implements the pure virtual CBasePin::CheckMediaType method. It calls the filter's CTransformFilter::CheckInputType method, which is also pure virtual. The filter's derived class must implement CheckInputType to determine whether a given input type is acceptable.
If the filter's output pin is connected, this method also calls the filter's CTransformFilter::CheckTransform method to determine whether the input type is compatible with the output type. The CheckTransform method is pure virtual as well.
Determines whether the pin can accept samples.
Syntax
HRESULT CheckStreaming(void);
Return Value
Returns one of the HRESULT values listed in the following table.
S_OK Success. S_FALSE Pin is currently flushing. VFW_E_NOT_CONNECTED The output pin is not connected. VFW_E_RUNTIME_ERROR A run-time error occurred. VFW_E_WRONG_STATE The pin is stopped.
Remarks
This method overrides the CBaseInputPin::CheckStreaming method.
Completes a connection to another pin.
Syntax
HRESULT CompleteConnect( IPin *pReceivePin );
Parameters
- pReceivePin
- Pointer to the other pin's IPin interface.
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method overrides the CBasePin::CompleteConnect method. It calls the filter's CTransformFilter::CompleteConnect method, which returns S_OK in the base class. The derived class can override the CTransformFilter::CompleteConnect method to perform additional checks.
Constructor method.
Syntax
CTransformInputPin( TCHAR *pObjectName, CTransformFilter *pTransformFilter, HRESULT *phr, LPCWSTR pName );
Parameters
- pObjectName
- String containing the debug name of the object. For more information, see CBaseObject.
- pTransformFilter
- 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, the string is not used for the pin identifier. The pin identifier for this class is always In. For more information, see QueryId.
Retrieves the media type for the current pin connection.
Syntax
CMediaType& CurrentMediaType(void);
Return Value
Returns a reference to the CBasePin::m_mt member variable.
Ends a flush operation. Implements the IPin::EndFlush method.
Syntax
HRESULT EndFlush(void);
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. VFW_E_NOT_CONNECTED Output pin is not connected.
Remarks
This method calls the filter's CTransformFilter::EndFlush method to deliver the call downstream. Then it calls the pin's CBaseInputPin::EndFlush method.
Notifies the pin that no additional data is expected. Implements the IPin::EndOfStream method.
Syntax
HRESULT EndOfStream(void);
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_OK Success. S_FALSE Pin is currently flushing. VFW_E_NOT_CONNECTED The output pin is not connected. VFW_E_RUNTIME_ERROR A run-time error occurred. VFW_E_WRONG_STATE The pin is stopped.
Remarks
This method calls the filter's CTransformFilter::EndOfStream method to deliver the end-of-stream notification downstream.
Notifies the pin that media samples received after this call are grouped as a segment. Implements the IPin::NewSegment method.
Syntax
HRESULT NewSegment( REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate );
Parameters
- tStart
- Start time of the segment.
- tStop
- Stop time of the segment.
- dRate
- Rate of the segment.
Return Value
Returns S_OK or another HRESULT value.
Remarks
This method overrides the CBasePin::NewSegment method. It calls the filter's CTransformFilter::NewSegment method to deliver the call downstream.
Retrieves an identifier for the pin. Implements the IPin::QueryId method.
Syntax
HRESULT QueryId( LPWSTR *Id );
Parameters
- Id
- Address of a variable that receives a string containing the pin identifier.
Return Value
Returns one of the HRESULT values shown in the following table.
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
The pin identifier is used for graph persistence. The pin identifier for this class is In. This class overrides the behavior of the CBasePin class. In the CBasePin class, the pin identifier is the same as the pin name, specified in the class constructor. In the CTransformInputPin class, the pin identifier and the pin name are not the same.
Receives the next media sample in the stream. Implements the IMemInputPin::Receive method.
Syntax
HRESULT Receive( IMediaSample *pSample );
Parameters
- pSample
- Pointer to the sample's IMediaSample interface.
Return Value
Returns an HRESULT value. Possible values include those shown in the following table.
S_FALSE Pin is currently flushing; sample was rejected. S_OK Success.
Remarks
This method calls the pin's CBaseInputPin::Receive method, which checks the pin's streaming state and checks for format changes in the media type. Then it calls the filter's CTransformFilter::Receive method, which processes the sample and delivers it downstream.
If the filter needs to access the sample after this method returns, it should hold a reference count by calling the IUnknown::AddRef method on the sample. For example, some decoder filters need the current sample in order to decode the next sample.
Sets the media type for the connection.
Syntax
HRESULT SetMediaType( const CMediaType *mt );
Parameters
- mt
- Pointer to a CMediaType object that specifies the media type.
Return Value
Returns S_OK.
Remarks
This method overrides the CBasePin::SetMediaType method. It calls the filter's CTransformFilter::SetMediaType method to inform the filter.
The pin must verify that the media type is acceptable before calling this method.