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

 NameDescription
Public AMMediaType Local copy of the Media Type.

Methods

Overview

Public constructor Create(MTClass: TMediaType); overload;
Public constructor Create(mediatype: PAMMediaType); overload;
Public constructor Create(majortype: TGUID); overload;
Public constructor Create; overload;
Public destructor Destroy; override;
Public function AllocFormatBuffer(length: ULONG): pointer;
Public procedure Assign(Source: TPersistent); override;
Public function Equal(MTClass: TMediaType): boolean; overload;
Public function Format: pointer;
Public function FormatLength: ULONG;
Public function GetSampleSize: ULONG;
Public procedure InitMediaType;
Public function IsFixedSize: boolean;
Public function IsPartiallySpecified: boolean;
Public function IsTemporalCompressed: boolean;
Public function IsValid: boolean;
Public function MatchesPartial(ppartial: TMediaType): boolean;
Public function NotEqual(MTClass: TMediaType): boolean; overload;
Public procedure Read(mediatype: PAMMediaType);
Public function ReallocFormatBuffer(length: ULONG): pointer;
Public procedure ResetFormatBuffer;
Public function SetFormat(pFormat: pointer; length: ULONG): boolean;
Public procedure SetSampleSize(SZ: ULONG);
Public procedure SetTemporalCompression(bCompressed: boolean);
Public procedure SetVariableSize;

Description

Public constructor Create(MTClass: TMediaType); overload;

Constructor method. Initialised with another TMediaType

Public constructor Create(mediatype: PAMMediaType); overload;

Constructor method. Initialised with another media type.

Public constructor Create(majortype: TGUID); overload;

Constructor method. Initialised with majortype.

Public constructor Create; overload;

Constructor method.

Public destructor Destroy; override;

Destructor method.

Public 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.

Public procedure Assign(Source: TPersistent); override;

Copy from another TMediaType.

Public 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.

Public function Format: pointer;

read/write pointer to format - can't change length without calling SetFormat, AllocFormatBuffer or ReallocFormatBuffer

Public function FormatLength: ULONG;

The FormatLength method retrieves the length of the format block.

Public 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.

Public 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.

Public 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.

Public 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.

Public function IsTemporalCompressed: boolean;

The IsTemporalCompressed method determines if the stream uses temporal compression. Returns the value of the bTemporalCompression member.

Public 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.

Public 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.

Public 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.

Public procedure Read(mediatype: PAMMediaType);

Copy from another PAM_MEDIA_TYPE.

Public 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.

Public procedure ResetFormatBuffer;

The ResetFormatBuffer method deletes the format block.

Public 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.

Public 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.

Public procedure SetTemporalCompression(bCompressed: boolean);

The SetTemporalCompression method specifies whether samples are compressed using temporal (interframe) compression.

Public 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

Public property FormatType: TGUID;
Public property MajorType: TGUID;
Public property SubType: TGUID;

Description

Public property FormatType: TGUID;

Set or retrieve the FormatType GUID.

Public property MajorType: TGUID;

Set or retrieve the MajorType GUID.

Public property SubType: TGUID;

Set or retrieve the SubType GUID.


Generated by DIPasDoc 0.8.0 on Sun 1 Jun 2003 23:53:07