Microsoft DirectX 8.1 (C++)

ISampleGrabber::GetCurrentBuffer

The GetCurrentBuffer method retrieves a copy of the buffer associated with the most recent sample.

Syntax

HRESULT GetCurrentBuffer(
  long *pBufferSize,
  long *pBuffer
);

Parameters

pBufferSize

[in, out] Pointer to the size of the buffer. If pBuffer is NULL, this parameter receives the required size. If pBuffer is not NULL, this parameter specifies the buffer size.

pBuffer

[out] Pointer to a buffer to receive a copy of the sample, or NULL.

Return Value

Returns one of the following values.

Return code Description
E_INVALIDARG Samples are not being buffered.
E_POINTER NULL pointer argument.
S_OK Success.
VFW_E_NOT_CONNECTED The filter is not connected.
VFW_E_WRONG_STATE The filter did not buffer a sample yet. To buffer a sample, run or pause the graph.

Remarks

To activate buffering, call ISampleGrabber::SetBufferSamples with a value of TRUE.

The filter does not buffer preroll samples, or samples in which the dwStreamId member of the AM_SAMPLE2_PROPERTIES structure is anything other than AM_STREAM_MEDIA.

See Also