Share via


IMediaObject::GetOutputSizeInfo (Compact 2013)

3/26/2014

This 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 the following.

Value

Description

S_OK

Success

DMO_E_INVALIDSTREAMINDEX

Invalid stream index

DMO_E_TYPE_NOT_SET

Media type was not set

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.

Requirements

Header

dmo.h

Library

Dmoguid.lib

See Also

Reference

IMediaObject
IMediaObject::SetInputType
IMediaObject::SetOutputType
MoFreeMediaType
DMO Error Codes
DMO Error Codes