Class TMediaType
Unit
DSUtil
Declaration
type TMediaType = class()
Description
Uses TMediaType to configure media types. This class have a special property editor. See TSampleGrabber
Fields
| Name | Description |
 |
AMMediaType |
Local copy of the Media Type. |
Methods
Overview
Description
 |
constructor Create(MTClass: TMediaType); overload; |
Constructor method. Initialised with another TMediaType
 |
constructor Create(mediatype: PAMMediaType); overload; |
Constructor method. Initialised with another media type.
 |
constructor Create(majortype: TGUID); overload; |
Constructor method. Initialised with majortype.
 |
constructor Create; overload; |
Constructor method.
 |
destructor Destroy; override; |
Destructor method.
 |
function AllocFormatBuffer(length: ULONG): pointer; |
The AllocFormatBuffer method allocates memory for the format block.
length: Size required for the format block, in bytes.
Returns a pointer to the new block if successful. Otherwise, returns nil.
If the method successfully allocates a new format block, it frees the existing format block. If the allocation fails, the method leaves the existing format block.
 |
procedure Assign(Source: TPersistent); override; |
Copy from another TMediaType.
 |
function Equal(MTClass: TMediaType): boolean; overload; |
Tests for equality between TMediaType objects.
rt: Reference to the TMediaType object to compare.
Returns TRUE if rt is equal to this object. Otherwise, returns FALSE.
 |
function Format: pointer; |
read/write pointer to format - can't change length without calling SetFormat, AllocFormatBuffer or ReallocFormatBuffer
 |
function FormatLength: ULONG; |
The FormatLength method retrieves the length of the format block.
 |
function GetSampleSize: ULONG; |
The GetSampleSize method retrieves the sample size. If the sample size is fixed, returns the sample size in bytes. Otherwise, returns zero.
 |
procedure InitMediaType; |
The InitMediaType method initializes the media type. This method zeroes the object's memory, sets the fixed-sample-size property to TRUE, and sets the sample size to 1.
 |
function IsFixedSize: boolean; |
The IsFixedSize method determines if the samples have a fixed size or a variable size. Returns the value of the bFixedSizeSamples member.
 |
function IsPartiallySpecified: boolean; |
The IsPartiallySpecified method determines if the media type is partially defined. A media type is partial if the major type, subtype, or format type is GUID_NULL. The IPin.Connect method can accept partial media types. The implementation does not actually test the subtype. If there is a specified format type, the media type is not considered partial, even if the subtype is GUID_NULL.
 |
function IsTemporalCompressed: boolean; |
The IsTemporalCompressed method determines if the stream uses temporal compression. Returns the value of the bTemporalCompression member.
 |
function IsValid: boolean; |
The IsValid method determines whether a major type has been assigned to this object. Returns TRUE if a major type has been assigned to this object. Otherwise, returns FALSE. By default, TMediaType objects are initialized with a major type of GUID_NULL. Call this method to determine whether the object has been correctly initialized.
 |
function MatchesPartial(ppartial: TMediaType): boolean; |
The MatchesPartial method determines if this media type matches a partially specified media type. The media type specified by ppartial can have a value of GUID_NULL for the major type, subtype, or format type. Any members with GUID_NULL values are not tested. (In effect, GUID_NULL acts as a wildcard.) Members with values other than GUID_NULL must match for the media type to match.
 |
function NotEqual(MTClass: TMediaType): boolean; overload; |
Tests for inequality between TMediaType objects.
rt: Reference to the TMediaType object to compare.
Returns TRUE if rt is not equal to this object. Otherwise, returns FALSE.
 |
procedure Read(mediatype: PAMMediaType); |
Copy from another PAM_MEDIA_TYPE.
 |
function ReallocFormatBuffer(length: ULONG): pointer; |
The ReallocFormatBuffer method reallocates the format block to a new size.
length: New size required for the format block, in bytes. Must be greater than zero.
Returns a pointer to the new block if successful. Otherwise, returns either a pointer to the old format block, or nil. This method allocates a new format block. It copies as much of the existing format block as possible into the new format block. If the new block is smaller than the existing block, the existing format block is truncated. If the new block is larger, the contents of the additional space are undefined. They are not explicitly set to zero.
 |
procedure ResetFormatBuffer; |
The ResetFormatBuffer method deletes the format block.
 |
function SetFormat(pFormat: pointer; length: ULONG): boolean; |
The SetFormat method specifies the format block.
pFormat: Pointer to a block of memory that contains the format block.
length: Length of the format block, in bytes.
 |
procedure SetSampleSize(SZ: ULONG); |
The SetSampleSize method specifies a fixed sample size, or specifies that samples have a variable size. If value of sz is zero, the media type uses variable sample sizes. Otherwise, the sample size is fixed at sz bytes.
 |
procedure SetTemporalCompression(bCompressed: boolean); |
The SetTemporalCompression method specifies whether samples are compressed using temporal (interframe) compression.
 |
procedure SetVariableSize; |
The SetVariableSize method specifies that samples do not have a fixed size. This method sets the bFixedSizeSamples member to FALSE. Subsequent calls to the TMediaType.GetSampleSize method return zero.
Properties
Overview
Description
 |
property FormatType: TGUID; |
Set or retrieve the FormatType GUID.
 |
property MajorType: TGUID; |
Set or retrieve the MajorType GUID.
 |
property SubType: TGUID; |
Set or retrieve the SubType GUID.
Generated by DIPasDoc 0.8.0 on Sun 1 Jun 2003 23:53:07