Index Topic Contents | |||
Previous Topic: CTransformFilter Class Next Topic: CTransformOutputPin Class |
CTransformInputPin Class
The CTransformInputPin class implements the input pin of a simple transform filter. It is the class assigned to the m_pInput data member of the CTransformFilter class. Typically, you can create objects derived from CTransformFilter without modifying the CTransformInputPin class. That is, you can usually override the member functions in CTransformFilter that are called by member functions of this class. This means that you need not derive your own classes for either of the pin classes.
However, if you want to override this class and have your filter class derived from CTransformFilter, you must override the CTransformFilter::GetPin member function to create pins of your derived class.
Protected Data Members
Name Description m_pTransformFilter Pointer to the owning CTransformFilter object. Member Functions
Name Description CTransformInputPin Constructs a CTransformInputPin object. CurrentMediaType Retrieves the media type currently assigned to the filter. Overridable Member Functions
Name Description BreakConnect Informs the derived class when the connection is broken. CheckConnect Informs the derived class when the connection process is starting. CheckMediaType Determines if the pin can use a specified media type. CheckStreaming Verifies conditions for continuing with a streaming operation. CompleteConnect Informs the derived class when the connection process has completed. SetMediaType Informs the derived class when the media type is established for the connection. Implemented IPin Methods
Name Description BeginFlush Informs the pin to begin a flush operation. EndFlush Informs the pin to end a flush operation and notifies the pin that it can start accepting data again. EndOfStream Informs the input pin that no additional data is expected until a new run command is issued. NewSegment Specifies that samples following this call are grouped as a segment with a given start time, stop time, and rate. QueryId Retrieves an identifier for the pin. Implemented IMemInputPin Methods
Name Description Receive Receives the next block of data from the stream. CTransformInputPin Class
CTransformInputPin::BeginFlushInforms the pin to begin a flush operation.
HRESULT BeginFlush(void);
Return Values
Returns an HRESULT value.
Remarks
This member function implements the IPin::BeginFlush method and overrides the CBaseInputPin::BeginFlush member function. It checks to see if the pin is connected, and then calls CBaseInputPin::BeginFlush, and finally calls the CTransformFilter::BeginFlush member function.
CTransformInputPin Class
CTransformInputPin::BreakConnectInforms the derived class when the connection is broken.
HRESULT BreakConnect( );
Return Values
Returns NOERROR in this implementation.
Remarks
This member function overrides the CBasePin::BreakConnect member function and calls the CTransformFilter::BreakConnect member function. Override CTransformFilter::BreakConnect to undo anything carried out in CTransformInputPin::CheckConnect (such as releasing extra interfaces).
CTransformInputPin Class
CTransformInputPin::CheckConnectInforms the derived class when the connection process is starting.
HRESULT CheckConnect(
IPin *pPin
);Parameters
- pPin
- Pointer to the IPin interface of the connecting pin.
Return Values
Returns NOERROR by default.
Remarks
This member function overrides the CBasePin::CheckConnect member function and calls the CTransformFilter::CheckConnect member function. Override CTransformFilter::CheckConnect to add additional interfaces.
CTransformInputPin Class
CTransformInputPin::CheckMediaTypeDetermines if the pin can use a specified media type.
HRESULT CheckMediaType(
const CMediaType* mtIn
);Parameters
- mtIn
- Pointer to a media type object.
Return Values
No return value.
Remarks
This member function calls the pure-virtual CTransformFilter::CheckInputType member function, which must be overridden when deriving a class from the CTransformFilter class. The overridden CheckInputType member function is responsible for determining which media types the input pin supports.
CTransformInputPin Class
CTransformInputPin::CheckStreamingVerifies conditions for continuing with a streaming operation.
HRESULT CheckStreaming( );
Return Values
Returns one of the following HRESULT values, depending on the state.
Value Meaning S_FALSE Currently in flushing state. S_OK Receive or EndOfStream operations can safely proceed. VFW_E_NOT_CONNECTED The output pin either does not exist or isn't connected. VFW_E_RUNTIME_ERROR A run-time error occurred when processing a previous sample. VFW_E_WRONG_STATE The filter is in the State_Stopped state. Remarks
This member function overrides the CBaseInputPin::CheckStreaming member function and calls that base class implementation for most of the condition checks. It determines if the pin is connected, if it is in a paused or running state, and if it is not currently flushing data or processing a run-time error.
CTransformInputPin Class
CTransformInputPin::CompleteConnectInforms the derived class when the connection process has been completed.
HRESULT CompleteConnect(
IPin *pReceivePin
);Parameters
- pReceivePin
- Pointer to the input pin being connected to.
Return Values
Returns an HRESULT value.
Remarks
This member function overrides the CBasePin::CompleteConnect member function. It calls the base class CBasePin::CompleteConnect member function and then calls CTransformFilter::CompleteConnect.
CTransformInputPin Class
CTransformInputPin::CTransformInputPinConstructs a CTransformInputPin object.
CTransformInputPin(
TCHAR *pObjectName,
CTransformFilter *pTransformFilter,
HRESULT * phr,
LPCWSTR pName
);Parameters
- pObjectName
- Name of the CTransformInputPin object.
- pTransformFilter
- Pointer to the CTransformFilter 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.
CTransformInputPin Class
CTransformInputPin::CurrentMediaTypeRetrieves the media type currently assigned to the filter.
CMediaType& CurrentMediaType( );
Return Values
Returns the value of CBasePin::m_mt.
CTransformInputPin Class
CTransformInputPin::EndFlushInforms the pin to end a flush operation and notifies the pin that it can start accepting data again.
HRESULT EndFlush(void);
Return Values
Returns an HRESULT value.
Remarks
This member function implements the IPin::EndFlush method and overrides the CBaseInputPin::EndFlush member function. It checks to see if the pin is connected, calls the CBaseInputPin::EndFlush member function, and finally calls the CTransformFilter::EndFlush member function.
CTransformInputPin Class
CTransformInputPin::EndOfStreamInforms the input pin that no additional data is expected until a new run command is issued.
HRESULT EndOfStream(void);
Return Values
Returns an HRESULT value.
Remarks
This member function implements the IPin::EndOfStream method. It calls CTransformInputPin::CheckStreaming to see that the filter is in a streaming state and then calls the CTransformFilter::EndOfStream member function.
CTransformInputPin Class
CTransformInputPin::NewSegmentSpecifies that samples following this call are grouped as a segment with a given start time, stop time, and rate.
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 Values
Returns an HRESULT value.
Remarks
This member function implements the IPin::NewSegment method and overrides the CBasePin::NewSegment member function. It calls the base class implementation first (CBasePin::NewSegment), and then calls CTransformFilter::NewSegment to pass the notification on to the next filter downstream.
CTransformInputPin Class
CTransformInputPin::QueryIdRetrieves an identifier for the pin.
HRESULT QueryId(
LPWSTR * Id
);Parameters
- Id
- Pin identifier.
Return Values
Returns an HRESULT value.
Remarks
This member function implements the IPin::QueryId method and overrides the CBasePin::QueryId member function. It returns the name "In". The caller is responsible for freeing the memory by using the Microsoft® Win32® CoTaskMemFree function.
CTransformInputPin Class
CTransformInputPin::ReceiveReceives the next block of data from the stream.
HRESULT Receive(
IMediaSample * pSample
);Parameters
- pSample
- Pointer to a media sample.
Return Values
Returns an HRESULT value.
Remarks
This member function implements the IMemInputPin::Receive method. Add a reference to the block of data if access to it is required after the completion of this method. For instance, some decoder filters for temporal compression data streams require that the previous sample be kept in order to decode the current sample.
This member function calls the CTransformFilter::Receive member function, which does the work of calling the transform function and then passing the sample on.
CTransformInputPin Class
CTransformInputPin::SetMediaTypeInforms the derived class when the media type is established for the connection.
HRESULT SetMediaType(
const CMediaType* mt
);Parameters
- mt
- Pointer to an input media type to be used.
Return Values
Returns an HRESULT value.
Remarks
This member function overrides the CBasePin::SetMediaType member function. It calls the base class CBasePin::SetMediaType member function, which returns NOERROR, and then calls CTransformFilter::SetMediaType, which the derived class can override to be informed when the media type is set.
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.