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. |
Informs the pin to begin a flush operation.
HRESULT BeginFlush(void);
Returns an HRESULT value.
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.
Informs the derived class when the connection is broken.
HRESULT BreakConnect( );
Returns NOERROR in this implementation.
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).
Informs the derived class when the connection process is starting.
HRESULT CheckConnect(
IPin *pPin
);
Returns NOERROR by default.
This member function overrides the CBasePin::CheckConnect member function and calls the CTransformFilter::CheckConnect member function. Override CTransformFilter::CheckConnect to add additional interfaces.
Determines if the pin can use a specified media type.
HRESULT CheckMediaType(
const CMediaType* mtIn
);
No return value.
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.
Verifies conditions for continuing with a streaming operation.
HRESULT CheckStreaming( );
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. |
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.
Informs the derived class when the connection process has been completed.
HRESULT CompleteConnect(
IPin *pReceivePin
);
Returns an HRESULT value.
This member function overrides the CBasePin::CompleteConnect member function. It calls the base class CBasePin::CompleteConnect member function and then calls CTransformFilter::CompleteConnect.
Constructs a CTransformInputPin object.
CTransformInputPin(
TCHAR *pObjectName,
CTransformFilter *pTransformFilter,
HRESULT * phr,
LPCWSTR pName
);
No return value.
Retrieves the media type currently assigned to the filter.
CMediaType& CurrentMediaType( );
Returns the value of CBasePin::m_mt.
Informs the pin to end a flush operation and notifies the pin that it can start accepting data again.
HRESULT EndFlush(void);
Returns an HRESULT value.
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.
Informs the input pin that no additional data is expected until a new run command is issued.
HRESULT EndOfStream(void);
Returns an HRESULT value.
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.
Specifies 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
);
Returns an HRESULT value.
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.
Retrieves an identifier for the pin.
HRESULT QueryId(
LPWSTR * Id
);
Returns an HRESULT value.
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.
Receives the next block of data from the stream.
HRESULT Receive(
IMediaSample * pSample
);
Returns an HRESULT value.
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.
Informs the derived class when the media type is established for the connection.
HRESULT SetMediaType(
const CMediaType* mt
);
Returns an HRESULT value.
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.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.