Microsoft DirectX 9.0 |
The GetOutputSizeInfo method retrieves the buffer requirements for a specified output stream.
Syntax
HRESULT GetOutputSizeInfo(
DWORD dwOutputStreamIndex,
DWORD *pcbSize,
DWORD *pcbAlignment
);
Parameters
dwOutputStreamIndex
Zero-based index of an output stream on the DMO.
pcbSize
[out] Pointer to a variable that receives the minimum size of an output buffer for this stream, in bytes.
pcbAlignment
[out] Pointer to a variable that receives the required buffer alignment, in bytes. If the output stream has no alignment requirement, the value is 1.
Return Value
Returns an HRESULT value. Possible values include those in the following table.
Return Code | Description |
DMO_E_INVALIDSTREAMINDEX | Invalid stream index. |
DMO_E_TYPE_NOT_SET | Media type was not set. |
S_OK | Success. |
Remarks
The buffer requirements may depend on the media types set for each of the streams.
Before calling this method, set the media type of each stream by calling the IMediaObject::SetInputType and IMediaObject::SetOutputType methods. If the media types have not been set, this method might return an error. However, if a stream is optional, and the application will not use the stream, you do not have to set the media type for the stream.
A buffer is aligned if the buffer's start address is a multiple of *pcbAlignment. Depending on the architecture of the microprocessor, it is faster to read and write to an aligned buffer than to an unaligned buffer. On some microprocessors, reading and writing to an unaligned buffer is not supported and can cause the program to crash. Zero is not a valid alignment.
See Also