CTransInPlaceInputPin.NotifyAllocator 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 NotifyAllocator method specifies an allocator for the connection. This method implements the IMemInputPin::NotifyAllocator method.

Syntax

HRESULT NotifyAllocator(
   IMemAllocator *pAllocator,
   BOOL          bReadOnly
);

Parameters

pAllocator

Pointer to the allocator's IMemAllocator interface.

bReadOnly

Flag that specifies whether samples from this allocator are read-only. If TRUE, samples are read-only.

Return value

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

Return code Description
S_OK
Success
E_FAIL
Failure
E_POINTER
NULL pointer argument

Remarks

The filter attempts to use the same allocator for both pin connections.

  • If the output pin is not connected, the input pin automatically accepts the allocator. When the output pin is connected, the filter will reconnect the input pin. At that point, the filter will try again to use a single allocator.
  • If the output pin is connected, the input pin accepts the allocator. The output pin also uses the same allocator. It calls NotifyAllocator on the downstream input pin.

The previous case has the following exception:

  • If the proposed allocator is read-only (that is, the bReadOnly parameter is TRUE) and the filter needs to modify the samples, then the filter must use two different allocators. In this case, if the upstream filter is proposing to use the downstream filter's allocator, the method returns E_FAIL.

Requirements

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

See also

CTransInPlaceInputPin Class