CTransInPlaceFilter.DecideBufferSize method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The DecideBufferSize method sets the output pin's buffer requirements.

Syntax

HRESULT DecideBufferSize(
   IMemAllocator        *pAlloc,
   ALLOCATOR_PROPERTIES *pProperties
);

Parameters

pAlloc

Pointer to the IMemAllocator object used by the output pin.

pProperties

Pointer to the requested allocator properties for count, size, and alignment, as specified by the ALLOCATOR_PROPERTIES structure.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK
Success
E_FAIL
Failure

Remarks

This method is called when the CTransInPlaceFilter class needs to provide a buffer size to the downstream filter. If the CTransInPlaceFilter filter is already connected upstream, it uses the allocator properties on the upstream pin connection. Otherwise, it sets the buffer size to 1 byte as a temporary place-holder value. When the upstream filter connects, the CTransInPlaceFilter class renegotiates the downstream allocator. For more information about the pin connection process in this class, see CTransInPlaceFilter Class.

Requirements

Requirement Value
Header
Transip.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CTransInPlaceFilter Class