Delivers data to an input stream on this Media Foundation transform (MFT).
HRESULT ProcessInput( DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags );
Input stream identifier. To get the list of stream identifiers, call IMFTransform::GetStreamIDs.
Pointer to the IMFSample interface of the input sample. The sample must contain at least one media buffer that contains valid input data.
Reserved. Must be zero.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
||The method succeeded.|
||Invalid stream identifier.|
The input sample requires a valid sample duration. To set the duration, call IMFSample::SetSampleDuration.
Some MFTs require that input samples have valid durations. Some MFTs do not require sample durations.
The input sample requires a time stamp. To set the time stamp, call IMFSample::SetSampleTime.
Some MFTs require that input samples have valid time stamps. Some MFTs do not require time stamps.
||The transform cannot process more input at this time.|
||The media type is not set on one or more streams.|
||The media type is not supported for DirectX Video Acceleration (DXVA). A DXVA-enabled decoder might return this error code.|
In most cases, if the method succeeds, the MFT stores the sample and holds a reference count on the IMFSample pointer. Do not re-use the sample until the MFT releases the sample. Instead of storing the sample, however, an MFT might copy the sample data into a new buffer. In that case, the MFT should set the MFT_INPUT_STREAM_DOES_NOT_ADDREF flag in the IMFTransform::GetInputStreamInfo method.
If the MFT already has enough input data to produce an output sample, it does not accept new input data, and ProcessInput returns MF_E_NOTACCEPTING. At that point, the client should clear the pending input data by doing one of the following:
- Generate new output by calling IMFTransform::ProcessOutput.
- Flush the input data by calling IMFTransform::ProcessMessage with the MFT_MESSAGE_COMMAND_FLUSH message.
An MFT can process the input data in the ProcessInput method. However, most MFTs wait until the client calls ProcessOutput.
After the client has set valid media types on all of the streams, the MFT should always be in one of two states: Able to accept more input, or able to produce more output. It should never be in both states or neither state. An MFT should only accept as much input as it needs to generate at least one output sample, at which point ProcessInput returns MF_E_NOTACCEPTING. When ProcessInput returns MF_E_NOTACCEPTING, the client can assume that the MFT is ready to produce output.
If an MFT encounters a non-fatal error in the input data, it can simply drop the data and attempt to recover when it gets the more input data. To request more input data, the MFT returns MF_E_TRANSFORM_NEED_MORE_INPUT from the IMFTransform::ProcessOutput method. If the MFT drops any data, it should set the MFSampleExtension_Discontinuity attribute attribute on the next output sample, to notify the caller that there is a gap in the data stream.
If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTProcessInput. See Creating Hybrid DMO/MFT Objects.Asynchronous MFTs.
|Windows version||Windows Vista [desktop apps | UWP apps] Windows Server 2008 [desktop apps | UWP apps]|