Compartilhar via


ISampleGrabberCB::BufferCB

 
Microsoft DirectShow 9.0

ISampleGrabberCB::BufferCB

The BufferCB method is a callback method that receives a pointer to the sample buffer.

Syntax

  HRESULT BufferCB(
  double 
  SampleTime,
  
  BYTE
   *pBuffer,
  long BufferLen
);

Parameters

SampleTime

Starting time of the sample, in seconds.

pBuffer

Pointer to a buffer that contains the sample data.

BufferLen

Length of the buffer pointed to by pBuffer, in bytes.

Return Value

Returns S_OK if successful, or an HRESULT error code otherwise.

Remarks

This callback method receives a pointer to a copy of the data from the most recent media sample. To get the original media sample, instead of a copy, use the SampleCB callback.

To set up the callback, call ISampleGrabber::SetCallback. Also call the ISampleGrabber::SetBufferSamples method to activate sample buffering. Otherwise, the buffer will be empty.

Requirements

Header: Include Qedit.h. This header file is not compatible with Microsoft® Direct3D® headers later than version 7.

Library: Use strmiids.lib.

See Also