Microsoft DirectX 9.0

IGrabberSample::SetDeliveryBuffer

The implementation of this method is provided as sample code with the DirectShow SDK. It is not a supported DirectShow API.

The SetDeliveryBuffer method specifies a target memory buffer for media samples received by the Grabber filter.

Syntax

HRESULT SetDeliveryBuffer(
    ALLOCATOR_PROPERTIES props,
    BYTE *pBuffer
);

Parameters

props

Specifies an ALLOCATOR_PROPERTIES structure that describes the properties of the buffer. The cBuffers member must equal 1.

pBuffer

Pointer to a buffer allocated by the caller.

Return Value

This method returns an HRESULT value. Possible return codes include, but are not limited to, the values shown in the following table.

Value Description
E_INVALIDARG Invalid argument
E_OUTOFMEMORY Insufficient memory
E_POINTER NULL pointer argument
S_OK Success

Remarks

This method enables the application to allocate a block of memory that will receive media samples from the Grabber filter. The sample data will be written directly into the memory, without the filter performing a memory copy.

Internally, this method creates a custom allocator. The Grabber filter will force this allocator to be used for its upstream input pin connection. Be aware that this can cause connection failures with some filters, because the other filter may have incompatible allocator requirements.

Call this method before the Grabber's pins are connected; otherwise, the method returns E_INVALIDARG.

See Also