DirectShow.pas

Top  Previous  Next

     {******************************************************************}

     {                                                                  }

     {  ###### ####   ###                                               }

     {  ##  ###  ### ##       ,######  ##   ##   ######  ###        ### }

     {  ##   ###  ####        ##       ##   ##  ##    ##  ##   #    ##  }

     {  ##    ##   ###        ######   #######  ##    ##  \## ### ##/   }

     {  ##    ##  #####         #####  #######  ##    ##   #########    }

     {  ##   ##  ##  ###          ,##  ##   ##  ##    ##    ### ###     }

     {  ###### ###    ####   #######   ##   ##   ######     ##   ##     }

     {                                                                  }

     { Borland Delphi 4,5,6,7 API for Direct Show                       }

     { DirectX 8.1 Win 98, Me, 2000, XP                                 }

     {                                                                  }

     { Portions created by Microsoft are                                }

     { Copyright (C) 1995-2001 Microsoft Corporation.                   }

     { All Rights Reserved.                                             }

     {                                                                  }

     { The original files are:                                          }

     {   comlite.h, errors.h, dv.h, strmif.h, mmstream.h, amstream.h,   }

     {   ddstream.h, austream.h, mpconfig.h, control.h, qnetwork.h,     }

     {   playlist.h, il21dec.h, amvideo.h, amaudio.h, vptype.h,         }

     {   vpconfig.h, vpnotify.h, mpegtype.h, dvdevcod.h, dvdmedia.h,    }

     {   bdatypes.h, activecf.h, vfwmsgs.h,(edevdefs.h, XPrtDefs.h),    }

     {   aviriff.h, evcode.h, uuids.h, ksuuids.h, DXVA.h,AMVA.h,        }

     {   videoacc.h, regbag.h, tuner.h, DXTrans.h, QEdit.h, mpeguids.h, }

     {   dshowasf.h, amparse.h, audevcod.h, atsmedia.h, MediaErr,       }

     {   MedParam.h, mediaobj.h, dmodshow.h, dmoreg.h, DMORt.h,         }

     {   dmoimpl.h, ks.h, ksproxy.h, ksmedia.h, dmksctrl.h, bdamedia.h, }

     {   BDATIF.idl, AMVPE.idl.                                         }

     {                                                                  }

     { The original Pascal code is: DirectShow.pas,                     }

     {   released 20 Oct 2002.                                          }

     {                                                                  }

     { The initial developer of the Pascal code is Henri GOURVEST       }

     {   Email    : hgourvest@progdigy.com                              }

     {   WebSite  : http://www.progdigy.com                             }

     {                                                                  }

     { Portions created by Henri GOURVEST are                           }

     { Copyright (C) 2001 Henri GOURVEST.                               }

     {                                                                  }

     { Contributors: Ivo Steinmann                                      }

     {               Peter NEUMANN                                      }

     {               Alexey Barkovoy                                    }

     {               Wayne Sherman                                      }

     {                                                                  }

     { Joint Endeavour of Delphi Innovators (Project JEDI)              }

     {                                                                  }

     { You may retrieve the latest version of this file at the Project  }

     { JEDI home page, located at                                       }

     {    http://www.delphi-jedi.org/DelphiGraphics/jedi-index.htm      }

     {                                                                  }

     { The contents of this file are used with permission, 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.                        }

     {                                                                  }

     {******************************************************************}

     {******************************************************************}

     { WARNING : To compile for Window XP, add ($DEFINE WindowsXP)      }

     {******************************************************************}

     {******************************************************************}

 

unit DirectShow;

 

interface

 

{$ALIGN ON}

{$MINENUMSIZE 4}

//{$DEFINE WindowsXP}

 

{$IFDEF VER150}

{$WARN UNSAFE_CODE OFF}

{$WARN UNSAFE_TYPE OFF}

{$WARN UNSAFE_CAST OFF}

{$ENDIF}

 

uses

Windows,

ActiveX,

DirectDraw,

DirectSound,

DXCommon,

MMSystem,

SyncObjs,

comobj;

 

(*==========================================================================;

*

*  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.

*

File:       comlite.h

*

***************************************************************************)

 

function QzInitialize(pvReserved: Pointer): HResult; stdcall;

procedure QzUninitialize; stdcall;

procedure QzFreeUnusedLibraries; stdcall;

 

function QzGetMalloc(dwMemContext: Longint; out malloc: IMalloc): HResult; stdcall;

function QzTaskMemAlloc(cb: Longint): Pointer; stdcall;

function QzTaskMemRealloc(pv: Pointer; cb: Longint): Pointer; stdcall;

procedure QzTaskMemFree(pv: Pointer); stdcall;

function QzCreateFilterObject(const clsid: TCLSID; unkOuter: IUnknown;

dwClsContext: Longint; const iid: TIID; out pv): HResult; stdcall;

function QzCLSIDFromString(psz: POleStr; out clsid: TCLSID): HResult; stdcall;

function QzStringFromGUID2(const guid: TGUID; psz: POleStr; cbMax: Integer): Integer; stdcall;

 

{$IFDEF VER120}

type

  TOleEnum = integer;

{$ENDIF}

 

(*==========================================================================;

*

*  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.

*

File:       errors.h

*

***************************************************************************)

 

const

VFW_FIRST_CODE     = $200;

MAX_ERROR_TEXT_LEN = 160;

 

type

AMGetErrorTextProcA = function(hr: HRESULT; pbuffer: PChar; MaxLen: DWORD): BOOL; stdcall;

AMGetErrorTextProcW = function(hr: HRESULT; pbuffer: PWideChar; MaxLen: DWORD): BOOL; stdcall;

 

{$IFDEF UNICODE}

AMGetErrorTextProc  = AMGetErrorTextProcW;

{$ELSE}

AMGetErrorTextProc  = AMGetErrorTextProcA;

{$ENDIF}

 

function AMGetErrorTextA(hr: HRESULT; pbuffer: PChar; MaxLen: DWORD): DWORD; stdcall;

function AMGetErrorTextW(hr: HRESULT; pbuffer: PWideChar; MaxLen: DWORD): DWORD; stdcall;

function AMGetErrorText(hr: HRESULT; pbuffer: PChar; MaxLen: DWORD): DWORD; stdcall;

 

 

(*==========================================================================;

*

*  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.

*

File:       dv.h

*

***************************************************************************)

 

const

DV_DVSD_NTSC_FRAMESIZE  =      120000;

DV_DVSD_PAL_FRAMESIZE         =      144000;

 

DV_SMCHN       = $0000e000;

DV_AUDIOMODE   = $00000f00;

DV_AUDIOSMP    = $38000000;

 

DV_AUDIOQU     = $07000000;

DV_NTSCPAL         = $00200000;

DV_STYPE         = $001f0000;

 

//There are NTSC or PAL DV camcorders 

DV_NTSC         = 0;

DV_PAL         = 1;

//DV camcorder can output sd/hd/sl

DV_SD          = $00;

DV_HD          = $01;

DV_SL          = $02;

//user can choice 12 bits or 16 bits audio from DV camcorder

DV_CAP_AUD16Bits  =  $00;

DV_CAP_AUD12Bits  =  $01;

 

SIZE_DVINFO    = $20;

 

type

TDVAudInfo = record

   bAudStyle: array[0..1] of Byte;

   //LSB 6 bits for starting DIF sequence number

   //MSB 2 bits: 0 for mon. 1: stereo in one 5/6 DIF sequences, 2: stereo audio in both 5/6 DIF sequences

   //example: 0x00: mon, audio in first 5/6 DIF sequence

   //                 0x05: mon, audio in 2nd 5 DIF sequence

   //                 0x15: stereo, audio only in 2nd 5 DIF sequence

   //                 0x10: stereo, audio only in 1st 5/6 DIF sequence

   //                 0x20: stereo, left ch in 1st 5/6 DIF sequence, right ch in 2nd 5/6 DIF sequence

   //                 0x26: stereo, rightch in 1st 6 DIF sequence, left ch in 2nd 6 DIF sequence

   bAudQu: array[0..1] of Byte;            //qbits, only support 12, 16,

 

   bNumAudPin: Byte;                              //how many pin

   wAvgSamplesPerPinPerFrm: array[0..1] of WORD;  //samples size for one audio pin in one frame(which has 10 or 12 DIF sequence)

   wBlkMode: WORD;                                //45 for NTSC, 54 for PAL

   wDIFMode: WORD;                                //5  for NTSC, 6 for PAL

   wBlkDiv: WORD;                                 //15  for NTSC, 18 for PAL

end;

 

 

(*==========================================================================;

*

*  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.

*

File:       strmif.h

*

***************************************************************************)

const

IID_IPin                            : TGUID = '{56A86891-0AD4-11CE-B03A-0020AF0BA770}';

IID_IEnumPins                       : TGUID = '{56A86892-0AD4-11CE-B03A-0020AF0BA770}';

IID_IEnumMediaTypes                 : TGUID = '{89C31040-846B-11CE-97D3-00AA0055595A}';

IID_IFilterGraph                    : TGUID = '{56A8689F-0AD4-11CE-B03A-0020AF0BA770}';

IID_IEnumFilters                    : TGUID = '{56A86893-0AD4-11CE-B03A-0020AF0BA770}';

IID_IMediaFilter                    : TGUID = '{56A86899-0AD4-11CE-B03A-0020AF0BA770}';

IID_IBaseFilter                     : TGUID = '{56A86895-0AD4-11CE-B03A-0020AF0BA770}';

IID_IReferenceClock                 : TGUID = '{56A86897-0AD4-11CE-B03A-0020AF0BA770}';

IID_IReferenceClock2                : TGUID = '{36B73885-C2C8-11CF-8B46-00805F6CEF60}';

IID_IMediaSample                    : TGUID = '{56A8689A-0AD4-11CE-B03A-0020AF0BA770}';

IID_IMediaSample2                   : TGUID = '{36B73884-C2C8-11CF-8B46-00805F6CEF60}';

IID_IMemAllocator                   : TGUID = '{56A8689C-0AD4-11CE-B03A-0020AF0BA770}';

IID_IMemInputPin                    : TGUID = '{56A8689D-0AD4-11CE-B03A-0020AF0BA770}';

IID_IAMovieSetup                    : TGUID = '{A3D8CEC0-7E5A-11CF-BBC5-00805F6CEF20}'; // deprecated;

IID_IMediaSeeking                   : TGUID = '{36B73880-C2C8-11CF-8B46-00805F6CEF60}';

IID_IEnumRegFilters                 : TGUID = '{56A868A4-0AD4-11CE-B03A-0020AF0BA770}'; // deprecated;

IID_IFilterMapper                   : TGUID = '{56A868A3-0AD4-11CE-B03A-0020AF0BA770}'; // deprecated;

IID_IFilterMapper2                  : TGUID = '{B79BB0B0-33C1-11D1-ABE1-00A0C905F375}';

IID_IQualityControl                 : TGUID = '{56A868A5-0AD4-11CE-B03A-0020AF0BA770}';

IID_IOverlayNotify                  : TGUID = '{56A868A0-0AD4-11CE-B03A-0020AF0BA770}';

IID_IOverlay                        : TGUID = '{56A868A1-0AD4-11CE-B03A-0020AF0BA770}';

IID_IMediaEventSink                 : TGUID = '{56A868A2-0AD4-11CE-B03A-0020AF0BA770}';

IID_IFileSourceFilter               : TGUID = '{56A868A6-0AD4-11CE-B03A-0020AF0BA770}';

IID_IFileSinkFilter                 : TGUID = '{A2104830-7C70-11CF-8BCE-00AA00A3F1A6}';

IID_IFileSinkFilter2                : TGUID = '{00855B90-CE1B-11D0-BD4F-00A0C911CE86}';

IID_IFileAsyncIO                    : TGUID = '{56A868A7-0AD4-11CE-B03A-0020AF0BA770}';

IID_IGraphBuilder                   : TGUID = '{56A868A9-0AD4-11CE-B03A-0020AF0BA770}';

IID_ICaptureGraphBuilder            : TGUID = '{BF87B6E0-8C27-11D0-B3F0-00AA003761C5}'; // deprecated;

IID_IAMCopyCaptureFileProgress      : TGUID = '{670D1D20-A068-11D0-B3F0-00AA003761C5}';

IID_IFilterGraph2                   : TGUID = '{36B73882-C2C8-11CF-8B46-00805F6CEF60}';

IID_IStreamBuilder                  : TGUID = '{56A868BF-0AD4-11CE-B03A-0020AF0BA770}';

IID_IAsyncReader                    : TGUID = '{56A868AA-0AD4-11CE-B03A-0020AF0BA770}';

IID_IGraphVersion                   : TGUID = '{56A868AB-0AD4-11CE-B03A-0020AF0BA770}';

IID_IResourceConsumer               : TGUID = '{56A868AD-0AD4-11CE-B03A-0020AF0BA770}';

IID_IResourceManager                : TGUID = '{56A868AC-0AD4-11CE-B03A-0020AF0BA770}';

IID_IDistributorNotify              : TGUID = '{56A868AF-0AD4-11CE-B03A-0020AF0BA770}';

IID_IAMStreamControl                : TGUID = '{36b73881-c2c8-11cf-8b46-00805f6cef60}';

IID_ISeekingPassThru                : TGUID = '{36B73883-C2C8-11CF-8B46-00805F6CEF60}';

IID_IAMStreamConfig                 : TGUID = '{C6E13340-30AC-11d0-A18C-00A0C9118956}';

IID_IConfigInterleaving             : TGUID = '{BEE3D220-157B-11d0-BD23-00A0C911CE86}';

IID_IConfigAviMux                   : TGUID = '{5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6}';

IID_IAMVideoCompression             : TGUID = '{C6E13343-30AC-11d0-A18C-00A0C9118956}';

IID_IAMVfwCaptureDialogs            : TGUID = '{D8D715A0-6E5E-11D0-B3F0-00AA003761C5}';

IID_IAMVfwCompressDialogs           : TGUID = '{D8D715A3-6E5E-11D0-B3F0-00AA003761C5}';

IID_IAMDroppedFrames                : TGUID = '{C6E13344-30AC-11d0-A18C-00A0C9118956}';

IID_IAMAudioInputMixer              : TGUID = '{54C39221-8380-11d0-B3F0-00AA003761C5}';

IID_IAMAnalogVideoDecoder           : TGUID = '{C6E13350-30AC-11d0-A18C-00A0C9118956}';

IID_IAMVideoProcAmp                 : TGUID = '{C6E13360-30AC-11d0-A18C-00A0C9118956}';

IID_IAMCameraControl                : TGUID = '{C6E13370-30AC-11d0-A18C-00A0C9118956}';

IID_IAMCrossbar                     : TGUID = '{C6E13380-30AC-11d0-A18C-00A0C9118956}';

IID_IAMTuner                        : TGUID = '{211A8761-03AC-11d1-8D13-00AA00BD8339}';

IID_IAMTunerNotification            : TGUID = '{211A8760-03AC-11d1-8D13-00AA00BD8339}';

IID_IAMTVTuner                      : TGUID = '{211A8766-03AC-11d1-8D13-00AA00BD8339}';

IID_IBPCSatelliteTuner              : TGUID = '{211A8765-03AC-11d1-8D13-00AA00BD8339}';

IID_IAMTVAudio                      : TGUID = '{83EC1C30-23D1-11d1-99E6-00A0C9560266}';

IID_IAMTVAudioNotification          : TGUID = '{83EC1C33-23D1-11D1-99E6-00A0C9560266}';

IID_IAMAnalogVideoEncoder           : TGUID = '{C6E133B0-30AC-11d0-A18C-00A0C9118956}'; // deprecated;

IID_IMediaPropertyBag               : TGUID = '{6025A880-C0D5-11D0-BD4E-00A0C911CE86}';

IID_IPersistMediaPropertyBag        : TGUID = '{5738E040-B67F-11d0-BD4D-00A0C911CE86}';

IID_IAMPhysicalPinInfo              : TGUID = '{F938C991-3029-11CF-8C44-00AA006B6814}'; // deprecated;

IID_IAMExtDevice                    : TGUID = '{B5730A90-1A2C-11CF-8C23-00AA006B6814}';

IID_IAMExtTransport                 : TGUID = '{A03CD5F0-3045-11CF-8C44-00AA006B6814}';

IID_IAMTimecodeReader               : TGUID = '{9B496CE1-811B-11CF-8C77-00AA006B6814}';

IID_IAMTimecodeGenerator            : TGUID = '{9B496CE0-811B-11CF-8C77-00AA006B6814}';

IID_IAMTimecodeDisplay              : TGUID = '{9B496CE2-811B-11CF-8C77-00AA006B6814}';

IID_IAMDevMemoryAllocator           : TGUID = '{C6545BF0-E76B-11D0-BD52-00A0C911CE86}'; // deprecated;

IID_IAMDevMemoryControl             : TGUID = '{C6545BF1-E76B-11D0-BD52-00A0C911CE86}'; // deprecated;

IID_IAMStreamSelect                 : TGUID = '{C1960960-17F5-11D1-ABE1-00A0C905F375}';

IID_IAMovie                         : TGUID = '{359ACE10-7688-11CF-8B23-00805F6CEF60}';

IID_ICreateDevEnum                  : TGUID = '{29840822-5B84-11D0-BD3B-00A0C911CE86}';

IID_IDvdControl                     : TGUID = '{A70EFE61-E2A3-11D0-A9BE-00AA0061BE93}'; // deprecated;

IID_IDvdControl2                    : TGUID = '{33BC7430-EEC0-11D2-8201-00A0C9D74842}';

IID_IDvdInfo                        : TGUID = '{A70EFE60-E2A3-11D0-A9BE-00AA0061BE93}'; // deprecated;

IID_IDvdInfo2                       : TGUID = '{34151510-EEC0-11D2-8201-00A0C9D74842}';

IID_IDvdGraphBuilder                : TGUID = '{FCC152B6-F372-11d0-8E00-00C04FD7C08B}';

IID_IDvdState                       : TGUID = '{86303d6d-1c4a-4087-ab42-f711167048ef}';

IID_IDvdCmd                         : TGUID = '{5a4a97e4-94ee-4a55-9751-74b5643aa27d}';

IID_IVideoFrameStep                 : TGUID = '{e46a9787-2b71-444d-a4b5-1fab7b708d6a}';

IID_IFilterMapper3                  : TGUID = '{b79bb0b1-33c1-11d1-abe1-00a0c905f375}';

IID_IOverlayNotify2                 : TGUID = '{680EFA10-D535-11D1-87C8-00A0C9223196}';

IID_ICaptureGraphBuilder2           : TGUID = '{93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D}';

IID_IMemAllocatorCallbackTemp       : TGUID = '{379a0cf0-c1de-11d2-abf5-00a0c905f375}';

IID_IMemAllocatorNotifyCallbackTemp : TGUID = '{92980b30-c1de-11d2-abf5-00a0c905f375}';

IID_IAMVideoControl                 : TGUID = '{6a2e0670-28e4-11d0-a18c-00a0c9118956}';

IID_IKsPropertySet                  : TGUID = '{31EFAC30-515C-11d0-A9AA-00AA0061BE93}';

IID_IAMResourceControl              : TGUID = '{8389d2d0-77d7-11d1-abe6-00a0c905f375}';

IID_IAMClockAdjust                  : TGUID = '{4d5466b0-a49c-11d1-abe8-00a0c905f375}';

IID_IAMFilterMiscFlags              : TGUID = '{2dd74950-a890-11d1-abe8-00a0c905f375}';

IID_IDrawVideoImage                 : TGUID = '{48efb120-ab49-11d2-aed2-00a0c995e8d5}';

IID_IDecimateVideoImage             : TGUID = '{2e5ea3e0-e924-11d2-b6da-00a0c995e8df}';

IID_IAMVideoDecimationProperties    : TGUID = '{60d32930-13da-11d3-9ec6-c4fcaef5c7be}';

IID_IAMLatency                      : TGUID = '{62EA93BA-EC62-11d2-B770-00C04FB6BD3D}';

IID_IAMPushSource                   : TGUID = '{F185FE76-E64E-11d2-B76E-00C04FB6BD3D}';

IID_IAMDeviceRemoval                : TGUID = '{f90a6130-b658-11d2-ae49-0000f8754b99}';

IID_IDVEnc                          : TGUID = '{d18e17a0-aacb-11d0-afb0-00aa00b67a42}';

IID_IIPDVDec                        : TGUID = '{b8e8bd60-0bfe-11d0-af91-00aa00b67a42}';

IID_IDVRGB219                       : TGUID = '{58473A19-2BC8-4663-8012-25F81BABDDD1}'; // XP

IID_IDVSplitter                     : TGUID = '{92a3a302-da7c-4a1f-ba7e-1802bb5d2d02}';

IID_IAMAudioRendererStats           : TGUID = '{22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93}';

IID_IAMGraphStreams                 : TGUID = '{632105FA-072E-11d3-8AF9-00C04FB6BD3D}';

IID_IAMOverlayFX                    : TGUID = '{62fae250-7e65-4460-bfc9-6398b322073c}';

IID_IAMOpenProgress                 : TGUID = '{8E1C39A1-DE53-11cf-AA63-0080C744528D}';

IID_IMpeg2Demultiplexer             : TGUID = '{436eee9c-264f-4242-90e1-4e330c107512}';

IID_IEnumStreamIdMap                : TGUID = '{945C1566-6202-46fc-96C7-D87F289C6534}';

IID_IMPEG2StreamIdMap               : TGUID = '{D0E04C47-25B8-4369-925A-362A01D95444}';

IID_IRegisterServiceProvider        : TGUID = '{7B3A2F01-0751-48DD-B556-004785171C54}'; // XP

IID_IAMDecoderCaps                  : TGUID = '{c0dff467-d499-4986-972b-e1d9090fa941}'; // XP

IID_IAMClockSlave                   : TGUID = '{9FD52741-176D-4b36-8F51-CA8F933223BE}'; // XP

IID_IDDrawExclModeVideo             : TGUID = '{153ACC21-D83B-11d1-82BF-00A0C9696C8F}';

IID_IDDrawExclModeVideoCallback     : TGUID = '{913c24a0-20ab-11d2-9038-00a0c9697298}';

IID_IPinConnection                  : TGUID = '{4a9a62d3-27d4-403d-91e9-89f540e55534}';

IID_IPinFlowControl                 : TGUID = '{c56e9858-dbf3-4f6b-8119-384af2060deb}';

IID_IGraphConfig                    : TGUID = '{03A1EB8E-32BF-4245-8502-114D08A9CB88}';

IID_IGraphConfigCallback            : TGUID = '{ade0fd60-d19d-11d2-abf6-00a0c905f375}';

IID_IFilterChain                    : TGUID = '{DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29}';

 

IID_IVMRImagePresenter              : TGUID = '{CE704FE7-E71E-41fb-BAA2-C4403E1182F5}'; // XP

IID_IVMRSurfaceAllocator            : TGUID = '{31ce832e-4484-458b-8cca-f4d7e3db0b52}'; // XP

IID_IVMRSurfaceAllocatorNotify      : TGUID = '{aada05a8-5a4e-4729-af0b-cea27aed51e2}'; // XP

IID_IVMRWindowlessControl           : TGUID = '{0eb1088c-4dcd-46f0-878f-39dae86a51b7}'; // XP

IID_IVMRMixerControl                : TGUID = '{1c1a17b0-bed0-415d-974b-dc6696131599}'; // XP

IID_IVMRMonitorConfig               : TGUID = '{9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce}'; // XP

IID_IVMRFilterConfig                : TGUID = '{9e5530c5-7034-48b4-bb46-0b8a6efc8e36}'; // XP

IID_IVMRMixerBitmap                 : TGUID = '{1E673275-0257-40aa-AF20-7C608D4A0428}'; // XP

IID_IVMRImageCompositor             : TGUID = '{7a4fb5af-479f-4074-bb40-ce6722e43c82}'; // XP

IID_IVMRVideoStreamControl          : TGUID = '{058d1f11-2a54-4bef-bd54-df706626b727}'; // XP

IID_IVMRSurface                     : TGUID = '{a9849bbe-9ec8-4263-b764-62730f0d15d0}'; // XP

IID_IVPManager                      : TGUID = '{aac18c18-e186-46d2-825d-a1f8dc8e395a}'; // XP

IID_IVMRImagePresenterConfig        : TGUID = '{9f3a1c85-8555-49ba-935f-be5b5b29d178}'; // XP

IID_IVMRImagePresenterExclModeConfig: TGUID = '{e6f7ce40-4673-44f1-8f77-5499d68cb4ea}'; // XP

 

IID_IAMBufferNegotiation            : TGUID = '{56ED71A0-AF5F-11D0-B3F0-00AA003761C5}';

 

const

CHARS_IN_GUID   = 39;

 

MAX_PIN_NAME    = 128;

MAX_FILTER_NAME = 128;

 

type

TAM_Media_Type = record

   majortype            : TGUID;

   subtype              : TGUID;

   bFixedSizeSamples    : BOOL;

   bTemporalCompression : BOOL;

   lSampleSize          : ULONG;

   formattype           : TGUID;

   pUnk                 : IUnknown;

   cbFormat             : ULONG;

   pbFormat             : Pointer;

end;

PAM_Media_Type = ^TAM_Media_Type;

 

TPin_Direction = (

   PINDIR_INPUT,

   PINDIR_OUTPUT

);

 

TReference_Time = int64;

PReference_Time = ^TReference_Time;

 

TRefTime = double;

 

HSEMAPHORE = Longint;

 

PAllocator_Properties = ^TAllocator_Properties;

TAllocator_Properties = record

   cBuffers: Longint;

   cbBuffer: Longint;

   cbAlign: Longint;

   cbPrefix: Longint;

end;

 

IBaseFilter = interface;

 

TPin_Info = record

   pFilter: IBaseFilter;

   dir: TPin_Direction;

   achName: array[0..127] of WCHAR;

end;

 

IEnumMediaTypes = interface;

 

IPin = interface(IUnknown)

   ['{56A86891-0AD4-11CE-B03A-0020AF0BA770}']

   function Connect(pReceivePin: IPin; const pmt: PAM_Media_Type): HRESULT; stdcall;

   function ReceiveConnection(pConnector: IPin; const pmt: TAM_Media_Type): HRESULT; stdcall;

   function Disconnect: HRESULT; stdcall;

   function ConnectedTo(out pPin: IPin): HRESULT; stdcall;

   function ConnectionMediaType(out pmt: TAM_Media_Type): HRESULT; stdcall;

   function QueryPinInfo(out pInfo: TPin_Info): HRESULT; stdcall;

   function QueryDirection(out pPinDir: TPin_Direction): HRESULT; stdcall;

   function QueryId(out Id: LPWSTR): HRESULT; stdcall;

   function QueryAccept(const pmt: TAM_Media_Type): HRESULT; stdcall;

   function EnumMediaTypes(out ppEnum: IEnumMediaTypes): HRESULT; stdcall;

   function QueryInternalConnections(out apPin: IPin; var nPin: ULONG): HRESULT; stdcall;

   function EndOfStream: HRESULT; stdcall;

   function BeginFlush: HRESULT; stdcall;

   function EndFlush: HRESULT; stdcall;

   function NewSegment(tStart, tStop: TReference_Time; dRate: double): HRESULT; stdcall;

end;

 

IEnumPins = interface(IUnknown)

   ['{56A86892-0AD4-11CE-B03A-0020AF0BA770}']

   function Next(cPins: ULONG; out ppPins: IPin; pcFetched: PULONG): HRESULT; stdcall;

   function Skip(cPins: ULONG): HRESULT; stdcall;

   function Reset: HRESULT; stdcall;

   function Clone(out ppEnum: IEnumPins): HRESULT; stdcall;

end;

 

IEnumMediaTypes = interface(IUnknown)

   ['{89C31040-846B-11CE-97D3-00AA0055595A}']

   function Next(cMediaTypes: ULONG; out ppMediaTypes: PAM_Media_Type;

     pcFetched: PULONG): HRESULT; stdcall;

   function Skip(cMediaTypes: ULONG): HRESULT; stdcall;

   function Reset: HRESULT; stdcall;

   function Clone(out ppEnum: IEnumMediaTypes): HRESULT; stdcall;

end;

 

IEnumFilters = interface;

 

IFilterGraph = interface(IUnknown)

   ['{56A8689F-0AD4-11CE-B03A-0020AF0BA770}']

   function AddFilter(pFilter: IBaseFilter; pName: PWideChar): HRESULT; stdcall;

   function RemoveFilter(pFilter: IBaseFilter): HRESULT; stdcall;

   function EnumFilters(out ppEnum: IEnumFilters): HRESULT; stdcall;

   function FindFilterByName(pName: PWideChar; out ppFilter: IBaseFilter): HRESULT; stdcall;

   function ConnectDirect(ppinOut, ppinIn: IPin; pmt: PAM_Media_Type): HRESULT; stdcall;

   function Reconnect(ppin: IPin): HRESULT; stdcall;

   function Disconnect(ppin: IPin): HRESULT; stdcall;

   function SetDefaultSyncSource: HRESULT; stdcall;

end;

 

IEnumFilters = interface(IUnknown)

   ['{56A86893-0AD4-11CE-B03A-0020AF0BA770}']

   function Next(cFilters: ULONG; out ppFilter: IBaseFilter;

     pcFetched: PULONG): HRESULT; stdcall;

   function Skip(cFilters: ULONG): HRESULT; stdcall;

   function Reset: HRESULT; stdcall;

   function Clone(out ppEnum: IEnumFilters): HRESULT; stdcall;

end;

 

TFilter_State = (

   State_Stopped,

   State_Paused,

   State_Running

);

 

IReferenceClock = interface;

 

IMediaFilter = interface(IPersist)

   ['{56A86899-0AD4-11CE-B03A-0020AF0BA770}']

   function Stop: HRESULT; stdcall;

   function Pause: HRESULT; stdcall;

   function Run(tStart: TReference_Time): HRESULT; stdcall;

   function GetState(dwMilliSecsTimeout: DWORD; out State: TFilter_State): HRESULT; stdcall;

   function SetSyncSource(pClock: IReferenceClock): HRESULT; stdcall;

   function GetSyncSource(out pClock: IReferenceClock): HRESULT; stdcall;

end;

 

TFilterInfo = record

   achName: array[0..127] of WCHAR;

   pGraph: IFilterGraph;

end;

 

IBaseFilter = interface(IMediaFilter)

   ['{56A86895-0AD4-11CE-B03A-0020AF0BA770}']

   function EnumPins(out ppEnum: IEnumPins): HRESULT; stdcall;

   function FindPin(Id: PWideChar; out ppPin: IPin): HRESULT; stdcall;

   function QueryFilterInfo(out pInfo: TFilterInfo): HRESULT; stdcall;

   function JoinFilterGraph(pGraph: IFilterGraph; pName: PWideChar): HRESULT; stdcall;

   function QueryVendorInfo(out pVendorInfo: PWideChar): HRESULT; stdcall;

end;

 

IReferenceClock = interface(IUnknown)

   ['{56A86897-0AD4-11CE-B03A-0020AF0BA770}']

   function GetTime(out pTime: TReference_Time): HRESULT; stdcall;

   function AdviseTime(baseTime, streamTime: TReference_Time;

       hEvent: THandle; out pdwAdviseCookie: DWORD): HRESULT; stdcall;

   function AdvisePeriodic(startTime, periodTime: TReference_Time;

       hSemaphore: HSEMAPHORE; out pdwAdviseCookie: DWORD): HRESULT; stdcall;

   function Unadvise(dwAdviseCookie: DWORD): HRESULT; stdcall;

end;

 

IReferenceClock2 = interface(IReferenceClock)

   ['{36B73885-C2C8-11CF-8B46-00805F6CEF60}']

end;

//lookat

IMediaSample = interface(IUnknown)

   ['{56A8689A-0AD4-11CE-B03A-0020AF0BA770}']

   function GetPointer(out ppBuffer: PBYTE): HRESULT; stdcall;

   function GetSize: Longint; stdcall;

   function GetTime(out pTimeStart, pTimeEnd: TReference_Time): HRESULT; stdcall;

   function SetTime(pTimeStart, pTimeEnd: PReference_Time): HRESULT; stdcall;

   function IsSyncPoint: HRESULT; stdcall;

   function SetSyncPoint(bIsSyncPoint: BOOL): HRESULT; stdcall;

   function IsPreroll: HRESULT; stdcall;

   function SetPreroll(bIsPreroll: BOOL): HRESULT; stdcall;

   function GetActualDataLength: Longint; stdcall;

   function SetActualDataLength(lLen: Longint): HRESULT; stdcall;

   function GetMediaType(out ppMediaType: PAM_Media_Type): HRESULT; stdcall;

   function SetMediaType(var pMediaType: TAM_Media_Type): HRESULT; stdcall;

   function IsDiscontinuity: HRESULT; stdcall;

   function SetDiscontinuity(bDiscontinuity: BOOL): HRESULT; stdcall;

   function GetMediaTime(out pTimeStart, pTimeEnd: int64): HRESULT; stdcall;

   function SetMediaTime(pTimeStart, pTimeEnd: Pint64): HRESULT; stdcall;

end;

 

const

AM_SAMPLE_SPLICEPOINT         = $1;

AM_SAMPLE_PREROLL             = $2;

AM_SAMPLE_DATADISCONTINUITY   = $4;

AM_SAMPLE_TYPECHANGED         = $8;

AM_SAMPLE_TIMEVALID           = $10;

AM_SAMPLE_TIMEDISCONTINUITY   = $40;

AM_SAMPLE_FLUSH_ON_PAUSE      = $80;

AM_SAMPLE_STOPVALID           = $100;

AM_SAMPLE_ENDOFSTREAM         = $200;

AM_STREAM_MEDIA               = 0;

AM_STREAM_CONTROL             = 1;

 

type

PAM_Sample2_Properties = ^TAM_Sample2_Properties;

TAM_Sample2_Properties = record

   cbData: DWORD;

   dwTypeSpecificFlags: DWORD;

   dwSampleFlags: DWORD;

   lActual: Longint;

   tStart: TReference_Time;

   tStop: TReference_Time;

   dwStreamId: DWORD;

   pMediaType: PAM_Media_Type;

   pbBuffer: Pointer;

   cbBuffer: Longint;

end;

 

type

IMediaSample2 = interface(IMediaSample)

   ['{36B73884-C2C8-11CF-8B46-00805F6CEF60}']

   function GetProperties(cbProperties: DWORD; out pbProperties): HRESULT; stdcall;

   function SetProperties(cbProperties: DWORD; const pbProperties): HRESULT; stdcall;

end;

 

const

AM_GBF_PREVFRAMESKIPPED = 1;

AM_GBF_NOTASYNCPOINT    = 2;

AM_GBF_NOWAIT           = 4;

AM_GBF_NODDSURFACELOCK  = 8;

 

type

//lookat

IMemAllocator = interface(IUnknown)

   ['{56A8689C-0AD4-11CE-B03A-0020AF0BA770}']

   function SetProperties(var pRequest: TAllocator_Properties;

       out pActual: TAllocator_Properties): HRESULT; stdcall;

   function GetProperties(out pProps: TAllocator_Properties): HRESULT; stdcall;

   function Commit: HRESULT; stdcall;

   function Decommit: HRESULT; stdcall;

   function GetBuffer(out ppBuffer: IMediaSample;

       pStartTime, pEndTime: PReference_Time; dwFlags: DWORD): HRESULT; stdcall;

   function ReleaseBuffer(pBuffer: IMediaSample): HRESULT; stdcall;

end;

 

IMemAllocatorNotifyCallbackTemp = interface(IUnknown)

   ['{92980b30-c1de-11d2-abf5-00a0c905f375}']

   function NotifyRelease: HRESULT; stdcall;

end;

 

IMemAllocatorCallbackTemp = interface(IMemAllocator)

   ['{379a0cf0-c1de-11d2-abf5-00a0c905f375}']

   function SetNotify(pNotify: IMemAllocatorNotifyCallbackTemp): HRESULT; stdcall;

   function GetFreeCount(out plBuffersFree: LongInt): HRESULT; stdcall;

end;

 

IMemInputPin = interface(IUnknown)

   ['{56A8689D-0AD4-11CE-B03A-0020AF0BA770}']

   function GetAllocator(out ppAllocator: IMemAllocator): HRESULT; stdcall;

   function NotifyAllocator(pAllocator: IMemAllocator; bReadOnly: BOOL): HRESULT; stdcall;

   function GetAllocatorRequirements(out pProps: TAllocator_Properties): HRESULT; stdcall;

   function Receive(pSample: IMediaSample): HRESULT; stdcall;

   function ReceiveMultiple(var pSamples: IMediaSample; nSamples: Longint;

       out nSamplesProcessed: Longint): HRESULT; stdcall;

   function ReceiveCanBlock: HRESULT; stdcall;

end;

 

//Deprecated Interface

IAMovieSetup = interface(IUnknown)

   ['{A3D8CEC0-7E5A-11CF-BBC5-00805F6CEF20}']

   function Register: HRESULT; stdcall;

   function Unregister: HRESULT; stdcall;

end;

 

const

AM_SEEKING_NoPositioning          = 0;

AM_SEEKING_AbsolutePositioning    = $1;

AM_SEEKING_RelativePositioning    = $2;

AM_SEEKING_IncrementalPositioning = $3;

AM_SEEKING_PositioningBitsMask    = $3;

AM_SEEKING_SeekToKeyFrame         = $4;

AM_SEEKING_ReturnTime             = $8;

AM_SEEKING_Segment                = $10;

AM_SEEKING_NoFlush                = $20;

 

AM_SEEKING_CanSeekAbsolute        = $1;

AM_SEEKING_CanSeekForwards        = $2;

AM_SEEKING_CanSeekBackwards       = $4;

AM_SEEKING_CanGetCurrentPos       = $8;

AM_SEEKING_CanGetStopPos          = $10;

AM_SEEKING_CanGetDuration         = $20;

AM_SEEKING_CanPlayBackwards       = $40;

AM_SEEKING_CanDoSegments          = $80;

AM_SEEKING_Source                 = $100;

 

//lookat 

type

IMediaSeeking = interface(IUnknown)

   ['{36B73880-C2C8-11CF-8B46-00805F6CEF60}']

   function GetCapabilities(out pCapabilities: DWORD): HRESULT; stdcall;

   function CheckCapabilities(var pCapabilities: DWORD): HRESULT; stdcall;

   function IsFormatSupported(const pFormat: TGUID): HRESULT; stdcall;

   function QueryPreferredFormat(out pFormat: TGUID): HRESULT; stdcall;

   function GetTimeFormat(out pFormat: TGUID): HRESULT; stdcall;

   function IsUsingTimeFormat(const pFormat: TGUID): HRESULT; stdcall;

   function SetTimeFormat(const pFormat: TGUID): HRESULT; stdcall;

   function GetDuration(out pDuration: int64): HRESULT; stdcall;

   function GetStopPosition(out pStop: int64): HRESULT; stdcall;

   function GetCurrentPosition(out pCurrent: int64): HRESULT; stdcall;

   function ConvertTimeFormat(out pTarget: int64; pTargetFormat: PGUID;

              Source: int64; pSourceFormat: PGUID): HRESULT; stdcall;

   function SetPositions(var pCurrent: int64; dwCurrentFlags: DWORD;

              var pStop: int64; dwStopFlags: DWORD): HRESULT; stdcall;

   function GetPositions(out pCurrent, pStop: int64): HRESULT; stdcall;

   function GetAvailable(out pEarliest, pLatest: int64): HRESULT; stdcall;

   function SetRate(dRate: double): HRESULT; stdcall;

   function GetRate(out pdRate: double): HRESULT; stdcall;

   function GetPreroll(out pllPreroll: int64): HRESULT; stdcall;

end;

 

const

AM_MEDIAEVENT_NONOTIFY = $01;

 

type

TRegFilter = record

   Clsid: TGUID;

   Name: LPWSTR;

end;

PRegFilter = ^TRegFilter;

 

//Deprecated Interface

IEnumRegFilters = interface(IUnknown)

   ['{56A868A4-0AD4-11CE-B03A-0020AF0BA770}']

   function Next(cFilters: ULONG; out apRegFilter: TRegFilter;

       out pcFetched: ULONG): HRESULT; stdcall;

   function Skip(cFilters: ULONG): HRESULT; stdcall;

   function Reset: HRESULT; stdcall;

   function Clone(out ppEnum: IEnumRegFilters): HRESULT; stdcall;

end;

 

const

MERIT_PREFERRED       = $800000;

MERIT_NORMAL          = $600000;

MERIT_UNLIKELY        = $400000;

MERIT_DO_NOT_USE      = $200000;

MERIT_SW_COMPRESSOR   = $100000;

MERIT_HW_COMPRESSOR   = $100050;

 

type

 

//Deprecated Interface

IFilterMapper = interface(IUnknown)

   ['{56A868A3-0AD4-11CE-B03A-0020AF0BA770}']

   function RegisterFilter(clsid: TGUID; Name: LPCWSTR; dwMerit: DWORD):HRESULT; stdcall;

   function RegisterFilterInstance(clsid: TGUID; Name: LPCWSTR; out MRId: TGUID): HRESULT; stdcall;

   function RegisterPin(Filter: TGUID; Name: LPCWSTR;

     bRendered, bOutput, bZero, bMany: BOOL; ConnectsToFilter: TGUID;

     ConnectsToPin: PWideChar): HRESULT; stdcall;

   function RegisterPinType(clsFilter: TGUID; strName: LPCWSTR;

     clsMajorType, clsSubType: TGUID): HRESULT; stdcall;

   function UnregisterFilter(Filter: TGUID): HRESULT; stdcall;

   function UnregisterFilterInstance(MRId: TGUID): HRESULT; stdcall;

   function UnregisterPin(Filter: TGUID; Name: LPCWSTR): HRESULT; stdcall;

   function EnumMatchingFilters(out ppEnum: IEnumRegFilters; dwMerit: DWORD;

     bInputNeeded: BOOL; const clsInMaj, clsInSub: TGUID;

     bRender, bOututNeeded: BOOL; const clsOutMaj, clsOutSub: TGUID): HRESULT; stdcall;

end;

 

PRegPinTypes = ^TRegPinTypes;

TRegPinTypes = record

   clsMajorType: PGUID;

   clsMinorType: PGUID;

end;

 

PRegFilterPins = ^TRegFilterPins;

TRegFilterPins = record

   strName: PWideChar;

   bRendered: BOOL;

   bOutput: BOOL;

   bZero: BOOL;

   bMany: BOOL;

   oFilter: PGUID;

   strConnectsToPin: PWideChar;

   nMediaTypes: LongWord;

   lpMediaType: PRegPinTypes;

end;

 

PRegPinMedium = ^TRegPinMedium;

TRegPinMedium = record

   clsMedium: TGUID;

   dw1: DWORD;

   dw2: DWORD;

end;

 

const

REG_PINFLAG_B_ZERO     = $1;

REG_PINFLAG_B_RENDERER = $2;

REG_PINFLAG_B_MANY     = $4;

REG_PINFLAG_B_OUTPUT   = $8;

 

type

PRegFilterPins2 = ^TRegFilterPins2;

TRegFilterPins2 = record

   dwFlags: DWORD;

   cInstances: UINT;

   nMediaTypes: UINT;

   lpMediaType: PRegPinTypes;

   nMediums: UINT;

   lpMedium: PRegPinMedium;

   clsPinCategory: PGUID;

end;

 

TRegFilter2 = record

   dwVersion: DWORD;

   dwMerit: DWORD;

   case Integer of

     0: (

       cPins: ULONG;

       rgPins: PRegFilterPins;

     );

     1: (

       cPins2: ULONG;

       rgPins2: PRegFilterPins2;

     );

end;

//lookat

IFilterMapper2 = interface(IUnknown)

   ['{B79BB0B0-33C1-11D1-ABE1-00A0C905F375}']

   function CreateCategory(const clsidCategory: TGUID; dwCategoryMerit: DWORD;

       Description: PWideChar): HRESULT; stdcall;

   function UnregisterFilter(const pclsidCategory: TGUID;

       szInstance: PWideChar; const Filter: TGUID): HRESULT; stdcall;

   function RegisterFilter(const clsidFilter: TGUID; Name: PWideChar;

       ppMoniker: IMoniker; pclsidCategory: PGUID;

       szInstance: PWideChar; const prf2: TRegFilter2): HRESULT; stdcall;

   function EnumMatchingFilters(out ppEnum: IEnumMoniker; dwFlags: DWORD; bExactMatch: BOOL;

       dwMerit: DWORD; bInputNeeded: BOOL; cInputTypes: DWORD; pInputTypes: PGUID;

       pMedIn: PREGPINMEDIUM; pPinCategoryIn: PGUID; bRender, bOutputNeeded: BOOL;

       cOutputTypes: DWORD; pOutputTypes: PGUID; pMedOut: PRegPinMedium;

       pPinCategoryOut: PGUID): HRESULT; stdcall;

end;

 

TQualityMessageType = (

   Famine,

   Flood

);

 

TQuality = packed record

   Typ: TQualityMessageType;

   Proportion: Longint;

   Late: TReference_Time;

   TimeStamp: TReference_Time;

end;

 

IQualityControl = interface(IUnknown)

   ['{56A868A5-0AD4-11CE-B03A-0020AF0BA770}']

   function Notify(pSelf: IBaseFilter; q: TQuality): HRESULT; stdcall;

   function SetSink(piqc: IQualityControl): HRESULT; stdcall;

end;

 

const

CK_NOCOLORKEY = $0;

CK_INDEX      = $1;

CK_RGB        = $2;

 

type

TColorKey = record

   KeyType: DWORD;

   PaletteIndex: DWORD;

   LowColorValue: COLORREF;

   HighColorValue: COLORREF;

end;

 

const

ADVISE_NONE       = 0;

ADVISE_CLIPPING   = $1;

ADVISE_PALETTE    = $2;

ADVISE_COLORKEY   = $4;

ADVISE_POSITION   = $8;

 

ADVISE_ALL = ADVISE_CLIPPING or ADVISE_PALETTE or ADVISE_COLORKEY or ADVISE_POSITION;

 

type

IOverlayNotify = interface(IUnknown)

   ['{56A868A0-0AD4-11CE-B03A-0020AF0BA770}']

   function OnPaletteChange(dwColors: DWORD; const pPalette: PPALETTEENTRY): HRESULT; stdcall;

   function OnClipChange(const pSourceRect, pDestinationRect: TRect;

       const pRgnData: TRgnData): HRESULT; stdcall;

   function OnColorKeyChange(const pColorKey: TColorKey): HRESULT; stdcall;

   function OnPositionChange(const pSourceRect, pDestinationRect: TRect): HRESULT; stdcall;

end;

 

IOverlayNotify2 = interface(IOverlayNotify)

   ['{680EFA10-D535-11D1-87C8-00A0C9223196}']

   function OnDisplayChange(var hMonitor: HMONITOR ): HRESULT; stdcall;

end;

 

IOverlay = interface(IUnknown)

   ['{56A868A1-0AD4-11CE-B03A-0020AF0BA770}']

   function GetPalette(out pdwColors: DWORD; out ppPalette: PPALETTEENTRY): HRESULT; stdcall;

   function SetPalette(dwColors: DWORD; var pPalette: PaletteEntry): HRESULT; stdcall;

   function GetDefaultColorKey(out pColorKey: TColorKey): HRESULT; stdcall;

   function GetColorKey(out pColorKey: TColorKey): HRESULT; stdcall;

   function SetColorKey(var pColorKey: TColorKey): HRESULT; stdcall;

   function GetWindowHandle(out pHwnd: HWND): HRESULT; stdcall;

   function GetClipList(out pSourceRect, pDestinationRect: TRect;

       out ppRgnData: PRgnData): HRESULT; stdcall;

   function GetVideoPosition(out pSourceRect, pDestinationRect: TRect): HRESULT; stdcall;

   function Advise(pOverlayNotify: IOverlayNotify; dwInterests: DWORD): HRESULT; stdcall;

   function Unadvise: HRESULT; stdcall;

end;

 

IMediaEventSink = interface(IUnknown)

   ['{56A868A2-0AD4-11CE-B03A-0020AF0BA770}']

   function Notify(EventCode, EventParam1, EventParam2: Longint): HRESULT; stdcall;

end;

 

//lookat

IFileSourceFilter = interface(IUnknown)

   ['{56A868A6-0AD4-11CE-B03A-0020AF0BA770}']

   function Load(pszFileName: PWCHAR; const pmt: PAM_Media_Type): HRESULT; stdcall;

   function GetCurFile(out ppszFileName: PWideChar; pmt: PAM_Media_Type): HRESULT; stdcall;

end;

 

IFileSinkFilter = interface(IUnknown)

   ['{A2104830-7C70-11CF-8BCE-00AA00A3F1A6}']

   function SetFileName(pszFileName: PWideChar; pmt: PAM_Media_Type): HRESULT; stdcall;

   function GetCurFile(out ppszFileName: PWideChar; pmt: PAM_Media_Type): HRESULT; stdcall;

end;

 

IFileSinkFilter2 = interface(IFileSinkFilter)

   ['{00855B90-CE1B-11D0-BD4F-00A0C911CE86}']

   function SetMode(dwFlags: DWORD): HRESULT; stdcall;

   function GetMode(out pdwFlags: DWORD): HRESULT; stdcall;

end;

 

TAM_FileSink_Flags = (

   AM_FILE_INVALID_0,

   AM_FILE_OVERWRITE

);

 

PAsyncIOReq = ^TAsyncIOReq;

TAsyncIOReq = record

   engine: array[0..3] of DWORD;

   lpv: Pointer;

   cb: DWORD;

   dwError: DWORD;

   cbDone: DWORD;

   liPos: TLargeInteger;

   hEvent: DWORD;

   dwUser: DWORD;

end;

 

//old interface

IFileAsyncIO = interface(IUnknown)

   ['{56A868A7-0AD4-11CE-B03A-0020AF0BA770}']

   function QueryAlignment(out pdwAlign: DWORD): HRESULT; stdcall;

   function Read(const pReq: TAsyncIOReq): HRESULT; stdcall;

   function Write(const pReq: TAsyncIOReq): HRESULT; stdcall;

   function WaitForNext(out ppReq: PAsyncIOReq;

       dwTimeout: DWORD): HRESULT; stdcall;

   function WaitForSpecific(out pReq: TAsyncIOReq;

       dwTimeout: DWORD): HRESULT; stdcall;

   function DiscardPending: HRESULT; stdcall;

   function Flush: HRESULT; stdcall;

end;

 

//lookat

IGraphBuilder = interface(IFilterGraph)

   ['{56A868A9-0AD4-11CE-B03A-0020AF0BA770}']

   function Connect(ppinOut, ppinIn: IPin): HRESULT; stdcall;

   function Render(ppinOut: IPin): HRESULT; stdcall;

   function RenderFile(lpcwstrFile, lpcwstrPlayList: PWideChar): HRESULT; stdcall;

   function AddSourceFilter(lpcwstrFileName, lpcwstrFilterName: LPCWSTR;

       out ppFilter: IBaseFilter): HRESULT; stdcall;

   function SetLogFile(hFile: THandle): HRESULT; stdcall;

   function Abort: HRESULT; stdcall;

   function ShouldOperationContinue: HRESULT; stdcall;

end;

 

IAMCopyCaptureFileProgress = interface;

 

//lookat

//Deprecated Interface

ICaptureGraphBuilder = interface(IUnknown)

   ['{BF87B6E0-8C27-11D0-B3F0-00AA003761C5}']

   function SetFiltergraph(pfg: IGraphBuilder): HRESULT; stdcall;

   function GetFiltergraph(out ppfg: IGraphBuilder): HRESULT; stdcall;

   function SetOutputFileName(const pType: TGUID; lpstrFile: PWCHAR;

       out ppf: IBaseFilter; out ppSink: IFileSinkFilter): HRESULT; stdcall;

   function FindInterface(pCategory: PGUID; pf: IBaseFilter;

       const riid: TGUID; out ppint): HRESULT; stdcall;

   function RenderStream(pCategory: PGUID; pSource: IUnknown;

       pfCompressor, pfRenderer: IBaseFilter): HRESULT; stdcall;

   function ControlStream(pCategory: PGUID; pFilter: IBaseFilter;

       pstart, pstop: PREFERENCE_TIME; wStartCookie, wStopCookie: WORD): HRESULT; stdcall;

   function AllocCapFile(lpstr: PWCHAR; dwlSize: int64): HRESULT; stdcall;

   function CopyCaptureFile(lpwstrOld, lpwstrNew: PWCHAR; fAllowEscAbort: Integer;

       pCallback: IAMCopyCaptureFileProgress): HRESULT; stdcall;

end;

//lookat

ICaptureGraphBuilder2 = interface(IUnknown)

   ['{93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D}']

   function SetFiltergraph(pfg: IGraphBuilder): HRESULT; stdcall;

   function GetFiltergraph(out ppfg: IGraphBuilder): HRESULT; stdcall;

   function SetOutputFileName(const pType: TGUID; lpstrFile: PWCHAR; out ppf: IBaseFilter; out ppSink: IFileSinkFilter): HRESULT; stdcall;

   function FindInterface(pCategory, pType: PGUID; pf: IBaseFilter; const riid: TGUID; out ppint): HRESULT; stdcall;

   function RenderStream(pCategory, pType: PGUID; pSource: IUnknown; pfCompressor, pfRenderer: IBaseFilter): HRESULT; stdcall;

   function ControlStream(pCategory, pType: PGUID; pFilter: IBaseFilter; pstart, pstop: PREFERENCE_TIME; wStartCookie, wStopCookie: WORD ): HRESULT; stdcall;

   function AllocCapFile(lpstr: PWCHAR; dwlSize: int64): HRESULT; stdcall;

   function CopyCaptureFile(lpwstrOld, lpwstrNew: PWCHAR; fAllowEscAbort: Integer; pCallback: IAMCopyCaptureFileProgress): HRESULT; stdcall;

   function FindPin(pSource: IUnknown; pindir: TPIN_DIRECTION; const pCategory, pType: TGUID; fUnconnected: BOOL; num: integer; out ppPin: IPin): HRESULT; stdcall;

end;

 

IAMCopyCaptureFileProgress = interface(IUnknown)

   ['{670D1D20-A068-11D0-B3F0-00AA003761C5}']

   function Progress(iProgress: Integer): HRESULT; stdcall;

end;

 

const

AM_RENDEREX_RENDERTOEXISTINGRENDERERS = $01;

 

type

//lookat

IFilterGraph2 = interface(IGraphBuilder)

   ['{36B73882-C2C8-11CF-8B46-00805F6CEF60}']

   function AddSourceFilterForMoniker(pMoniker: IMoniker; pCtx: IBindCtx;

       lpcwstrFilterName: LPCWSTR; out ppFilter: IBaseFilter): HRESULT; stdcall;

   function ReconnectEx(ppin: IPin; pmt: PAM_Media_Type): HRESULT; stdcall;

   // Render a pin without adding any new renderers (pvContext = nil)

   // not in the documentation ??

   function RenderEx(pPinOut: IPin; dwFlags: DWORD; pvContext: PDWORD): HRESULT; stdcall;

end;

 

IStreamBuilder = interface(IUnknown)

   ['{56A868BF-0AD4-11CE-B03A-0020AF0BA770}']

   function Render(ppinOut: IPin; pGraph: IGraphBuilder): HRESULT; stdcall;

   function Backout(ppinOut: IPin; pGraph: IGraphBuilder): HRESULT; stdcall;

end;

 

IAsyncReader = interface(IUnknown)

   ['{56A868AA-0AD4-11CE-B03A-0020AF0BA770}']

   function RequestAllocator(pPreferred: IMemAllocator;

       const pProps: TAllocator_Properties; out ppActual: IMemAllocator): HRESULT; stdcall;

   function Request(pSample: IMediaSample; dwUser: DWORD): HRESULT; stdcall;

   function WaitForNext(dwTimeout: DWORD; out ppSample: IMediaSample;

       out pdwUser: DWORD): HRESULT; stdcall;

   function SyncReadAligned(pSample: IMediaSample): HRESULT; stdcall;

   function SyncRead(llPosition: int64; lLength: Longint; pBuffer: Pbyte): HRESULT; stdcall;

   function Length(out pTotal, pAvailable: int64): HRESULT; stdcall;

   function BeginFlush: HRESULT; stdcall;

   function EndFlush: HRESULT; stdcall;

end;

 

IGraphVersion = interface(IUnknown)

   ['{56A868AB-0AD4-11CE-B03A-0020AF0BA770}']

   function QueryVersion(var pVersion: Longint): HRESULT; stdcall;

end;

 

IResourceConsumer = interface(IUnknown)

   ['{56A868AD-0AD4-11CE-B03A-0020AF0BA770}']

   function AcquireResource(idResource: Longint): HRESULT; stdcall;

   function ReleaseResource(idResource: Longint): HRESULT; stdcall;

end;

 

IResourceManager = interface(IUnknown)

   ['{56A868AC-0AD4-11CE-B03A-0020AF0BA770}']

   function Register(pName: LPCWSTR; cResource: Longint;

       out plToken: Longint): HRESULT; stdcall;

   function RegisterGroup(pName: LPCWSTR; cResource: Longint;

       palTokens: PLongint; out plToken: Longint): HRESULT; stdcall;

   function RequestResource(idResource: Longint; pFocusObject: IUnknown;

       pConsumer: IResourceConsumer): HRESULT; stdcall;

   function NotifyAcquire(idResource: Longint; pConsumer: IResourceConsumer;

       hr: HRESULT): HRESULT; stdcall;

   function NotifyRelease(idResource: Longint; pConsumer: IResourceConsumer;

       bStillWant: BOOL): HRESULT; stdcall;

   function CancelRequest(idResource: Longint; pConsumer: IResourceConsumer): HRESULT; stdcall;

   function SetFocus(pFocusObject: IUnknown): HRESULT; stdcall;

   function ReleaseFocus(pFocusObject: IUnknown): HRESULT; stdcall;

end;

 

IDistributorNotify = interface(IUnknown)

   ['{56A868AF-0AD4-11CE-B03A-0020AF0BA770}']

   function Stop: HRESULT; stdcall;

   function Pause: HRESULT; stdcall;

   function Run(tStart: TReference_Time): HRESULT; stdcall;

   function SetSyncSource(pClock: IReferenceClock): HRESULT; stdcall;

   function NotifyGraphChange: HRESULT; stdcall;

end;

 

const

AM_STREAM_INFO_START_DEFINED   = $1;

AM_STREAM_INFO_STOP_DEFINED    = $2;

AM_STREAM_INFO_DISCARDING      = $4;

AM_STREAM_INFO_STOP_SEND_EXTRA = $10;

 

type

TAM_Stream_Info = record

   tStart: TReference_Time;

   tStop: TReference_Time;

   dwStartCookie: DWORD;

   dwStopCookie: DWORD;

   dwFlags: DWORD;

end;

 

IAMStreamControl = interface(IUnknown)

   ['{36b73881-c2c8-11cf-8b46-00805f6cef60}']

   function StartAt(ptStart: PReference_Time; dwCookie: DWORD): HRESULT; stdcall;

   function StopAt(ptStop: PReference_Time; bSendExtra: BOOL;

       dwCookie: DWORD): HRESULT; stdcall;

   function GetInfo(out pInfo: TAM_Stream_Info): HRESULT; stdcall;

end;

 

ISeekingPassThru = interface(IUnknown)

   ['{36B73883-C2C8-11CF-8B46-00805F6CEF60}']

   function Init(bSupportRendering: BOOL; pPin: IPin): HRESULT; stdcall;

end;

 

TVideo_Stream_Config_Caps = record

   guid: TGUID;

   VideoStandard: ULONG;

   InputSize: TSize;

   MinCroppingSize: TSize;

   MaxCroppingSize: TSize;

   CropGranularityX: Integer;

   CropGranularityY: Integer;

   CropAlignX: Integer;

   CropAlignY: Integer;

   MinOutputSize: TSize;

   MaxOutputSize: TSize;

   OutputGranularityX: Integer;

   OutputGranularityY: Integer;

   StretchTapsX: Integer;

   StretchTapsY: Integer;

   ShrinkTapsX: Integer;

   ShrinkTapsY: Integer;

   MinFrameInterval: Int64;

   MaxFrameInterval: Int64;

   MinBitsPerSecond: Longint;

   MaxBitsPerSecond: Longint;

end;

 

TAudio_Stream_Config_Caps = record

   guid: TGUID;

   MinimumChannels: ULONG;

   MaximumChannels: ULONG;

   ChannelsGranularity: ULONG;

   MinimumBitsPerSample: ULONG;

   MaximumBitsPerSample: ULONG;

   BitsPerSampleGranularity: ULONG;

   MinimumSampleFrequency: ULONG;

   MaximumSampleFrequency: ULONG;

   SampleFrequencyGranularity: ULONG;

end;

 

IAMStreamConfig = interface(IUnknown)

   ['{C6E13340-30AC-11d0-A18C-00A0C9118956}']

   function SetFormat(const pmt: TAM_Media_Type): HRESULT; stdcall;

   function GetFormat(out ppmt: PAM_Media_Type): HRESULT; stdcall;

   function GetNumberOfCapabilities(out piCount, piSize: Integer): HRESULT; stdcall;

   function GetStreamCaps(iIndex: Integer; out ppmt: PAM_Media_Type;

     out pSCC): HRESULT; stdcall;

end;

 

TInterleavingMode = (

   INTERLEAVE_NONE,

   INTERLEAVE_CAPTURE,

   INTERLEAVE_FULL,

   INTERLEAVE_NONE_BUFFERED

);

 

IConfigInterleaving = interface(IUnknown)

   ['{BEE3D220-157B-11d0-BD23-00A0C911CE86}']

   function put_Mode(mode: TInterleavingMode): HRESULT; stdcall;

   function get_Mode(out pMode: TInterleavingMode): HRESULT; stdcall;

   function put_Interleaving(prtInterleave, prtPreroll: PReference_Time): HRESULT; stdcall;

   function get_Interleaving(out prtInterleave, prtPreroll: TReference_Time): HRESULT; stdcall;

end;

 

IConfigAviMux = interface(IUnknown)

   ['{5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6}']

   function SetMasterStream(iStream: Longint): HRESULT; stdcall;

   function GetMasterStream(out pStream: Longint): HRESULT; stdcall;

   function SetOutputCompatibilityIndex(fOldIndex: BOOL): HRESULT; stdcall;

   function GetOutputCompatibilityIndex(out pfOldIndex: BOOL): HRESULT; stdcall;

end;

 

const

CompressionCaps_CanQuality    = $1;

CompressionCaps_CanCrunch     = $2;

CompressionCaps_CanKeyFrame   = $4;

CompressionCaps_CanBFrame     = $8;

CompressionCaps_CanWindow     = $10;

 

type

IAMVideoCompression = interface(IUnknown)

   ['{C6E13343-30AC-11d0-A18C-00A0C9118956}']

   function put_KeyFrameRate(KeyFrameRate: Longint): HRESULT; stdcall;

   function get_KeyFrameRate(out pKeyFrameRate: Longint): HRESULT; stdcall;

   function put_PFramesPerKeyFrame(PFramesPerKeyFrame: Longint): HRESULT; stdcall;

   function get_PFramesPerKeyFrame(out pPFramesPerKeyFrame: Longint): HRESULT; stdcall;

   function put_Quality(Quality: double): HRESULT; stdcall;

   function get_Quality(out pQuality: double): HRESULT; stdcall;

   function put_WindowSize(WindowSize: int64): HRESULT; stdcall;

   function get_WindowSize(out pWindowSize: int64): HRESULT; stdcall;

   function GetInfo(pszVersion: PWideChar; var pcbVersion: Integer;

       pszDescription: PWideChar; var pcbDescription: Integer;

       out pDefaultKeyFrameRate, pDefaultPFramesPerKey: Longint;

       out pDefaultQuality: double; out pCapabilities: Longint): HRESULT; stdcall;

   function OverrideKeyFrame(FrameNumber: Longint): HRESULT; stdcall;

   function OverrideFrameSize(FrameNumber, Size: Longint): HRESULT; stdcall;

end;

 

const

VfwCaptureDialog_Source  = $1;

VfwCaptureDialog_Format  = $2;

VfwCaptureDialog_Display = $4;

 

VfwCompressDialog_Config = $1;

VfwCompressDialog_About  = $2;

 

VfwCompressDialog_QueryConfig = $4;

VfwCompressDialog_QueryAbout  = $8;

 

 

type

IAMVfwCaptureDialogs = interface(IUnknown)

   ['{D8D715A0-6E5E-11D0-B3F0-00AA003761C5}']

   function HasDialog(iDialog: Integer): HRESULT; stdcall;

   function ShowDialog(iDialog: Integer; hwnd: HWND): HRESULT; stdcall;

   function SendDriverMessage(iDialog: Integer; uMsg: Integer;

       dw1, dw2: Longint): HRESULT; stdcall;

end;

 

IAMVfwCompressDialogs = interface(IUnknown)

   ['{D8D715A3-6E5E-11D0-B3F0-00AA003761C5}']

   function ShowDialog(iDialog: Integer; hwnd: HWND): HRESULT; stdcall;

   function GetState(out pState; var pcbState: Integer): HRESULT; stdcall;

   function SetState(var pState; cbState: Integer): HRESULT; stdcall;

   function SendDriverMessage(uMsg: Integer; dw1, dw2: Longint): HRESULT; stdcall;

end;

 

IAMDroppedFrames = interface(IUnknown)

   ['{C6E13344-30AC-11d0-A18C-00A0C9118956}']

   function GetNumDropped(out plDropped: Longint): HRESULT; stdcall;

   function GetNumNotDropped(out plNotDropped: Longint): HRESULT; stdcall;

   function GetDroppedInfo(lSize: Longint; out plArray: Longint;

       out plNumCopied: Longint): HRESULT; stdcall;

   function GetAverageFrameSize(out plAverageSize: Longint): HRESULT; stdcall;

end;

 

const

AMF_AUTOMATICGAIN = -1;

 

type

IAMAudioInputMixer = interface(IUnknown)

   ['{54C39221-8380-11d0-B3F0-00AA003761C5}']

   function put_Enable(fEnable: BOOL): HRESULT; stdcall;

   function get_Enable(out pfEnable: BOOL): HRESULT; stdcall;

   function put_Mono(fMono: BOOL): HRESULT; stdcall;

   function get_Mono(out pfMono: BOOL): HRESULT; stdcall;

   function put_MixLevel(Level: double): HRESULT; stdcall;

   function get_MixLevel(out pLevel: double): HRESULT; stdcall;

   function put_Pan(Pan: double): HRESULT; stdcall;

   function get_Pan(out pPan: double): HRESULT; stdcall;

   function put_Loudness(fLoudness: BOOL): HRESULT; stdcall;

   function get_Loudness(out pfLoudness: BOOL): HRESULT; stdcall;

   function put_Treble(Treble: double): HRESULT; stdcall;

   function get_Treble(out pTreble: double): HRESULT; stdcall;

   function get_TrebleRange(out pRange: double): HRESULT; stdcall;

   function put_Bass(Bass: double): HRESULT; stdcall;

   function get_Bass(out pBass: double): HRESULT; stdcall;

   function get_BassRange(out pRange: double): HRESULT; stdcall;

end;

 

IAMBufferNegotiation = interface(IUnknown)

   ['{56ED71A0-AF5F-11D0-B3F0-00AA003761C5}']

   function SuggestAllocatorProperties(const pprop: TAllocator_Properties): HRESULT; stdcall;

   function GetAllocatorProperties(var pprop: TAllocator_Properties): HRESULT; stdcall;

end;

 

const

AnalogVideo_None        = 0;

AnalogVideo_NTSC_M      = $1;

AnalogVideo_NTSC_M_J    = $2;

AnalogVideo_NTSC_433    = $4;

AnalogVideo_PAL_B       = $10;

AnalogVideo_PAL_D       = $20;

AnalogVideo_PAL_G       = $40;

AnalogVideo_PAL_H       = $80;

AnalogVideo_PAL_I       = $100;

AnalogVideo_PAL_M       = $200;

AnalogVideo_PAL_N       = $400;

AnalogVideo_PAL_60      = $800;

AnalogVideo_SECAM_B     = $1000;

AnalogVideo_SECAM_D     = $2000;

AnalogVideo_SECAM_G     = $4000;

AnalogVideo_SECAM_H     = $8000;

AnalogVideo_SECAM_K     = $10000;

AnalogVideo_SECAM_K1    = $20000;

AnalogVideo_SECAM_L     = $40000;

AnalogVideo_SECAM_L1    = $80000;

 

AnalogVideo_NTSC_Mask   = $00000007;

AnalogVideo_PAL_Mask    = $00000FF0;

AnalogVideo_SECAM_Mask  = $000FF000;

 

type

TTunerInputType =(

   TunerInputCable,

   TunerInputAntenna

);

 

TVideoCopyProtectionType = (

   VideoCopyProtectionMacrovisionBasic,

   VideoCopyProtectionMacrovisionCBI

);

 

TPhysicalConnectorType = TOleEnum;

const

   PhysConn_Video_Tuner                = 1;

   PhysConn_Video_Composite                = PhysConn_Video_Tuner + 1;

   PhysConn_Video_SVideo                = PhysConn_Video_Composite + 1;

   PhysConn_Video_RGB                        = PhysConn_Video_SVideo + 1;

   PhysConn_Video_YRYBY                = PhysConn_Video_RGB + 1;

   PhysConn_Video_SerialDigital        = PhysConn_Video_YRYBY + 1;

   PhysConn_Video_ParallelDigital        = PhysConn_Video_SerialDigital + 1;

   PhysConn_Video_SCSI                        = PhysConn_Video_ParallelDigital + 1;

   PhysConn_Video_AUX                        = PhysConn_Video_SCSI + 1;

   PhysConn_Video_1394                        = PhysConn_Video_AUX + 1;

   PhysConn_Video_USB                        = PhysConn_Video_1394 + 1;

   PhysConn_Video_VideoDecoder                = PhysConn_Video_USB + 1;

   PhysConn_Video_VideoEncoder                = PhysConn_Video_VideoDecoder + 1;

   PhysConn_Video_SCART                = PhysConn_Video_VideoEncoder + 1;

   PhysConn_Video_Black                = PhysConn_Video_SCART + 1;

   PhysConn_Audio_Tuner                = $1000;

   PhysConn_Audio_Line                        = PhysConn_Audio_Tuner + 1;

   PhysConn_Audio_Mic                        = PhysConn_Audio_Line + 1;

   PhysConn_Audio_AESDigital                = PhysConn_Audio_Mic + 1;

   PhysConn_Audio_SPDIFDigital                = PhysConn_Audio_AESDigital + 1;

   PhysConn_Audio_SCSI                        = PhysConn_Audio_SPDIFDigital + 1;

   PhysConn_Audio_AUX                        = PhysConn_Audio_SCSI + 1;

   PhysConn_Audio_1394                        = PhysConn_Audio_AUX + 1;

   PhysConn_Audio_USB                        = PhysConn_Audio_1394 + 1;

   PhysConn_Audio_AudioDecoder                = PhysConn_Audio_USB + 1;

 

type

IAMAnalogVideoDecoder = interface(IUnknown)

   ['{C6E13350-30AC-11d0-A18C-00A0C9118956}']

   function get_AvailableTVFormats(out lAnalogVideoStandard: Longint): HRESULT; stdcall;

   function put_TVFormat(lAnalogVideoStandard: Longint): HRESULT; stdcall;

   function get_TVFormat(out plAnalogVideoStandard: Longint): HRESULT; stdcall;

   function get_HorizontalLocked(out plLocked: Longint): HRESULT; stdcall;

   function put_VCRHorizontalLocking(lVCRHorizontalLocking: Longint): HRESULT; stdcall;

   function get_VCRHorizontalLocking(out plVCRHorizontalLocking: Longint): HRESULT; stdcall;

   function get_NumberOfLines(out plNumberOfLines: Longint): HRESULT; stdcall;

   function put_OutputEnable(lOutputEnable: LongBool): HRESULT; stdcall;

   function get_OutputEnable(out plOutputEnable: LongBool): HRESULT; stdcall;

end;

 

TVideoProcAmpProperty = (

   VideoProcAmp_Brightness,

   VideoProcAmp_Contrast,

   VideoProcAmp_Hue,

   VideoProcAmp_Saturation,

   VideoProcAmp_Sharpness,

   VideoProcAmp_Gamma,

   VideoProcAmp_ColorEnable,

   VideoProcAmp_WhiteBalance,

   VideoProcAmp_BacklightCompensation,

   VideoProcAmp_Gain

);

 

TVideoProcAmpFlags = (

   VideoProcAmp_Flags_Manual,

   VideoProcAmp_Flags_Auto

);

 

IAMVideoProcAmp = interface(IUnknown)

   ['{C6E13360-30AC-11d0-A18C-00A0C9118956}']

   function GetRange(Property_:TVideoProcAmpProperty; out pMin, pMax, pSteppingDelta,

       pDefault: Longint; out pCapsFlags: TVideoProcAmpFlags): HRESULT; stdcall;

   function Set_(Property_: TVideoProcAmpProperty; lValue: Longint;

       Flags: TVideoProcAmpFlags): HRESULT; stdcall;

   function Get(Property_: TVideoProcAmpProperty; out lValue: Longint;

       out Flags: TVideoProcAmpFlags): HRESULT; stdcall;

end;

 

TCameraControlProperty = (

   CameraControl_Pan,

   CameraControl_Tilt,

   CameraControl_Roll,

   CameraControl_Zoom,

   CameraControl_Exposure,

   CameraControl_Iris,

   CameraControl_Focus

);

 

TCameraControlFlags = (

   CameraControl_Flags_Manual,

   CameraControl_Flags_Auto

);

 

IAMCameraControl = interface(IUnknown)

   ['{C6E13370-30AC-11d0-A18C-00A0C9118956}']

   function GetRange(Property_: TCameraControlProperty;

       out pMin, pMax, pSteppingDelta, pDefault, pCapsFlags: Longint): HRESULT; stdcall;

   function Set_(Property_: TCameraControlProperty; lValue: Longint;

       Flags: TCameraControlFlags): HRESULT; stdcall;

   function Get(Property_: TCameraControlProperty; out lValue: Longint;

       out Flags: TCameraControlFlags): HRESULT; stdcall;

end;

 

const

VideoControlFlag_FlipHorizontal         = $1;

VideoControlFlag_FlipVertical                 = $2;

VideoControlFlag_ExternalTriggerEnable = $4;

VideoControlFlag_Trigger                 = $8;

 

type

IAMVideoControl = interface(IUnknown)

   ['{6a2e0670-28e4-11d0-a18c-00a0c9118956}']

   function GetCaps(pPin: IPin; out pCapsFlags: Longint): HRESULT; stdcall;

   function SetMode(pPin: IPin; Mode: Longint): HRESULT; stdcall;

   function GetMode(pPin: IPin; out Mode: Longint): HRESULT; stdcall;

   function GetCurrentActualFrameRate(pPin: IPin; out ActualFrameRate: Int64): HRESULT; stdcall;

   function GetMaxAvailableFrameRate(pPin: IPin; iIndex: Longint; Dimensions: TSize; out MaxAvailableFrameRate: Int64): HRESULT; stdcall;

   function GetFrameRateList(pPin: IPin; iIndex: Longint; Dimensions: TSize; out ListSize: Longint; out FrameRates: PInt64): HRESULT; stdcall;

end;

 

IAMCrossbar = interface(IUnknown)

   ['{C6E13380-30AC-11d0-A18C-00A0C9118956}']

   function get_PinCounts(out OutputPinCount, InputPinCount: Longint): HRESULT; stdcall;

   function CanRoute(OutputPinIndex, InputPinIndex: Longint): HRESULT; stdcall;

   function Route(OutputPinIndex, InputPinIndex: Longint): HRESULT; stdcall;

   function get_IsRoutedTo(OutputPinIndex: Longint;

     out InputPinIndex: Longint): HRESULT; stdcall;

   function get_CrossbarPinInfo(IsInputPin: BOOL; PinIndex: Longint;

     out PinIndexRelated : longint; out PhysicalType: TPhysicalConnectorType): HRESULT; stdcall;

end;

 

const

AMTUNER_SUBCHAN_NO_TUNE = -2;

AMTUNER_SUBCHAN_DEFAULT = -1;

 

AMTUNER_HASNOSIGNALSTRENGTH = -1;

AMTUNER_NOSIGNAL            = 0;

AMTUNER_SIGNALPRESENT       = 1;

 

AMTUNER_MODE_DEFAULT    = 0;

AMTUNER_MODE_TV         = $1;

AMTUNER_MODE_FM_RADIO   = $2;

AMTUNER_MODE_AM_RADIO   = $4;

AMTUNER_MODE_DSS        = $8;

 

type

TAMTunerModeType = DWORD;

 

TAMTunerEventType = (

   AMTUNER_EVENT_CHANGED

);

//AMTUNER_EVENT_CHANGED   = $1;

 

IAMTunerNotification = interface;

 

IAMTuner = interface(IUnknown)

   ['{211A8761-03AC-11d1-8D13-00AA00BD8339}']

   function put_Channel(lChannel, lVideoSubChannel, lAudioSubChannel: Longint): HRESULT; stdcall;

   function get_Channel(out lChannel, lVideoSubChannel, lAudioSubChannel: Longint): HRESULT; stdcall;

   function ChannelMinMax(out lChannelMin, lChannelMax: Longint): HRESULT; stdcall;

   function put_CountryCode(lCountryCode: Longint): HRESULT; stdcall;

   function get_CountryCode(out lCountryCode: Longint): HRESULT; stdcall;

   function put_TuningSpace(lTuningSpace: Longint): HRESULT; stdcall;

   function get_TuningSpace(out lTuningSpace: Longint): HRESULT; stdcall;

   function Logon(hCurrentUser: THandle): HRESULT; stdcall;

   function Logout: HRESULT; stdcall;

   function SignalPresent(out plSignalStrength: Longint): HRESULT; stdcall;

   function put_Mode(lMode: TAMTunerModeType): HRESULT; stdcall;

   function get_Mode(out plMode: TAMTunerModeType): HRESULT; stdcall;

   function GetAvailableModes(out plModes: Longint): HRESULT; stdcall;

   function RegisterNotificationCallBack(pNotify: IAMTunerNotification;

       lEvents: Longint): HRESULT; stdcall;

   function UnRegisterNotificationCallBack(pNotify: IAMTunerNotification): HRESULT; stdcall;

end;

 

IAMTunerNotification = interface(IUnknown)

   ['{211A8760-03AC-11d1-8D13-00AA00BD8339}']

   function OnEvent(Event: TAMTunerEventType): HRESULT; stdcall;

end;

 

IAMTVTuner = interface(IAMTuner)

   ['{211A8766-03AC-11d1-8D13-00AA00BD8339}']

   function get_AvailableTVFormats(out lAnalogVideoStandard: Longint): HRESULT; stdcall;

   function get_TVFormat(out plAnalogVideoStandard: Longint): HRESULT; stdcall;

   function AutoTune(lChannel: Longint; out plFoundSignal: Longint): HRESULT; stdcall;

   function StoreAutoTune: HRESULT; stdcall;

   function get_NumInputConnections(out plNumInputConnections: Longint): HRESULT; stdcall;

   function put_InputType(lIndex: Longint; InputType: TTunerInputType): HRESULT; stdcall;

   function get_InputType(lIndex: Longint; out InputType: TTunerInputType): HRESULT; stdcall;

   function put_ConnectInput(lIndex: Longint): HRESULT; stdcall;

   function get_ConnectInput(out plIndex: Longint): HRESULT; stdcall;

   function get_VideoFrequency(out lFreq: Longint): HRESULT; stdcall;

   function get_AudioFrequency(out lFreq: Longint): HRESULT; stdcall;

end;

 

IBPCSatelliteTuner = interface(IAMTuner)

   ['{211A8765-03AC-11d1-8D13-00AA00BD8339}']

   function get_DefaultSubChannelTypes(out plDefaultVideoType, plDefaultAudioType: Longint): HRESULT; stdcall;

   function put_DefaultSubChannelTypes(lDefaultVideoType, lDefaultAudioType: Longint): HRESULT; stdcall;

   function IsTapingPermitted: HRESULT; stdcall;

end;

 

const

AMTVAUDIO_MODE_MONO   = $1;

AMTVAUDIO_MODE_STEREO = $2;

AMTVAUDIO_MODE_LANG_A = $10;

AMTVAUDIO_MODE_LANG_B = $20;

AMTVAUDIO_MODE_LANG_C = $40;

 

type

TAMTVAudioEventType = (

   AMTVAUDIO_EVENT_CHANGED

);

 

IAMTVAudio = interface(IUnknown)

   ['{83EC1C30-23D1-11d1-99E6-00A0C9560266}']

   function GetHardwareSupportedTVAudioModes(out plModes: Longint): HRESULT; stdcall;

   function GetAvailableTVAudioModes(out plModes: Longint): HRESULT; stdcall;

   function get_TVAudioMode(out plMode: Longint): HRESULT; stdcall;

   function put_TVAudioMode(lMode: Longint): HRESULT; stdcall;

   function RegisterNotificationCallBack(pNotify: IAMTunerNotification;

       lEvents: Longint): HRESULT; stdcall;

   function UnRegisterNotificationCallBack(pNotify: IAMTunerNotification): HRESULT; stdcall;

end;

 

IAMTVAudioNotification = interface(IUnknown)

   ['{83EC1C33-23D1-11D1-99E6-00A0C9560266}']

   function OnEvent(Event: TAMTVAudioEventType): HRESULT; stdcall;

end;

 

IAMAnalogVideoEncoder = interface(IUnknown)

   ['{C6E133B0-30AC-11d0-A18C-00A0C9118956}']

   function get_AvailableTVFormats(out lAnalogVideoStandard: Longint): HRESULT; stdcall;

   function put_TVFormat(lAnalogVideoStandard: Longint): HRESULT; stdcall;

   function get_TVFormat(out plAnalogVideoStandard: Longint): HRESULT; stdcall;

   function put_CopyProtection(lVideoCopyProtection: Longint): HRESULT; stdcall;

   function get_CopyProtection(out lVideoCopyProtection: Longint): HRESULT; stdcall;

   function put_CCEnable(lCCEnable: LongBool): HRESULT; stdcall;

   function get_CCEnable(out lCCEnable: LongBool): HRESULT; stdcall;

end ;

 

TAMProperty_Pin = (

   AMPROPERTY_PIN_CATEGORY,

   AMPROPERTY_PIN_MEDIUM

);

 

const

KSPROPERTY_SUPPORT_GET = 1;

KSPROPERTY_SUPPORT_SET = 2;

 

type

IKsPropertySet = interface(IUnknown)

   ['{31EFAC30-515C-11d0-A9AA-00AA0061BE93}']

   function Set_(const guidPropSet: TGUID; dwPropID: TAMProperty_Pin;

     pInstanceData: pointer; cbInstanceData: DWORD; pPropData: pointer; cbPropData: DWORD): HRESULT; stdcall;

   function Get(const guidPropSet: TGUID; dwPropID: TAMProperty_Pin;

     pInstanceData: pointer; cbInstanceData: DWORD; out pPropData ; cbPropData: DWORD;

     out pcbReturned: DWORD): HRESULT; stdcall;

   function QuerySupported(const guidPropSet: TGUID; dwPropID: TAMProperty_Pin;

     out pTypeSupport: DWORD): HRESULT; stdcall;

end;

 

IMediaPropertyBag = interface(IPropertyBag)

   ['{6025A880-C0D5-11D0-BD4E-00A0C911CE86}']

   function EnumProperty(iProperty: ULONG; var pvarPropertyName,

       pvarPropertyValue: OleVariant): HRESULT; stdcall;

end;

 

IPersistMediaPropertyBag = interface(IPersist)

    ['{5738E040-B67F-11d0-BD4D-00A0C911CE86}']

    function InitNew: HRESULT; stdcall;

    function Load(pPropBag: IMediaPropertyBag; pErrorLog: IErrorLog): HRESULT; stdcall;

    function Save(pPropBag: IMediaPropertyBag; fClearDirty, fSaveAllProperties: BOOL): HRESULT; stdcall;

end;

 

//Deprecated Interface

IAMPhysicalPinInfo = interface(IUnknown)

   ['{F938C991-3029-11CF-8C44-00AA006B6814}']

   function GetPhysicalType(out pType: Longint; out ppszType: PWideChar): HRESULT; stdcall;

end;

 

IAMExtDevice = interface(IUnknown)

   ['{B5730A90-1A2C-11CF-8C23-00AA006B6814}']

   function GetCapability(Capability: Longint; out pValue: Longint; out pdblValue: double): HRESULT; stdcall;

   function get_ExternalDeviceID(out ppszData: PWideChar): HRESULT; stdcall;

   function get_ExternalDeviceVersion(out ppszData: PWideChar): HRESULT; stdcall;

   function put_DevicePower(PowerMode: Longint): HRESULT; stdcall;

   function get_DevicePower(out pPowerMode: Longint): HRESULT; stdcall;

   function Calibrate(hEvent: THandle; Mode: Longint; out pStatus: Longint): HRESULT; stdcall;

   function put_DevicePort(DevicePort: Longint): HRESULT; stdcall;

   function get_DevicePort(out pDevicePort: Longint): HRESULT; stdcall;

end;

 

IAMExtTransport = interface(IUnknown)

   ['{A03CD5F0-3045-11CF-8C44-00AA006B6814}']

   function GetCapability(Capability: Longint; out pValue: Longint; out pdblValue: double): HRESULT; stdcall;

   function put_MediaState(State: Longint): HRESULT; stdcall;

   function get_MediaState(out pState: Longint): HRESULT; stdcall;

   function put_LocalControl(State: Longint): HRESULT; stdcall;

   function get_LocalControl(out pState: Longint): HRESULT; stdcall;

   function GetStatus(StatusItem: Longint; out pValue: Longint): HRESULT; stdcall;

   function GetTransportBasicParameters(Param: Longint; var pValue: Longint; ppszData: pointer): HRESULT; stdcall;

   function SetTransportBasicParameters(Param: Longint; Value: Longint; pszData: PWideChar): HRESULT; stdcall;

   function GetTransportVideoParameters(Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetTransportVideoParameters(Param: Longint; Value: Longint): HRESULT; stdcall;

   function GetTransportAudioParameters(Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetTransportAudioParameters(Param: Longint; Value: Longint): HRESULT; stdcall;

   function put_Mode(Mode: Longint): HRESULT; stdcall;

   function get_Mode(out pMode: Longint): HRESULT; stdcall;

   function put_Rate(dblRate: double): HRESULT; stdcall;

   function get_Rate(out pdblRate: double): HRESULT; stdcall;

   function GetChase(out pEnabled, pOffset: Longint; var phEvent: THandle): HRESULT; stdcall;

   function SetChase(Enable, Offset: Longint; hEvent: THandle): HRESULT; stdcall;

   function GetBump(out pSpeed, pDuration: Longint): HRESULT; stdcall;

   function SetBump(Speed, Duration: Longint): HRESULT; stdcall;

   function get_AntiClogControl(out pEnabled: Longint): HRESULT; stdcall;

   function put_AntiClogControl(Enable: Longint): HRESULT; stdcall;

   function GetEditPropertySet(EditID: Longint; out pState: Longint): HRESULT; stdcall;

   function SetEditPropertySet(var pEditID: Longint; State: Longint): HRESULT; stdcall;

   function GetEditProperty(EditID, Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetEditProperty(EditID, Param, Value: Longint): HRESULT; stdcall;

   function get_EditStart(out pValue: Longint): HRESULT; stdcall;

   function put_EditStart(Value: Longint): HRESULT; stdcall;

end;

 

TTimeCode = record

   wFrameRate: Word;

   wFrameFract: Word;

   dwFrames: DWORD;

end;

 

TTimeCode_Sample = record

   qwTick: Int64;

   timecode: TTimeCode;

   dwUser: DWORD;

   dwFlags: DWORD;

end;

 

IAMTimecodeReader = interface(IUnknown)

   ['{9B496CE1-811B-11CF-8C77-00AA006B6814}']

   function GetTCRMode(Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetTCRMode(Param: Longint; Value: Longint): HRESULT; stdcall;

   function put_VITCLine(Line: Longint): HRESULT; stdcall;

   function get_VITCLine(out pLine: Longint): HRESULT; stdcall;

   function GetTimecode(out pTimecodeSample: TTimeCode_Sample): HRESULT; stdcall;

end;

 

IAMTimecodeGenerator = interface(IUnknown)

   ['{9B496CE0-811B-11CF-8C77-00AA006B6814}']

   function GetTCGMode(Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetTCGMode(Param: Longint; Value: Longint): HRESULT; stdcall;

   function put_VITCLine(Line: Longint): HRESULT; stdcall;

   function get_VITCLine(out Line: Longint): HRESULT; stdcall;

   function SetTimecode(var pTimecodeSample: TTimeCode_Sample): HRESULT; stdcall;

   function GetTimecode(out pTimecodeSample: TTimeCode_Sample): HRESULT; stdcall;

end;

 

IAMTimecodeDisplay = interface(IUnknown)

   ['{9B496CE2-811B-11CF-8C77-00AA006B6814}']

   function GetTCDisplayEnable(out pState: Longint): HRESULT; stdcall;

   function SetTCDisplayEnable(State: Longint): HRESULT; stdcall;

   function GetTCDisplay(Param: Longint; out pValue: Longint): HRESULT; stdcall;

   function SetTCDisplay(Param, Value: Longint): HRESULT; stdcall;

end;

 

//Deprecated Interface

IAMDevMemoryAllocator = interface(IUnknown)

   ['{C6545BF0-E76B-11D0-BD52-00A0C911CE86}']

   function GetInfo(out pdwcbTotalFree, pdwcbLargestFree, pdwcbTotalMemory, pdwcbMinimumChunk: DWORD): HRESULT; stdcall;

   function CheckMemory(pBuffer: Pointer): HRESULT; stdcall;

   function Alloc(out ppBuffer: Pointer; var pdwcbBuffer: DWORD): HRESULT; stdcall;

   function Free(pBuffer: Pointer): HRESULT; stdcall;

   function GetDevMemoryObject(out ppUnkInnner: IUnknown; pUnkOuter: IUnknown): HRESULT; stdcall;

end;

 

//Deprecated Interface

IAMDevMemoryControl = interface(IUnknown)

   ['{C6545BF1-E76B-11D0-BD52-00A0C911CE86}']

   function QueryWriteSync: HRESULT; stdcall;

   function WriteSync: HRESULT; stdcall;

   function GetDevId(out pdwDevId: DWORD): HRESULT; stdcall;

end;

 

const

AMSTREAMSELECTINFO_ENABLED     = $1;

AMSTREAMSELECTINFO_EXCLUSIVE   = $2;

 

AMSTREAMSELECTENABLE_ENABLE    = $1;

AMSTREAMSELECTENABLE_ENABLEALL = $2;

 

type

IAMStreamSelect = interface(IUnknown)

   ['{C1960960-17F5-11D1-ABE1-00A0C905F375}']

   function Count(out pcStreams: DWORD): HRESULT; stdcall;

   function Info(lIndex: Longint; out ppmt: PAM_Media_Type;

       out pdwFlags: DWORD; out plcid: LCID; out pdwGroup: DWORD;

       out ppszName: PWCHAR; out ppObject: IUnknown; out ppUnk : IUnknown): HRESULT; stdcall;

   function Enable(lIndex: Longint; dwFlags: DWORD): HRESULT; stdcall;

end;

 

IAMResourceControl = interface(IUnknown)

   ['{8389d2d0-77d7-11d1-abe6-00a0c905f375}']

   function Reserve(dwFlags: DWORD; var pvReserved: pointer): HRESULT; stdcall;

end;

 

IAMClockAdjust = interface(IUnknown)

   ['{4d5466b0-a49c-11d1-abe8-00a0c905f375}']

   function SetClockDelta(rtDelta: TREFERENCE_TIME): HRESULT; stdcall;

end;

 

const

AM_FILTER_MISC_FLAGS_IS_RENDERER        = $1;

AM_FILTER_MISC_FLAGS_IS_SOURCE        = $2;

 

type

IAMFilterMiscFlags = interface(IUnknown)

   ['{2dd74950-a890-11d1-abe8-00a0c905f375}']

   function GetMiscFlags: ULONG; stdcall;

end;

 

IDrawVideoImage = interface(IUnknown)

   ['{48efb120-ab49-11d2-aed2-00a0c995e8d5}']

   function DrawVideoImageBegin: HRESULT; stdcall;

   function DrawVideoImageEnd: HRESULT; stdcall;

   function DrawVideoImageDraw(hdc: HDC; lprcSrc, lprcDst: PRECT): HRESULT; stdcall;

end;

 

IDecimateVideoImage = interface(IUnknown)

   ['{2e5ea3e0-e924-11d2-b6da-00a0c995e8df}']

   function SetDecimationImageSize(lWidth, lHeight: Longint):HRESULT; stdcall;

   function ResetDecimationImageSize: HRESULT; stdcall;

end;

 

TDECIMATION_USAGE = (

          DECIMATION_LEGACY,

       DECIMATION_USE_DECODER_ONLY,

       DECIMATION_USE_VIDEOPORT_ONLY,

       DECIMATION_USE_OVERLAY_ONLY,

       DECIMATION_DEFAULT

       );

 

IAMVideoDecimationProperties = interface(IUnknown)

   ['{60d32930-13da-11d3-9ec6-c4fcaef5c7be}']

   function QueryDecimationUsage(out lpUsage: TDECIMATION_USAGE):HRESULT; stdcall;

   function SetDecimationUsage(Usage: TDECIMATION_USAGE):HRESULT; stdcall;

end;

 

const

    AM_PUSHSOURCECAPS_INTERNAL_RM        = $1;

    AM_PUSHSOURCECAPS_NOT_LIVE                = $2;

    AM_PUSHSOURCECAPS_PRIVATE_CLOCK        = $4;

    AM_PUSHSOURCEREQS_USE_STREAM_CLOCK = $00001;

 

type

IAMLatency = interface(IUnknown)

   ['{62EA93BA-EC62-11d2-B770-00C04FB6BD3D}']

   function GetLatency(var prtLatency: TREFERENCE_TIME): HRESULT; stdcall;

end;

 

IAMPushSource = interface(IAMLatency)

   ['{F185FE76-E64E-11d2-B76E-00C04FB6BD3D}']

   function GetPushSourceFlags(out pFlags: ULONG): HRESULT; stdcall;

   function SetPushSourceFlags(Flags: ULONG): HRESULT; stdcall;

   function SetStreamOffset(rtOffset: TREFERENCE_TIME): HRESULT; stdcall;

   function GetStreamOffset(out prtOffset: TREFERENCE_TIME): HRESULT; stdcall;

   function GetMaxStreamOffset(out prtMaxOffset: TREFERENCE_TIME): HRESULT; stdcall;

   function SetMaxStreamOffset(rtMaxOffset: TREFERENCE_TIME): HRESULT; stdcall;

end;

 

IAMDeviceRemoval = interface(IUnknown)

   ['{f90a6130-b658-11d2-ae49-0000f8754b99}']

   function DeviceInfo(out pclsidInterfaceClass: TGUID;

            out pwszSymbolicLink: PWideChar): HRESULT; stdcall;

   function Reassociate: HRESULT; stdcall;

   function Disassociate: HRESULT; stdcall;

end;

 

type

TDVInfo = record

   //for 1st 5/6 DIF seq.

   dwDVAAuxSrc: DWORD;

   dwDVAAuxCtl: DWORD;

   //for 2nd  5/6 DIF seq.

   dwDVAAuxSrc1: DWORD;

   dwDVAAuxCtl1: DWORD;

   //for video information

   dwDVVAuxSrc: DWORD;

   dwDVVAuxCtl: DWORD;

   dwDVReserved: array[0..1] of DWORD;

end;

 

const

//DVENCODERRESOLUTION

          DVENCODERRESOLUTION_720x480        = 2012;

       DVENCODERRESOLUTION_360x240        = 2013;

       DVENCODERRESOLUTION_180x120        = 2014;

       DVENCODERRESOLUTION_88x60        = 2015;

 

//DVENCODERVIDEOFORMAT

          DVENCODERVIDEOFORMAT_NTSC        = 2000;

       DVENCODERVIDEOFORMAT_PAL        = 2001;

 

//DVENCODERFORMAT

          DVENCODERFORMAT_DVSD                = 2007;

       DVENCODERFORMAT_DVHD                = 2008;

       DVENCODERFORMAT_DVSL                = 2009;

 

type

IDVEnc = interface(IUnknown)

   ['{d18e17a0-aacb-11d0-afb0-00aa00b67a42}']

   function get_IFormatResolution(out VideoFormat, DVFormat, Resolution: integer;

            fDVInfo: ByteBool; out sDVInfo: TDVINFO): HRESULT; stdcall;

   function put_IFormatResolution(VideoFormat, DVFormat, Resolution: integer;

            fDVInfo: ByteBool; var sDVInfo: TDVINFO): HRESULT; stdcall;

end;

 

const

//DVDECODERRESOLUTION

          DVDECODERRESOLUTION_720x480        = 1000;

       DVDECODERRESOLUTION_360x240        = 1001;

       DVDECODERRESOLUTION_180x120        = 1002;

       DVDECODERRESOLUTION_88x60        = 1003;

 

//DVRESOLUTION

          DVRESOLUTION_FULL                = 1000;

       DVRESOLUTION_HALF                = 1001;

       DVRESOLUTION_QUARTER                = 1002;

       DVRESOLUTION_DC                        = 1003;

 

type

IIPDVDec = interface(IUnknown)

   ['{b8e8bd60-0bfe-11d0-af91-00aa00b67a42}']

   function get_IPDisplay(out displayPix : integer): HRESULT; stdcall;

   function put_IPDisplay(displayPix: integer): HRESULT; stdcall;

end;

 

IDVRGB219 = interface(IUnknown)

   ['{58473A19-2BC8-4663-8012-25F81BABDDD1}']

   function SetRGB219(bState: BOOL): HRESULT; stdcall;

end;

 

IDVSplitter = interface(IUnknown)

   ['{92a3a302-da7c-4a1f-ba7e-1802bb5d2d02}']

   function DiscardAlternateVideoFrames(nDiscard: integer): HRESULT; stdcall;

end;

 

//_AM_AUDIO_RENDERER_STAT_PARAM

const

          AM_AUDREND_STAT_PARAM_BREAK_COUNT                = 1;

       AM_AUDREND_STAT_PARAM_SLAVE_MODE                = AM_AUDREND_STAT_PARAM_BREAK_COUNT + 1;

       AM_AUDREND_STAT_PARAM_SILENCE_DUR                = AM_AUDREND_STAT_PARAM_SLAVE_MODE + 1;

       AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR                = AM_AUDREND_STAT_PARAM_SILENCE_DUR + 1;

       AM_AUDREND_STAT_PARAM_DISCONTINUITIES                = AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR + 1;

       AM_AUDREND_STAT_PARAM_SLAVE_RATE                = AM_AUDREND_STAT_PARAM_DISCONTINUITIES + 1;

       AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR        = AM_AUDREND_STAT_PARAM_SLAVE_RATE + 1;

       AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR        = AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR + 1;

       AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR        = AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR + 1;

       AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR                = AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR + 1;

       AM_AUDREND_STAT_PARAM_BUFFERFULLNESS                = AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR + 1;

       AM_AUDREND_STAT_PARAM_JITTER                        = AM_AUDREND_STAT_PARAM_BUFFERFULLNESS + 1;

 

type

IAMAudioRendererStats = interface(IUnknown)

   ['{22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93}']

   function GetStatParam(dwParam: DWORD; out pdwParam1, pdwParam2: DWORD): HRESULT; stdcall;

end;

 

//AM_INTF_SEARCH_FLAGS

const

          AM_INTF_SEARCH_INPUT_PIN        = $1;

       AM_INTF_SEARCH_OUTPUT_PIN        = $2;

       AM_INTF_SEARCH_FILTER                = $4;

 

type

IAMGraphStreams = interface(IUnknown)

   ['{632105FA-072E-11d3-8AF9-00C04FB6BD3D}']

   function FindUpstreamInterface(pPin: IPin; const riid: TGUID; out ppvInterface;

            dwFlags: DWORD): HRESULT; stdcall;

   function SyncUsingStreamOffset(bUseStreamOffset: BOOL): HRESULT; stdcall;

   function SetMaxGraphLatency(rtMaxGraphLatency: TREFERENCE_TIME): HRESULT; stdcall;

end;

 

//AMOVERLAYFX

const

          AMOVERFX_NOFX                  = 0;

       AMOVERFX_MIRRORLEFTRIGHT  = $2;

       AMOVERFX_MIRRORUPDOWN         = $4;

       AMOVERFX_DEINTERLACE         = $8;

 

type

IAMOverlayFX = interface(IUnknown)

   ['{62fae250-7e65-4460-bfc9-6398b322073c}']

   function QueryOverlayFXCaps(out lpdwOverlayFXCaps: DWORD): HRESULT; stdcall;

   function SetOverlayFX(dwOverlayFX: DWORD): HRESULT; stdcall;

   function GetOverlayFX(out lpdwOverlayFX: DWORD): HRESULT; stdcall;

end;

 

IAMOpenProgress = interface(IUnknown)

   ['{8E1C39A1-DE53-11cf-AA63-0080C744528D}']

   function QueryProgress(out pllTotal, pllCurrent: int64): HRESULT; stdcall;

   function AbortOperation: HRESULT; stdcall;

end;

 

IMpeg2Demultiplexer = interface(IUnknown)

   ['{436eee9c-264f-4242-90e1-4e330c107512}']

   function CreateOutputPin(var pMediaType: TAM_MEDIA_TYPE; pszPinName: PWideChar;

            out ppIPin: IPin): HRESULT; stdcall;

   function SetOutputPinMediaType(pszPinName: PWideChar; var pMediaType: TAM_MEDIA_TYPE): HRESULT; stdcall;

   function DeleteOutputPin(pszPinName: PWideChar): HRESULT; stdcall;

end;

 

const

    MPEG2_PROGRAM_STREAM_MAP           =      $00000000;

    MPEG2_PROGRAM_ELEMENTARY_STREAM    =      $00000001;

    MPEG2_PROGRAM_DIRECTORY_PES_PACKET =      $00000002;

    MPEG2_PROGRAM_PACK_HEADER          =      $00000003;

    MPEG2_PROGRAM_PES_STREAM           =      $00000004;

    MPEG2_PROGRAM_SYSTEM_HEADER        =      $00000005;

    SUBSTREAM_FILTER_VAL_NONE          =      $10000000;

 

type

PSTREAM_ID_MAP = ^TSTREAM_ID_MAP;

TSTREAM_ID_MAP = record

   stream_id             : ULONG;

   dwMediaSampleContent  : DWORD;

   ulSubstreamFilterValue: ULONG;

   iDataOffset           : integer;

   end;

 

IEnumStreamIdMap = interface(IUnknown)

   ['{945C1566-6202-46fc-96C7-D87F289C6534}']

   function Next(cRequest: ULONG; var pStreamIdMap: PSTREAM_ID_MAP;

            out pcReceived: ULONG): HRESULT; stdcall;

   function Skip(cRecords: ULONG): HRESULT; stdcall;

   function Reset: HRESULT; stdcall;

   function Clone(out ppIEnumStreamIdMap: IEnumStreamIdMap): HRESULT; stdcall;

end;

 

IMPEG2StreamIdMap = interface(IUnknown)

   ['{D0E04C47-25B8-4369-925A-362A01D95444}']

   function MapStreamId(ulStreamId: ULONG; MediaSampleContent: DWORD;

            ulSubstreamFilterValue: ULONG; iDataOffset: integer): HRESULT; stdcall;

   function UnmapStreamId(culStreamId: ULONG; var pulStreamId: ULONG): HRESULT; stdcall;

   function EnumStreamIdMap(out ppIEnumStreamIdMap: IEnumStreamIdMap): HRESULT; stdcall;

end;

 

 

IAMovie = interface(IFilterGraph)

   ['{359ACE10-7688-11CF-8B23-00805F6CEF60}']

   function Connect(ppinOut, ppinIn: IPin): HRESULT; stdcall;

   function Render(ppinOut: IPin): HRESULT; stdcall;

   function Run: HRESULT; stdcall;

   function Pause: HRESULT; stdcall;

   function Stop: HRESULT; stdcall;

   function GetState(msTimeout: DWORD; out pfs: TFilter_State): HRESULT; stdcall;

   function RenderFile(strFilename: PWideChar): HRESULT; stdcall;

   function AddSourceFilter(strFilename: PWideChar; out ppUnk: IBaseFilter): HRESULT; stdcall;

   function GetEventHandle(out hEvent: THandle): HRESULT; stdcall;

   function GetEvent(out lEventCode, lParam1, lParam2: Longint; msTimeout: DWORD): HRESULT; stdcall;

   function WaitForCompletion(msTimeout: DWORD; out pEvCode: Longint): HRESULT; stdcall;

   function CancelDefaultHandling(lEvCode: Longint): HRESULT; stdcall;

   function RestoreDefaultHandling(lEvCode: Longint): HRESULT; stdcall;

   function get_Duration(out plength: TRefTime): HRESULT; stdcall;

   function put_CurrentPosition(llTime: TRefTime): HRESULT; stdcall;

   function get_CurrentPosition(out pllTime: TRefTime): HRESULT; stdcall;

   function get_StopTime(out pllTime: TRefTime): HRESULT; stdcall;

   function put_StopTime(llTime: TRefTime): HRESULT; stdcall;

   function get_PrerollTime(out pllTime: TRefTime): HRESULT; stdcall;

   function put_PrerollTime(llTime: TRefTime): HRESULT; stdcall;

   function put_Rate(dRate: double): HRESULT; stdcall;

   function get_Rate(out pdRate: double): HRESULT; stdcall;

   function RemoveAllFilters: HRESULT; stdcall;

   function Play: HRESULT; stdcall;

   function PlayFile(strFilename: PWideChar): HRESULT; stdcall;

   function EnumFiltersByInterface(const riid: TGUID;

       out ppEnum: IEnumFilters): HRESULT; stdcall;

   function EnumPins(out ppEnum: IEnumPins): HRESULT; stdcall;

   function EnumPinsIn(out ppEnum: IEnumPins): HRESULT; stdcall;

   function EnumPinsOut(out ppEnum: IEnumPins): HRESULT; stdcall;

   function RenderAll: HRESULT; stdcall;

   function RenderNewFile(strFilename: PWideChar): HRESULT; stdcall;

   function FreeEventParams(lEvCode, lParam1, lParam2: Longint): HRESULT; stdcall;

end;

 

IRegisterServiceProvider = interface(IUnknown)

   ['{7B3A2F01-0751-48DD-B556-004785171C54}']

   function RegisterService(const guidService: TGUID; pUnkObject: IUnknown): HRESULT; stdcall;

end;

 

const

 

AM_GETDECODERCAP_QUERY_VMR_SUPPORT = $00000001;

VMR_NOTSUPPORTED                   = $00000000;

VMR_SUPPORTED                      = $00000001;

AM_QUERY_DECODER_VMR_SUPPORT       = $00000001;

AM_QUERY_DECODER_DXVA_1_SUPPORT    = $00000002;

AM_QUERY_DECODER_DVD_SUPPORT       = $00000003;

AM_QUERY_DECODER_ATSC_SD_SUPPORT   = $00000004;

AM_QUERY_DECODER_ATSC_HD_SUPPORT   = $00000005;

DECODER_CAP_NOTSUPPORTED           = $00000000;

DECODER_CAP_SUPPORTED              = $00000001;

 

CDEF_CLASS_DEFAULT          = $0001;

CDEF_BYPASS_CLASS_MANAGER   = $0002;

//CDEF_CLASS_LEGACY           = $0004;

CDEF_MERIT_ABOVE_DO_NOT_USE = $0008;

CDEF_DEVMON_CMGR_DEVICE     = $0010;

CDEF_DEVMON_DMO             = $0020;

CDEF_DEVMON_PNP_DEVICE      = $0040;

CDEF_DEVMON_FILTER          = $0080;

CDEF_DEVMON_SELECTIVE_MASK  = $00f0;

 

type

IAMDecoderCaps = interface(IUnknown)

   ['{c0dff467-d499-4986-972b-e1d9090fa941}']

   function GetDecoderCaps(dwCapIndex: DWORD; out lpdwCap: DWORD): HRESULT; stdcall;

end;

 

IAMClockSlave = interface(IUnknown)

   ['{9FD52741-176D-4b36-8F51-CA8F933223BE}']

   function SetErrorTolerance(dwTolerance: DWORD): HRESULT; stdcall;

   function GetErrorTolerance(out dwTolerance: DWORD): HRESULT; stdcall;

end;

 

ICreateDevEnum = interface(IUnknown)

   ['{29840822-5B84-11D0-BD3B-00A0C911CE86}']

   function CreateClassEnumerator(const clsidDeviceClass: TGUID;

       out ppEnumMoniker: IEnumMoniker; dwFlags: DWORD): HRESULT; stdcall;

end;

 

IFilterMapper3 = interface(IFilterMapper2)

   ['{b79bb0b1-33c1-11d1-abe1-00a0c905f375}']

   function GetICreateDevEnum(out ppEnum: ICreateDevEnum): HRESULT; stdcall;

end;

 

//replacement for DVD_TextStringType in GetDVDTextStringAsNative, GetDVDTextStringAsUnicode

type

TDVD_TextStringType = TOleEnum;

const

DVD_Struct_Volume = $00000001;

DVD_Struct_Title = $00000002;

DVD_Struct_ParentalID = $00000003;

DVD_Struct_PartOfTitle = $00000004;

DVD_Struct_Cell = $00000005;

DVD_Stream_Audio = $00000010;

DVD_Stream_Subpicture = $00000011;

DVD_Stream_Angle = $00000012;

DVD_Channel_Audio = $00000020;

DVD_General_Name = $00000030;

DVD_General_Comments = $00000031;

DVD_Title_Series = $00000038;

DVD_Title_Movie = $00000039;

DVD_Title_Video = $0000003A;

DVD_Title_Album = $0000003B;

DVD_Title_Song = $0000003C;

DVD_Title_Other = $0000003F;

DVD_Title_Sub_Series = $00000040;

DVD_Title_Sub_Movie = $00000041;

DVD_Title_Sub_Video = $00000042;

DVD_Title_Sub_Album = $00000043;

DVD_Title_Sub_Song = $00000044;

DVD_Title_Sub_Other = $00000047;

DVD_Title_Orig_Series = $00000048;

DVD_Title_Orig_Movie = $00000049;

DVD_Title_Orig_Video = $0000004A;

DVD_Title_Orig_Album = $0000004B;

DVD_Title_Orig_Song = $0000004C;

DVD_Title_Orig_Other = $0000004F;

DVD_Other_Scene = $00000050;

DVD_Other_Cut = $00000051;

DVD_Other_Take = $00000052;

 

type

TDVD_OPTION_FLAG = (

DVD_Option_Invalid,//type compatibility

DVD_ResetOnStop,

DVD_NotifyParentalLevelChange,

DVD_HMSF_TimeCodeEvents

);

 

type

TDVD_Domain = (

   DVD_DOMAIN_INVALID,

   DVD_DOMAIN_FirstPlay,

   DVD_DOMAIN_VideoManagerMenu,

   DVD_DOMAIN_VideoTitleSetMenu,

   DVD_DOMAIN_Title,

   DVD_DOMAIN_Stop

);

 

TDVD_Menu_ID = (

   DVD_MENU_INVALID_0,

   DVD_MENU_INVALID_1,

   DVD_MENU_Title,

   DVD_MENU_Root,

   DVD_MENU_Subpicture,

   DVD_MENU_Audio,

   DVD_MENU_Angle,

   DVD_MENU_Chapter

);

 

TDVD_Disc_Side = (

   DVD_SIDE_INVALID_0,

   DVD_SIDE_A,

   DVD_SIDE_B

);

 

TDVD_PREFERRED_Display_Mode = (

   DISPLAY_CONTENT_DEFAULT,

   DISPLAY_16x9,

   DISPLAY_4x3_PANSCAN_PREFERRED,

   DISPLAY_4x3_LETTERBOX_PREFERRED

);

 

TDVD_VIDEO_COMPRESSION = (

   DVD_VideoCompression_Other,

   DVD_VideoCompression_MPEG1,

   DVD_VideoCompression_MPEG22

);

 

TDVD_AUDIO_APPMODE = (

   DVD_AudioMode_None,

   DVD_AudioMode_Karaoke,

   DVD_AudioMode_Surround,

   DVD_AudioMode_Other

   );

 

TDVD_AUDIO_FORMAT = (

   DVD_AudioFormat_AC3,

   DVD_AudioFormat_MPEG1,

   DVD_AudioFormat_MPEG1_DRC,

   DVD_AudioFormat_MPEG2,

   DVD_AudioFormat_MPEG2_DRC,

   DVD_AudioFormat_LPCM,

   DVD_AudioFormat_DTS,

   DVD_AudioFormat_SDDS,

   DVD_AudioFormat_Other

   );

// DVD_KARAOKE_DOWNMIX

const

       DVD_Mix_0to0        = $1   ;

       DVD_Mix_1to0        = $2   ;

       DVD_Mix_2to0        = $4   ;

       DVD_Mix_3to0        = $8   ;

       DVD_Mix_4to0        = $10 ;

       DVD_Mix_Lto0        = $20 ;

       DVD_Mix_Rto0        = $40 ;

       DVD_Mix_0to1        = $100 ;

       DVD_Mix_1to1        = $200 ;

       DVD_Mix_2to1        = $400 ;

       DVD_Mix_3to1        = $800 ;

       DVD_Mix_4to1        = $1000;

       DVD_Mix_Lto1        = $2000;

       DVD_Mix_Rto1        = $4000;

 

type       

TDVD_AUDIO_LANG_EXT = (

//...modified by henri (before DVD_AUD_EXT_NotSpecified0 oups)

   DVD_AUD_EXT_NotSpecified,

//...

   DVD_AUD_EXT_Captions,

   DVD_AUD_EXT_VisuallyImpaired,

   DVD_AUD_EXT_DirectorComments1,

   DVD_AUD_EXT_DirectorComments2

   );

 

TDVD_SUBPICTURE_TYPE = (

   DVD_SPType_NotSpecified,

   DVD_SPType_Language,

   DVD_SPType_Other

   );

 

TDVD_SUBPICTURE_CODING = (

   DVD_SPCoding_RunLength,

   DVD_SPCoding_Extended,

   DVD_SPCoding_Other

   );

 

TDVD_SUBPICTURE_LANG_EXT = (

   DVD_SP_EXT_NotSpecified,

   DVD_SP_EXT_Caption_Normal,

   DVD_SP_EXT_Caption_Big,

   DVD_SP_EXT_Caption_Children,

   DVD_SP_EXT_CC_Normal,

   DVD_SP_EXT_CC_Big,

   DVD_SP_EXT_CC_Children,

   DVD_SP_EXT_Forced,

   DVD_SP_EXT_DirectorComments_Normal,

   DVD_SP_EXT_DirectorComments_Big,

   DVD_SP_EXT_DirectorComments_Children

   );

 

TDVD_KARAOKE_ASSIGNMENT = (

   DVD_Assignment_reserved0,

   DVD_Assignment_reserved1,

   DVD_Assignment_LR,

   DVD_Assignment_LRM,

   DVD_Assignment_LR1,

   DVD_Assignment_LRM1,

   DVD_Assignment_LR12,

   DVD_Assignment_LRM12

);

 

TDVD_RELATIVE_BUTTON = (

   DVD_Relative_Invalid,

   DVD_Relative_Upper,

   DVD_Relative_Lower,

   DVD_Relative_Left,

   DVD_Relative_Right

);

 

 

TDVD_REGISTER = Word;

 

TGPRMArray = array[0..15] of TDVD_REGISTER;

TSPRMArray = array[0..23] of TDVD_REGISTER;

 

TDVD_ATR = record

   ulCAT: ULONG;

   pbATRI: array[0..767] of Byte;

end;

 

TDVD_VideoATR = array[0..1] of Byte;

TDVD_AudioATR = array[0..7] of Byte;

TDVD_SubpictureATR = array[0..5] of Byte;

 

TDVD_FrameRate = (

   DVD_FPS_INVALID_0,

   DVD_FPS_25,

   DVD_FPS_INVALID_2,

   DVD_FPS_30NonDrop

);

 

TDVD_TimeCode = record

   Hours1       : byte; // 4 Hours

   Hours10      : byte; // 4 Tens of Hours

   Minutes1     : byte; // 4 Minutes

   Minutes10    : byte; // 4 Tens of Minutes

   Seconds1     : byte; // 4 Seconds

   Seconds10    : byte; // 4 Tens of Seconds

   Frames1      : byte; // 4 Frames

   Frames10     : byte; // 2 Tens of Frames

   FrameRateCode: byte; // 2 use DVD_FRAMERATE to indicate frames/sec and drop/non-drop

end;

 

//DVD_TIMECODE_FLAGS

const

          DVD_TC_FLAG_25fps                = $1;

       DVD_TC_FLAG_30fps                = $2;

       DVD_TC_FLAG_DropFrame                = $4;

       DVD_TC_FLAG_Interpolated        = $8;

type

TDVD_HMSF_TIMECODE = record

   bHours: BYTE;

   bMinutes: BYTE;

   bSeconds: BYTE;

   bFrames: BYTE;

end;

PDVD_HMSF_TIMECODE = ^TDVD_HMSF_TIMECODE;

 

TDVD_Playback_Location2 = record

   TitleNum: ULONG;

   ChapterNum: ULONG;

   TimeCode: TDVD_HMSF_TIMECODE;

   TimeCodeFlags: ULONG;

end;

 

TDVD_Playback_Location = record

   TitleNum: ULONG;

   ChapterNum: ULONG;

   TimeCode: ULONG;

end;

 

TVALID_UOP_SOMTHING_OR_OTHER = DWORD;

 

// VALID_UOP_FLAG;

const

   UOP_FLAG_Play_Title_Or_AtTime                        = $1      ;

   UOP_FLAG_Play_Chapter                                = $2      ;

   UOP_FLAG_Play_Title                                        = $4      ;

   UOP_FLAG_Stop                                        = $8      ;

   UOP_FLAG_ReturnFromSubMenu                                = $10     ;

   UOP_FLAG_Play_Chapter_Or_AtTime                        = $20     ;

   UOP_FLAG_PlayPrev_Or_Replay_Chapter                        = $40     ;

   UOP_FLAG_PlayNext_Chapter                                = $80     ;

   UOP_FLAG_Play_Forwards                                = $100    ;

   UOP_FLAG_Play_Backwards                                = $200    ;

   UOP_FLAG_ShowMenu_Title                                = $400    ;

   UOP_FLAG_ShowMenu_Root                                = $800    ;

   UOP_FLAG_ShowMenu_SubPic                                = $1000   ;

   UOP_FLAG_ShowMenu_Audio                                = $2000   ;

   UOP_FLAG_ShowMenu_Angle                                = $4000   ;

   UOP_FLAG_ShowMenu_Chapter                                = $8000   ;

   UOP_FLAG_Resume                                        = $10000 ;

   UOP_FLAG_Select_Or_Activate_Button                        = $20000 ;

   UOP_FLAG_Still_Off                                        = $40000 ;

   UOP_FLAG_Pause_On                                        = $80000 ;

   UOP_FLAG_Select_Audio_Stream                        = $100000 ;

   UOP_FLAG_Select_SubPic_Stream                        = $200000 ;

   UOP_FLAG_Select_Angle                                = $400000 ;

   UOP_FLAG_Select_Karaoke_Audio_Presentation_Mode        = $800000 ;

   UOP_FLAG_Select_Video_Mode_Preference                = $1000000;

 

type

TDVD_TextCharSet = (

   DVD_CharSet_Unicode,

   DVD_CharSet_ISO646,

   DVD_CharSet_JIS_Roman_Kanji,

   DVD_CharSet_ISO8859_1,

   DVD_CharSet_ShiftJIS_Kanji_Roman_Katakana

);

 

const

DVD_TITLE_MENU   = $000;

DVD_STREAM_DATA_CURRENT  = $800;

DVD_STREAM_DATA_VMGM     = $400;

DVD_STREAM_DATA_VTSM     = $401;

DVD_DEFAULT_AUDIO_STREAM = $0f ;

 

type

TDVD_DECODER_CAPS = record

   dwSize: DWORD;

   dwAudioCaps: DWORD;

   dFwdMaxRateVideo: double;

   dFwdMaxRateAudio: double;

   dFwdMaxRateSP: double;

   dBwdMaxRateVideo: double;

   dBwdMaxRateAudio: double;

   dBwdMaxRateSP: double;

   dwRes1: DWORD;

   dwRes2: DWORD;

   dwRes3: DWORD;

   dwRes4: DWORD;

end;

 

const

DVD_AUDIO_CAPS_AC3   =                $00000001;

DVD_AUDIO_CAPS_MPEG2 =         $00000002;

DVD_AUDIO_CAPS_LPCM  =                $00000004;

DVD_AUDIO_CAPS_DTS   =                $00000008;

DVD_AUDIO_CAPS_SDDS  =                $00000010;

 

type

TDVD_VideoAttributes = record

   fPanscanPermitted: BOOL;

   fLetterboxPermitted: BOOL;

   ulAspectX: ULONG;

   ulAspectY: ULONG;

   ulFrameRate: ULONG;

   ulFrameHeight: ULONG;

   Compression: TDVD_VIDEO_COMPRESSION;

   fLine21Field1InGOP: BOOL;

   fLine21Field2InGOP: BOOL;

   ulSourceResolutionX: ULONG;

   ulSourceResolutionY: ULONG;

   fIsSourceLetterboxed: BOOL;

   fIsFilmMode: BOOL;

end;

 

TDVD_SubpictureAttributes = record

   _Type: TDVD_SUBPICTURE_TYPE ;

   CodingMode: TDVD_SUBPICTURE_CODING ;

   Language: LCID ;

   LanguageExtension: TDVD_SUBPICTURE_LANG_EXT ;

end;

 

TDVD_TITLE_APPMODE = (

   DVD_AppMode_Not_Specified,

   DVD_AppMode_Karaoke,

   DVD_AppMode_Other

   );

 

TDVD_MUA_MixingInfo = record

   fMixTo0: BOOL;

   fMixTo1: BOOL;

   fMix0InPhase: BOOL;

   fMix1InPhase: BOOL;

   dwSpeakerPosition: DWORD;

end;

 

TDVD_MUA_Coeff = record

   log2_alpha: Double;

   log2_beta: Double;

end;

 

TDVD_MultichannelAudioAttributes = record

   Info: array[0..7] of TDVD_MUA_MixingInfo;

   Coeff: array[0..7] of TDVD_MUA_Coeff;

end;

 

// DVD_KARAOKE_CONTENTS

const

       DVD_Karaoke_GuideVocal1         = $1 ;

       DVD_Karaoke_GuideVocal2         = $2 ;

       DVD_Karaoke_GuideMelody1        = $4 ;

       DVD_Karaoke_GuideMelody2        = $8 ;

       DVD_Karaoke_GuideMelodyA        = $10;

       DVD_Karaoke_GuideMelodyB        = $20;

       DVD_Karaoke_SoundEffectA        = $40;

       DVD_Karaoke_SoundEffectB        = $80;

 

type

TDVD_AudioAttributes = record

   AppMode: TDVD_AUDIO_APPMODE;

   AppModeData: BYTE;

   AudioFormat: TDVD_AUDIO_FORMAT;

   Language: LCID;

   LanguageExtension: TDVD_AUDIO_LANG_EXT;

   fHasMultichannelInfo: BOOL;

   dwFrequency: DWORD;

   bQuantization: BYTE;

   bNumberOfChannels: BYTE;

   dwReserved: array[0..1] of DWORD;

end;

 

TDVD_TitleAttributes = record

   AppMode: TDVD_TITLE_APPMODE ;

   VideoAttributes: TDVD_VideoAttributes ;

   ulNumberOfAudioStreams: ULONG ;

   AudioAttributes: array[0..7] of TDVD_AudioAttributes;

   MultichannelAudioAttributes: array[0..7] of TDVD_MultichannelAudioAttributes;

   ulNumberOfSubpictureStreams: ULONG ;

   SubpictureAttributes: array[0..31] of TDVD_SubpictureAttributes;

end;

 

TDVD_MenuAttributes = record

   fCompatibleRegion: array[0..7] of BOOL;

   VideoAttributes: TDVD_VideoAttributes;

   fAudioPresent: BOOL;

   AudioAttributes: TDVD_AudioAttributes;

   fSubpicturePresent: BOOL;

   SubpictureAttributes: TDVD_SubpictureAttributes;

end;

 

TDVD_KaraokeAttributes = record

   bVersion: BYTE;

   fMasterOfCeremoniesInGuideVocal1: BOOL;

   fDuet: BOOL;

   ChannelAssignment: TDVD_KARAOKE_ASSIGNMENT;

   wChannelContents: array[0..7] of WORD;

end;

 

 

 

const

DVD_PARENTAL_LEVEL_8    = $8000;

DVD_PARENTAL_LEVEL_7    = $4000;

DVD_PARENTAL_LEVEL_6    = $2000;

DVD_PARENTAL_LEVEL_5    = $1000;

DVD_PARENTAL_LEVEL_4    = $0800;

DVD_PARENTAL_LEVEL_3    = $0400;

DVD_PARENTAL_LEVEL_2    = $0200;

DVD_PARENTAL_LEVEL_1    = $0100;

 

type

TDVD_CMD_FLAGS = DWORD;

 

const

DVD_CMD_FLAG_None               = $00000000;

DVD_CMD_FLAG_Flush              = $00000001;

DVD_CMD_FLAG_SendEvents         = $00000002;

DVD_CMD_FLAG_Block              = $00000004;

DVD_CMD_FLAG_StartWhenRendered  = $00000008;

DVD_CMD_FLAG_EndAfterRendered   = $00000010;

 

type

TCountryCode = array[0..1] of BYTE;

 

type

IDvdState = interface(IUnknown)

     ['{86303d6d-1c4a-4087-ab42-f711167048ef}']

     function GetDiscID(out pullUniqueID: Double): HResult; stdcall;

     function GetParentalLevel(out pulParentalLevel: ULONG): HResult; stdcall;

end;

 

IDvdCmd = interface(IUnknown)

     ['{5A4A97E4-94EE-4A55-9751-74B5643AA27D}']

     function WaitForStart: HResult; stdcall;

     function WaitForEnd: HResult; stdcall;

end;

 

//Deprecated Interface

IDvdControl = interface(IUnknown)