IMediaStream::CreateSharedSample 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 CreateSharedSample(
[in] IStreamSample *pExistingSample,
[in] DWORD dwFlags,
[out] IStreamSample **ppNewSample
);
Parameters
[in] pExistingSample
Pointer to the existing sample.
[in] dwFlags
Reserved for flag data. Must be zero.
[out] ppNewSample
Address of a pointer to an IStreamSample interface that will point to the newly created shared sample.
Return value
Returns one of the following values.
Return code | Description |
---|---|
|
There isn't enough memory available to create the sample. |
|
One of the parameters is invalid. |
|
The existing sample isn't compatible with the specified media stream. |
|
Success; ppNewSample points to the newly created sample. |
Remarks
This method calls IUnknown::QueryInterface on the existing sample to retrieve the media type-specific information, which it uses to create the shared sample.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | mmstream.h |