次の方法で共有


CBaseAllocator::GetBuffer (Windows Embedded CE 6.0)

1/6/2010

Retrieves a container for a sample.

Syntax

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

Parameters

  • ppBuffer
    Pointer to a retrieved media sample buffer.
  • pStartTime
    Either NULL or set to the beginning time of the sample to retrieve.
  • pEndTime
    Either NULL or set to the ending time of the sample to retrieve.
  • dwFlags
    The following flags are supported.

    Value Description

    AM_GBF_PREVFRAMESKIPPED

    The buffer returned will not be filled with data contiguous to any previous data sent.

    AM_GBF_NOTASYNCPOINT

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

Return Value

Returns an HRESULT value.

Remarks

This member function implements the IMemAllocator::GetBuffer method.

This is a blocking, synchronous call to access the next free buffer (as represented by an IMediaSample interface). Upon return, properties (such as the time and so on) are invalid, but the buffer pointer and size are correct.

If no buffers are available, CBaseAllocator::GetBuffer calls CBaseAllocator::SetWaiting and then calls the Win32 WaitForSingleObject function to wait for the list to signal that a sample is available. The list signals by calling CBaseAllocator::ReleaseBuffer, which in turn calls CBaseAllocator::NotifySample, which sets m_lWaiting to zero and calls the Win32 ReleaseSemaphore function.

This member function also takes two time parameters.

These parameters are used in certain advanced buffering scenarios, when it is necessary to have an idea of the amount of time a buffer is required.

The only place this is currently used is in the video renderer, when the time stamps are used as a guide to when the primary surfaces of Display Control Interface (DCI) and DirectDraw should be returned (this is because filling a primary surface buffer corresponds directly to the actual rendering of the data).

In all other cases, these parameters can be safely set to NULL. If one is non-NULL, both should be non-NULL; these times will not be set on the sample when it is subsequently returned.

Requirements

Windows Embedded CE Windows CE 2.12 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

CBaseAllocator Class