Microsoft DirectX 9.0

IMediaSample::SetMediaType

The SetMediaType method sets the media type for the sample.

Syntax

HRESULT SetMediaType(
  AM_MEDIA_TYPE *pMediaType
);

Parameters

pMediaType

Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return Value

Returns an HRESULT value. Possible values include those shown in the following table.

Value Description
S_OK Success
E_OUTOFMEMORY Insufficient memory

Remarks

By default, every sample has the same media type as the previous sample. (The pin connection determines the original media type.) Call this method to make limited changes to the media type, such as changing the palette. To make a significant change to the media type, the pins might need to reconnect and renegotiate the media type.

See Also