IMediaSample2 interface (strmif.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.]

The IMediaSample2 interface sets and retrieves properties on media samples.

This interface inherits the IMediaSample interface. Whereas the IMediaSample interface requires separate method calls for each sample property, the IMediaSample2 interface has methods for setting and retrieving multiple properties at once.

Media samples are not guaranteed to support IMediaSample2. However, if an allocator creates samples that support IMediaSample2, all of the samples that it creates must support the interface. For any given media sample, the IMediaSample2::GetProperties method returns the same values as the individual IMediaSample methods. Therefore, you can use whichever version you prefer.

Inheritance

The IMediaSample2 interface inherits from IMediaSample. IMediaSample2 also has these types of members:

Methods

The IMediaSample2 interface has these methods.

 
IMediaSample2::GetProperties

The GetProperties method retrieves the properties of a media sample.
IMediaSample2::SetProperties

The SetProperties method sets the properties of a media sample.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)

See also

IMediaSample