Microsoft DirectX 8.0

ISampleGrabberCB Interface

This interface provides callback methods for the ISampleGrabber::SetCallback method. If your application calls that method, it must implement this interface. For more information, see ISampleGrabber.

Requirements

Requires Qedit.h.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterfaceRetrieves pointers to supported interfaces.
AddRefIncrements the reference count.
ReleaseDecrements the reference count.
ISampleGrabberCB methodsDescription
SampleCBCallback method that receives a pointer to the media sample.
BufferCBCallback method that receives a pointer to the sample buffer.

ISampleGrabberCB::BufferCB

ISampleGrabberCB Interface

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

Call the ISampleGrabber::SetBufferSamples method to activate sample buffering. Otherwise, the buffer will be empty.

ISampleGrabberCB::SampleCB

ISampleGrabberCB Interface

Callback method that receives a pointer to the media sample.

Syntax

HRESULT SampleCB( 
    double SampleTime, 
    IMediaSample *pSample 
);

Parameters

SampleTime
Starting time of the sample, in seconds.
pSample
Pointer to the sample's IMediaSample interface.

Return Value

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