Microsoft DirectX 8.1 (C++)

IMediaSample Interface

Sets and retrieves properties on media samples. A media sample is a COM object that contains a block of media data. Media samples support the use of shared memory buffers among filters.

Typically, applications do not call methods on this interface. Filters use this interface to set properties on samples, and deliver the samples to a downstream filter. The downstream filter uses the interface to retrieve the properties and read the data. The filter can modify the data in place, or it can copy the sample, modify the copy, and pass the copy downstream.

The IMediaSample2 interface inherits this interface.

In addition to the methods inherited from IUnknown, the IMediaSample interface exposes the following methods.

Method Description
GetPointer Retrieves a read/write pointer to this buffer's memory.
GetSize Retrieves the size of the buffer.
GetTime Retrieves the stream times at which this sample should begin and finish.
SetTime Sets the stream time when this sample should begin and finish.
IsSyncPoint Determines if the beginning of this sample is a synchronization point.
SetSyncPoint Specifies whether the beginning of this sample is a synchronization point.
IsPreroll Determines if this sample is a preroll sample.
SetPreroll Specifies whether this sample is a preroll sample.
GetActualDataLength Retrieves the length of the valid data in the buffer.
SetActualDataLength Sets the length of the valid data in the buffer.
GetMediaType Retrieves the media type, if the media type differs from the previous sample.
SetMediaType Sets the media type for the sample.
IsDiscontinuity Determines if this sample represents a break in the data stream.
SetDiscontinuity Specifies whether this sample represents a break in the data stream.
GetMediaTime Retrieves the media times for this sample.
SetMediaTime Sets the media times for this sample.