Share via


CSourceStream::GetMediaType (Compact 2013)

3/26/2014

Fills out the fields of the CMediaType object to the supported media type.

Syntax

virtual HRESULT GetMediaType(
  int iPosition,
  CMediaType* pMediaType 
);

virtual HRESULT GetMediaType(
  CMediaType* pMediaType 
);

Parameters

  • iPosition
    Position of the media type within a list of multiple media types. Range is zero through n.
  • pMediaType
    Pointer to a CMediaType object to be set to the requested format.

Return Value

Returns one of the following HRESULT values.

Value

Description

Error Code

Media type could not be set.

S_FALSE

Media type exists but is not currently usable.

S_OK

Media type was set.

VFW_S_NO_MORE_ITEMS

End of the list of media types has been reached.

Remarks

This member function sets the requested media type.

If only a single media type is supported, override this member function with the single-parameter definition.

Only the default implementations of the CSourceStream::CheckMediaType and CSourceStream::GetMediaType member functions call the single media type member function.

Override the single-version GetMediaType or the two-parameter version, CheckMediaType.

Requirements

Header

dshow.h,
Streams.h

Library

ole32.lib,
Ole32auth.lib,
Strmbase.lib,
Strmiids.lib,
uuid.lib

See Also

Reference

CSourceStream Class