Partager via


IMediaObject::GetInputSizeInfo

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method retrieves the buffer requirements for a specified input stream.

Syntax

HRESULT GetInputSizeInfo(
  DWORD dwInputStreamIndex,
  DWORD* pcbSize,
  DWORD* pcbMaxLookahead,
  DWORD* pcbAlignment
);

Parameters

  • dwInputStreamIndex
    Zero-based index of an input stream on the DMO.
  • pcbSize
    [out] Pointer to a variable that receives the minimum size of an input buffer for this stream, in bytes.
  • pcbMaxLookahead
    [out] Pointer to a variable that receives the maximum amount of data that the DMO will hold for a lookahead, in bytes. If the DMO does not perform a lookahead on the stream, the value is zero.
  • pcbAlignment
    [out] Pointer to a variable that receives the required buffer alignment, in bytes. If the input 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 of the various 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.

If the DMO performs a lookahead on the input stream, it returns the DMO_INPUT_STREAMF_HOLDS_BUFFERS flag in the IMediaObject::GetInputStreamInfo method. During processing, the DMO holds up to the number of bytes indicated by the pcbMaxLookahead parameter. The application must allocate enough buffers for the DMO to hold this much data.

A buffer is aligned if the buffer's start address is a multiple of *pcbAlignment. The alignment must be a power of two. Depending on the microprocessor, reads and writes to an aligned buffer might be faster than to an unaligned buffer. Also, some microprocessors do not support unaligned reads and writes.

Requirements

Header dmo.h
Library Dmoguid.lib
Windows Embedded CE Windows CE .NET 4.1 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IMediaObject
IMediaObject::SetInputType
IMediaObject::SetOutputType
IMediaObject::GetInputStreamInfo
MoFreeMediaType
DMO Error Codes
DMO Error Codes
DMO_INPUT_STREAM_INFO_FLAGS
DMO_MEDIA_TYPE