Microsoft DirectX 8.1 (C++) |
Whereas the ProcessInput method delivers one input buffer at a time, the ProcessOutput method generates output for all the output streams at once. The application passes an array of DMO_OUTPUT_DATA_BUFFER structures, with one structure for every output stream. The structure contains a pointer to an output buffer (allocated by the application) and various fields that are filled in by the DMO.
In the ProcessOutput method, the DMO generates as much data as possible, given the size of the output buffers. If it fills an output buffer before it processes all of the data, it sets the DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE flag in the structure's dwStatus member. When the method returns, check each structure for this flag. If the flag is present, call ProcessOutput again.
After streaming begins, the DMO can always accept input, or produce output, or both. Therefore, either GetInputStatus returns the DMO_INPUT_STATUSF_ACCEPT_DATA flag, or ProcessOutput returns the DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE flag. The application keeps data flowing by testing for these flags and calling ProcessInput or ProcessOutput.