The ltmmMediaType Object is accessed through the IltmmMediaTypeDisp Interface. For more information about the IltmmObjectWrapper Interface, refer to IltmmObjectWrapper. The IltmmMediaTypeDisp Interface lets the user set and get information about an ltmmMediaType object. The media type describes the format of media samples. Since the ltmmMediaTypeDisp Interface is derived from the IDispatch Interface, the IltmmMediaTypeDisp Interface accesses the IDispatch functions, etc. In addition to these functions, the IltmmMediaTypeDisp Interface accesses the following functions:
Functions
IltmmMediaTypeDisp::get_FixedSizeSamples
IltmmMediaTypeDisp::get_Format
IltmmMediaTypeDisp::get_FormatSize
IltmmMediaTypeDisp::get_FormatType
IltmmMediaTypeDisp::get_SampleSize
IltmmMediaTypeDisp::get_Subtype
IltmmMediaTypeDisp::get_TemporalCompression
IltmmMediaTypeDisp::GetFormatData
IltmmMediaTypeDisp::GetPortableType
IltmmMediaTypeDisp::put_FixedSizeSamples
IltmmMediaTypeDisp::put_FormatSize
IltmmMediaTypeDisp::put_FormatType
IltmmMediaTypeDisp::put_SampleSize
IltmmMediaTypeDisp::put_Subtype
IltmmMediaTypeDisp::put_TemporalCompression
IltmmMediaTypeDisp::SetFormatData
IltmmMediaTypeDisp::SetPortableType
IltmmMediaTypeDisp::ResetMediaType
IltmmMediaTypeDisp::ResetFormat
Before sending samples or receiving samples, a Sample Source object or Sample Target object should set the media type sent or accepted by that object.
LEADTOOLS Multimedia offers both a high level and a low level method for handling the media type.
High level
The media type information can be obtained in a flat or "portable" format that contains all the necessary information to fully reconstruct the media type. This prevents the user from having to worry about the specific type, subtype, and format information. To get this "portable" media type information, use the IltmmMediaTypeDisp::GetPortableType function.
Once the media type has been obtained by calling the IltmmMediaTypeDisp::GetPortableType function, it can then be used to set the media type for other objects by using the IltmmMediaTypeDisp::SetPortableType function. Please note that only data retrieved using the IltmmMediaTypeDisp::GetPortableType function should be passed to the IltmmMediaTypeDisp::SetPortableType function. These two functions allow the user to get a media type from one sample and use that media type to set another sample.
Low level
The low level method for handling the media type requires the user to be familiar with media types, subtypes and any format types that may be encountered. This information can all be obtained and set individually, using the following functions:
IltmmMediaTypeDisp::get_FixedSizeSamples
IltmmMediaTypeDisp::get_Format
IltmmMediaTypeDisp::get_FormatSize
IltmmMediaTypeDisp::get_FormatType
IltmmMediaTypeDisp::get_SampleSize
IltmmMediaTypeDisp::get_Subtype
IltmmMediaTypeDisp::get_TemporalCompression
IltmmMediaTypeDisp::GetFormatData
IltmmMediaTypeDisp::put_FixedSizeSamples
IltmmMediaTypeDisp::put_FormatSize
IltmmMediaTypeDisp::put_FormatType
IltmmMediaTypeDisp::put_SampleSize
IltmmMediaTypeDisp::put_Subtype
IltmmMediaTypeDisp::put_TemporalCompression
IltmmMediaTypeDisp::SetFormatData
IltmmMediaTypeDisp::ResetMediaType
IltmmMediaTypeDisp::ResetFormat
The media samples sent from a Sample Source object or to a Sample Target object may be of a fixed (the same) size, or may be of different sizes. The IltmmMediaTypeDisp::get_FixedSizeSamples function indicates whether the samples are of fixed (the same) size or not. The IltmmMediaTypeDisp::get_SampleSize function provides the size of the sample. To change or set the "Fixed size" state of a sample, use the IltmmMediaTypeDisp::put_FixedSizeSamples. To change or set the size of the sample, use IltmmMediaTypeDisp::put_SampleSize.
A media sample has a certain media type. Each "media type" consists of three attributes, the Type, Subtype and FormatType. The "Type" of the sample may be MEDIATYPE_Video, or MEDIATYPE_Stream, or some other type. To determine the major media type of a media sample, use IltmmMediaTypeDisp::get_Type. To set the type of a media sample, use IltmmMediaTypeDisp::put_Type.
A format type may also have a subtype. For "Type" MEDIATYPE_Video, the "Subtype" may be MEDIASUBTYPE_RGB24. To determine the subtype, use the IltmmMediaTypeDisp::get_Subtype function. To set the subtype, use IltmmMediaTypeDisp::put_Subtype.
The "FormatType" specifies additional information for a specific Type-Subtype combination. The IltmmMediaTypeDisp::get_FormatType function provides information on the kind of data found in the Format buffer. To set the kind of data that the format buffer will contain, use IltmmMediaTypeDisp::put_FormatType. The Format buffer can be accessed directly, by calling the IltmmMediaTypeDisp::get_Format function, or a copy of the buffer can be obtained by calling the IltmmMediaTypeDisp::GetFormatData function. The format data itself must actually be copied to the format buffer. This is done using the IltmmMediaTypeDisp::SetFormatData function. To determine the size of the format buffer, use the IltmmMediaTypeDisp::get_FormatSize function. To set or change the size of the format buffer, use IltmmMediaTypeDisp::put_FormatSize. For more information on available "Types", "Subtypes" and "FormatTypes", refer to the DirectShow documentation.
Media samples can be compressed using temporal or interframe compression. The IltmmMediaTypeDisp::get_TemporalCompression function can be used to determine whether samples are compressed using temporal compression. To change or set the value that indicates whether temporal compression is used in the media sample, use IltmmMediaTypeDisp::put_TemporalCompression.
Win32, x64
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document