【delphi开源代码栏目提醒】:本文主要为网学会员提供MediaTypeEditor.pas,希望对需要MediaTypeEditor.pas网友有所帮助,学习一下!
(*********************************************************************
* DSPack 2.3.3 *
* *
* home page : http://www.progdigy.com *
* email : 3710167@qq.com *
* Thanks to Michael Andersen. (DSVideoWindowEx) *
* *
* date : 21-02-2003 *
* *
* The contents of this file are used with per
mission, subject to *
* the Mozilla Public License Version 1.1 (the "License"); you may *
* not use this file except in compliance with the License. You may *
* obtain a copy of the License at *
* http://www.mozilla.org/MPL/MPL-1.1.html *
* *
* Software distributed under the License is distributed on an *
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *
* implied. See the License for the specific language governing *
* rights and limitations under the License. *
* *
*********************************************************************)
unit MediaTypeEditor;
interface
{$IFDEF VER150}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CAST OFF}
{$ENDIF}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, DSUtil, StdCtrls, DirectShow9, Mask;
type
TFormMediaType = class(TForm)
btOK: TButton;
btCancel: TButton;
cbMajorTypes: TComboBox;
cbSubTypes: TComboBox;
Label1: TLabel;
Label2: TLabel;
chkFixedSize: TCheckBox;
chkTempCompress: TCheckBox;
edSampleSize: TEdit;
Label3: TLabel;
cbFormatType: TComboBox;
Label4: TLabel;
Memo1: TMemo;
lblFormatSize: TLabel;
edFormatSize: TEdit;
procedure FormShow(Sender: TObject);
procedure cbMajorTypesChange(Sender: TObject);
procedure cbSubTypesChange(Sender: TObject);
procedure chkFixedSizeClick(Sender: TObject);
procedure chkTempCompressClick(Sender: TObject);
procedure btOKClick(Sender: TObject);
procedure cbFormatTypeChange(Sender: TObject);
procedure edSampleSizeChange(Sender: TObject);
public
MediaType: TMediaType;
procedure RefreshMediaType;
constructor create(AOwner: TComponent); override;
destructor Destroy; override;
end;
TGUIDDescription = record
name: string;
GUID: TGUID;
end;
var
FormMediaType: TFormMediaType;
const
MajorTypes : array[0..15] of TGUIDDescription =
((name: '[Automatic]'; GUID: '{00000000-0000-0000-0000-000000000000}'),
(name: 'Video' ; GUID: '{73646976-0000-0010-8000-00AA00389B71}'),
(name: 'Audio' ; GUID: '{73647561-0000-0010-8000-00AA00389B71}'),
(name: 'AnalogAudio' ; GUID: '{0482DEE1-7817-11CF-8A03-00AA006ECB65}'),
(name: 'AnalogVideo' ; GUID: '{0482DDE1-7817-11CF-8A03-00AA006ECB65}'),
(name: 'AUXLine21Data' ; GUID: '{670AEA80-3A82-11D0-B79B-00AA003767A7}'),
(name: 'File' ; GUID: '{656C6966-0000-0010-8000-00AA00389B71}'),
(name: 'Interleaved' ; GUID: '{73766169-0000-0010-8000-00AA00389B71}'),
(name: 'LMRT' ; GUID: '{74726c6d-0000-0010-8000-00aa00389b71}'),
(name: 'Midi' ; GUID: '{7364696D-0000-0010-8000-00AA00389B71}'),
(name: 'MPEG2_PES' ; GUID: '{e06d8020-db46-11cf-b4d1-00805f6cbbea}'),
(name: 'ScriptCommand' ; GUID: '{73636D64-0000-0010-8000-00AA00389B71}'),
(name: 'Stream' ; GUID: '{E436EB83-524F-11CE-9F53-0020AF0BA770}'),
(name: 'Text' ; GUID: '{73747874-0000-0010-8000-00AA00389B71}'),
(name: 'Timecode' ; GUID: '{0482DEE3-7817-11CF-8A03-00AA006ECB65}'),
(name: 'URL_STREAM' ; GUID: '{736c7275-0000-0010-8000-00aa00389b71}'));
SubTypes : array[0..97] of TGUIDDescription =
((name: '[Automatic]'; GUID: '{00000000-0000-0000-0000-000000000000}'),
(name: 'MJPG'; GUID: '{47504A4D-0000-0010-8000-00AA00389B71}'),
(name: 'Avi'; GUID: '{E436EB88-524F-11CE-9F53-0020AF0BA770}'),
(name: 'Asf'; GUID: '{3DB80F90-9412-11D1-ADED-0000F8754B99}'),
(name: 'PCM'; GUID: '{00000001-0000-0010-8000-00AA00389B71}'),
(name: 'WAVE'; GUID: '{E436EB8B-524F-11CE-9F53-0020AF0BA770}'),
(name: 'AU'; GUID: '{E436EB8C-524F-11CE-9F53-0020AF0BA770}'),
(name: 'AIFF'; GUID: '{E436EB8D-524F-11CE-9F53-0020AF0BA770}'),
(name: 'DTS'; GUID: '{E06D8033-DB46-11CF-B4D1-00805F6CBBEA}'),
(name: 'DOLBY_AC3'; GUID: '{E06D802C-DB46-11CF-B4D1-00805F6CBBEA}'),
(name: 'RGB1'; GUID: '{E436EB78-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB4'; GUID: '{E436EB79-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB8'; GUID: '{E436EB7A-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB565'; GUID: '{E436EB7B-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB555'; GUID: '{E436EB7C-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB24'; GUID: '{E436EB7D-524F-11CE-9F53-0020AF0BA770}'),
(name: 'RGB32'; GUID: '{E436EB7E-