Contains information about an output buffer for a Media Foundation transform. This structure is used in the IMFTransform::ProcessOutput method.
typedef struct _MFT_OUTPUT_DATA_BUFFER {
DWORD dwStreamID;
IMFSample *pSample;
DWORD dwStatus;
IMFCollection *pEvents;
} MFT_OUTPUT_DATA_BUFFER, *PMFT_OUTPUT_DATA_BUFFER;
dwStreamID
Output stream identifier. Before calling ProcessOutput, set this member to a valid stream identifier.
Exception: If the IMFTransform::GetStreamIDs method returns E_NOTIMPL, the MFT ignores this member and uses the indexes of the pOutputSamples array in the ProcessOutput method as the stream identifiers. In other words, it uses the first element in the array for stream 0, the second for stream 1, and so forth. It is recommended (but not required) that the caller set dwStreamID equal to the array index in this case.
pSample
Pointer to the IMFSample interface. Before calling ProcessOutput, set this member equal to a valid IMFSample pointer or NULL. See Remarks for more information.
dwStatus
Before calling ProcessOutput, set this member to zero. When the method returns, the MFT might set the member equal to a value from the _MFT_OUTPUT_DATA_BUFFER_FLAGS enumeration. Otherwise, the MFT leaves this member equal to zero.
pEvents
Before calling ProcessOutput, set this member to NULL. On output, the MFT might set this member to a valid IMFCollection interface pointer. The pointer represents a collecton that contains zero or more events. To get each event, call IMFCollection::GetElement and query the returned IUnknown pointer for the IMFMediaEvent interface. When the ProcessOutput method returns, the caller is responsible for releasing the IMFCollection pointer if the pointer is not NULL.
You must provide an MFT_OUTPUT_DATA_BUFFER structure for each selected output stream.
MFTs can support two different allocation models for output samples:
To find which model the MFT supports for a given output stream, call IMFTransform::GetOutputStreamInfo and check the value of dwFlags.
| Flag | Allocation Model |
|---|---|
| MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | The MFT allocates the output samples for the stream. Set pSample to NULL for this stream. |
| MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES | The MFT supports both allocation models. |
| Neither (default) | The client must allocate the output samples for the stream. |
The behavior of ProcessOutput depends on the initial value of pSample and the value of the dwFlags parameter in the ProcessOutput method.
Any other combinations are invalid and cause ProcessOutput to return E_INVALIDARG.
Each call to ProcessOutput can produce zero or more events and up to one sample per output stream.
Header: Declared in mftransform.h.