Microsoft DirectX 8.0

CTransformInputPin Class

CTransformInputPin class hierarchy

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_pTransformFilterPointer to the owning filter.
Public Methods
CTransformInputPinConstructor method.
CheckConnectDetermines whether a pin connection is suitable.
BreakConnectReleases the pin from a connection.
CompleteConnectCompletes a connection to another pin.
CheckMediaTypeDetermines if the pin accepts a specific media type.
SetMediaTypeSets the media type for the connection.
CheckStreamingDetermines whether the pin can accept samples. Virtual.
CurrentMediaTypeRetrieves the media type for the current pin connection.
IPin Methods
QueryId Retrieves an identifier for the pin.
EndOfStreamNotifies the pin that no additional data is expected.
BeginFlushBegins a flush operation.
EndFlushEnds a flush operation.
NewSegmentNotifies the pin that media samples received after this call are grouped as a segment.
IMemInputPin Methods
ReceiveReceives the next media sample in the stream.

CTransformInputPin.m_pTransformFilter

CTransformInputPin Class

Pointer to the owning filter.

Syntax

CTransformFilter *m_pTransformFilter;

CTransformInputPin::BeginFlush

CTransformInputPin Class

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_OKSuccess.
VFW_E_NOT_CONNECTEDOutput 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.

CTransformInputPin::BreakConnect

CTransformInputPin Class

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.

CTransformInputPin::CheckConnect

CTransformInputPin Class

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_OKSuccess
VFW_E_INVALID_DIRECTIONWrong 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.

CTransformInputPin::CheckMediaType

CTransformInputPin Class

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.

CTransformInputPin::CheckStreaming

CTransformInputPin Class

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_OKSuccess.
S_FALSEPin is currently flushing.
VFW_E_NOT_CONNECTEDThe output pin is not connected.
VFW_E_RUNTIME_ERRORA run-time error occurred.
VFW_E_WRONG_STATEThe pin is stopped.

Remarks

This method overrides the CBaseInputPin::CheckStreaming method.

CTransformInputPin::CompleteConnect

CTransformInputPin Class

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.

CTransformInputPin::CTransformInputPin

CTransformInputPin Class

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.

CTransformInputPin::CurrentMediaType

CTransformInputPin Class

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.

CTransformInputPin::EndFlush

CTransformInputPin Class

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_OKSuccess.
VFW_E_NOT_CONNECTEDOutput 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.

CTransformInputPin::EndOfStream

CTransformInputPin Class

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_OKSuccess.
S_FALSEPin is currently flushing.
VFW_E_NOT_CONNECTEDThe output pin is not connected.
VFW_E_RUNTIME_ERRORA run-time error occurred.
VFW_E_WRONG_STATEThe pin is stopped.

Remarks

This method calls the filter's CTransformFilter::EndOfStream method to deliver the end-of-stream notification downstream.

CTransformInputPin::NewSegment

CTransformInputPin Class

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.

CTransformInputPin::QueryId

CTransformInputPin Class

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_OKSuccess
E_OUTOFMEMORYInsufficient memory
E_POINTERNULL 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.

CTransformInputPin::Receive

CTransformInputPin Class

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_FALSEPin is currently flushing; sample was rejected.
S_OKSuccess.

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.

CTransformInputPin::SetMediaType

CTransformInputPin Class

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.