IMFVideoSampleAllocator::InitializeSampleAllocator Method

Specifies the number of samples to allocate and the media type for the samples.

Syntax

public:
HRESULT InitializeSampleAllocator(
         DWORD cRequestedFrames,
         IMFMediaType *pMediaType
)  

Parameters

cRequestedFrames
Type: DWORD 

Number of samples to allocate.

pMediaType
Type: IMFMediaType *

Pointer to the IMFMediaType interface of a media type that describes the video format.

Return value

Type: HRESULT 

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codes
Return code Description
S_OK The method succeeded.
MF_E_INVALIDMEDIATYPE Invalid media type.

Refer to Media Foundation return codes.

Requirements

Header: Declared in mfidl.h.

Library: Use mfuuid.lib.