Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This interface provides shared memory buffer functionality, holds some properties about the data, and holds a pointer to the data itself. It is used by connected pins to transport media samples from one pin to another.

The IMediaSample2interface extends the functionality of this interface to allow you to set and to retrieve media sample properties.

When to Implement

Implement this interface if you are providing an allocator (buffer) to be used for transporting media samples between filters. This interface is implemented by the CMediaSampleclass in the DirectShow class library.

When to Use

Filters use methods on this interface to set properties and pass data to another filter. Downstream filters use methods on this interface to read the media sample's data and properties. Filters can modify the data in a media sample in place or can make a copy of the sample, modify the copy, and pass it on.

Methods in Vtable Order

The following table shows the methods that appear in the Vtable beneath the standard COM methods inherited from IUnknown.

Method Description

GetPointer

Retrieves a read/write pointer to this buffer's memory.

GetSize

Returns the size, in bytes, of the buffer data area.

GetTime

Retrieves the stream times at which this sample should begin and finish.

SetTime

Sets the stream times at which this sample should begin and finish.

IsSyncPoint

Determines if the beginning of a sample is a synchronization point.

SetSyncPoint

Sets the synchronization point.

IsPreroll

Indicates a preroll property. If TRUE, this sample is for preroll only and should not be displayed.

SetPreroll

Sets the preroll property. If TRUE, this sample is for preroll only and should not be displayed.

GetActualDataLength

Retrieves the data length of the sample.

SetActualDataLength

Sets the data length of the sample.

GetMediaType

Retrieves the media type of the sample.

SetMediaType

Sets the media type of the sample.

IsDiscontinuity

Indicates a discontinuity property. If S_OK is returned, sample is not contiguous with previous sample.

SetDiscontinuity

Sets the discontinuity property. Set to TRUE if sample is new after a seek or dropped sample.

GetMediaTime

Retrieves the media time stamps for the sample.

SetMediaTime

Sets the media time stamps for the sample.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment

See Also