ImageEn, unit iemmf

TIEMediaFoundationSourceReader.SetMediaTypeCustom

TIEMediaFoundationSourceReader.SetMediaTypeCustom


Declaration

function SetMediaTypeCustom(streamIndex: integer; const jsonDescription: WideString): boolean; overload;
function SetMediaTypeCustom(const streamType: WideString; const jsonDescription: WideString): boolean; overload;


Description

Create and select a new audio/video media type. Media Foundation will provide a decoder to convert from native media type.
Returns False if the media type is not accepted (or a suitable conversion is not available).

Parameter Description
streamIndex Index of the stream, in the range of 0 to StreamCount - 1
streamType A string representing the stream type. Only the first stream of this type will be considered. Can be any one of the values accepted by GetStreamType
jsonDescription JSON description of the media type


Example

// Set media type to RGB32
mt := GetCurrentMediaType(mmf_VIDEO_STREAM);
if mt <> nil then
begin
  mt.Insert( IESUBTYPE_DICT_KEY, mmf_VideoFormat_RGB32 );
  SetMediaTypeCustom(mmf_VIDEO_STREAM, mt.Dump(ieplJSON));
end;


See Also

GetMediaType
GetMediaTypesCount
SetMediaTypeVideo
SetMediaTypeAudio
SelectMediaType
GetCurrentMediaType