IMediaStream::AllocateSample method (mmstream.h)
[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.]
Syntax
HRESULT AllocateSample(
[in] DWORD dwFlags,
[out] IStreamSample **ppSample
);
Parameters
[in] dwFlags
Flags. Must be zero.
[out] ppSample
Address of a pointer to the newly created stream sample's IStreamSample interface.
Return value
Returns one of the following values.
Return code | Description |
---|---|
|
There isn't enough memory available to create a stream sample. |
|
A parameter is invalid. |
|
Success. |
Remarks
This method allocates the sample and its associated backing object or buffer. The backing object is either the DirectDraw surface for video or the IAudioData object for audio.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | mmstream.h |