Share via


IMemAllocator::GetBuffer

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method retrieves a container for a sample.

Syntax

HRESULT GetBuffer(
  IMediaSample** ppBuffer,
  REFERENCE_TIME* pStartTime,
  REFERENCE_TIME* pEndTime,
  DWORD dwFlags
);

Parameters

  • ppBuffer
    [out] Pointer to a retrieved media sample buffer.
  • pStartTime
    [in] Either NULL or set to the beginning time of the sample to retrieve.

    Only the video renderer uses this.

  • pEndTime
    [in] Either NULL or set to the ending time of the sample to retrieve.

    Only the video renderer uses this.

  • dwFlags
    [in] GetBuffer supports the following flags.

    Flag Description

    AM_GBF_NOTASYNCPOINT

    Dynamic format changes are not allowed on this buffer because it is not a key frame.

    AM_GBF_PREVFRAMESKIPPED

    Set to TRUE if this sample is the first after a discontinuity.

    Only the video renderer uses this.

Return Value

Returns an HRESULT value that depends on the implementation.

HRESULT can be one of the following standard constants, or other values not listed.

Value Description

E_FAIL

Failure.

E_POINTER

Null pointer argument.

E_INVALIDARG

Invalid argument.

E_NOTIMPL

Method is not supported.

S_OK or NOERROR

Success.

Remarks

IMemAllocator::GetBuffer is a locking, synchronous method to get the next free buffer. Upon return, the properties are invalid, but the buffer pointer and size are correct.

This method succeeds only if memory has been committed.

GetBuffer returns with an error value if it is blocked waiting for a buffer, and the IMemAllocator::Decommit method is called on another thread.

If the pStartTime and pEndTime parameters are not NULL, they specify the intended start and end time for the sample in stream time (reference clock time minus the stream time offset).

The video renderer applies these parameters when using DirectDraw to schedule when to return a sample.

If pStartTime and pEndTime are NULL the video renderer will not use DirectDraw.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later

See Also

Reference

IMemAllocator Interface