Microsoft DirectX 9.0

IDirectDrawMediaStream::SetFormat

Sets the format of the current media stream.

Syntax

HRESULT SetFormat(
  const DDSURFACEDESC *pDDSurfaceDesc,
  IDirectDrawPalette *pDirectDrawPalette
  );

Parameters

pDDSurfaceDesc

[in] Pointer to a DirectDraw surface description that contains the new format.

pDirectDrawPalette

[in] Optional parameter that is a pointer to an IDirectDrawPalette interface.

Return Values

Returns one of the following values.

Return code Description
DDERR_INVALIDSURFACETYPE The specified format is incompatible with the current stream.
MS_E_SAMPLEALLOC Can't change the format because one or more stream samples are already allocated for this stream.
S_OK Success.

Remarks

If the stream already has allocated samples and the sample format doesn't match the specified format, this method fails. This method always succeeds if the specified format matches the current format.

See Also