Subversion Repositories spacemission

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. (*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1994-1997 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  DirectX header version 98.08.07
  6.  *
  7.  *  Present by Hiroyuki Hori.
  8.  *
  9.  *  E-Mail: hori@ingjapan.ne.jp
  10.  *  Homepage: http://www.ingjapan.ne.jp/hori/index-e.html
  11.  *
  12.  *  Present unit:
  13.  *    DirectX.pas    DirectX 6 (DirectX 6 SDK)
  14.  *    DShow.pas      DirectShow (DirectX Media SDK 5.1)
  15.  *    DAnim.pas      DirectAnimation (DirectX Media SDK 5.1)
  16.  *
  17.  ***************************************************************************)
  18.  
  19. unit DShow;
  20.  
  21. interface
  22.  
  23. {$Z4}
  24. {$A+}
  25. {$WEAKPACKAGEUNIT}
  26.  
  27. uses Windows, ActiveX, DirectX, MMSystem;
  28.  
  29. (*==========================================================================;
  30.  *
  31.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  32.  *
  33.  *  File:       comlite.h
  34.  *
  35.  ***************************************************************************)
  36.  
  37. function QzInitialize(pvReserved: Pointer): HResult; stdcall;
  38. procedure QzUninitialize; stdcall;
  39. procedure QzFreeUnusedLibraries; stdcall;
  40.  
  41. function QzGetMalloc(dwMemContext: Longint; out malloc: IMalloc): HResult; stdcall;
  42. function QzTaskMemAlloc(cb: Longint): Pointer; stdcall;
  43. function QzTaskMemRealloc(pv: Pointer; cb: Longint): Pointer; stdcall;
  44. procedure QzTaskMemFree(pv: Pointer); stdcall;
  45. function QzCreateFilterObject(const clsid: TCLSID; unkOuter: IUnknown;
  46.   dwClsContext: Longint; const iid: TIID; out pv): HResult; stdcall;
  47. function QzCLSIDFromString(psz: POleStr; out clsid: TCLSID): HResult; stdcall;
  48. function QzStringFromGUID2(const guid: TGUID; psz: POleStr; cbMax: Integer): Integer; stdcall;
  49.  
  50. (*==========================================================================;
  51.  *
  52.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  53.  *
  54.  *  File:       errors.h
  55.  *
  56.  ***************************************************************************)
  57.  
  58. const
  59.   VFW_FIRST_CODE = $200;
  60.   MAX_ERROR_TEXT_LEN = 160;
  61.  
  62. type
  63.   AMGETERRORTEXTPROCA = function(hr: HResult; pbuffer: PChar; MaxLen: DWORD): BOOL; stdcall;
  64.  
  65.   AMGETERRORTEXTPROCW = function(hr: HResult; pbuffer: PWideChar; MaxLen: DWORD): BOOL; stdcall;
  66.  
  67.   AMGETERRORTEXTPROC = AMGETERRORTEXTPROCA;
  68.  
  69. function AMGetErrorTextA(hr: HResult; pbuffer: PChar; MaxLen: DWORD): DWORD; stdcall;
  70. function AMGetErrorTextW(hr: HResult; pbuffer: PWideChar; MaxLen: DWORD): DWORD; stdcall;
  71. function AMGetErrorText(hr: HResult; pbuffer: PChar; MaxLen: DWORD): DWORD; stdcall;
  72.  
  73. (*==========================================================================;
  74.  *
  75.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  76.  *
  77.  *  File:       strmif.h
  78.  *
  79.  ***************************************************************************)
  80.  
  81. const
  82.   IID_IPin: TGUID = '{56A86891-0AD4-11CE-B03A-0020AF0BA770}';
  83.   IID_IEnumPins: TGUID = '{56A86892-0AD4-11CE-B03A-0020AF0BA770}';
  84.   IID_IEnumMediaTypes: TGUID = '{89C31040-846B-11CE-97D3-00AA0055595A}';
  85.   IID_IFilterGraph: TGUID = '{56A8689F-0AD4-11CE-B03A-0020AF0BA770}';
  86.   IID_IEnumFilters: TGUID = '{56A86893-0AD4-11CE-B03A-0020AF0BA770}';
  87.   IID_IMediaFilter: TGUID = '{56A86899-0AD4-11CE-B03A-0020AF0BA770}';
  88.   IID_IBaseFilter: TGUID = '{56A86895-0AD4-11CE-B03A-0020AF0BA770}';
  89.   IID_IReferenceClock: TGUID = '{56A86897-0AD4-11CE-B03A-0020AF0BA770}';
  90.   IID_IReferenceClock2: TGUID = '{36B73885-C2C8-11CF-8B46-00805F6CEF60}';
  91.   IID_IMediaSample: TGUID = '{56A8689A-0AD4-11CE-B03A-0020AF0BA770}';
  92.   IID_IMediaSample2: TGUID = '{36B73884-C2C8-11CF-8B46-00805F6CEF60}';
  93.   IID_IMemAllocator: TGUID = '{56A8689C-0AD4-11CE-B03A-0020AF0BA770}';
  94.   IID_IMemInputPin: TGUID = '{56A8689D-0AD4-11CE-B03A-0020AF0BA770}';
  95.   IID_IAMovieSetup: TGUID = '{A3D8CEC0-7E5A-11CF-BBC5-00805F6CEF20}';
  96.   IID_IMediaSeeking: TGUID = '{36B73880-C2C8-11CF-8B46-00805F6CEF60}';
  97.   IID_IEnumRegFilters: TGUID = '{56A868A4-0AD4-11CE-B03A-0020AF0BA770}';
  98.   IID_IFilterMapper: TGUID = '{56A868A3-0AD4-11CE-B03A-0020AF0BA770}';
  99.   IID_IFilterMapper2: TGUID = '{B79BB0B0-33C1-11D1-ABE1-00A0C905F375}';
  100.   IID_IQualityControl: TGUID = '{56A868A5-0AD4-11CE-B03A-0020AF0BA770}';
  101.   IID_IOverlayNotify: TGUID = '{56A868A0-0AD4-11CE-B03A-0020AF0BA770}';
  102.   IID_IOverlay: TGUID = '{56A868A1-0AD4-11CE-B03A-0020AF0BA770}';
  103.   IID_IMediaEventSink: TGUID = '{56A868A2-0AD4-11CE-B03A-0020AF0BA770}';
  104.   IID_IFileSourceFilter: TGUID = '{56A868A6-0AD4-11CE-B03A-0020AF0BA770}';
  105.   IID_IFileSinkFilter: TGUID = '{A2104830-7C70-11CF-8BCE-00AA00A3F1A6}';
  106.   IID_IFileSinkFilter2: TGUID = '{00855B90-CE1B-11D0-BD4F-00A0C911CE86}';
  107.   IID_IFileAsyncIO: TGUID = '{56A868A7-0AD4-11CE-B03A-0020AF0BA770}';
  108.   IID_IGraphBuilder: TGUID = '{56A868A9-0AD4-11CE-B03A-0020AF0BA770}';
  109.   IID_ICaptureGraphBuilder: TGUID = '{BF87B6E0-8C27-11D0-B3F0-00AA003761C5}';
  110.   IID_IAMCopyCaptureFileProgress: TGUID = '{670D1D20-A068-11D0-B3F0-00AA003761C5}';
  111.   IID_IFilterGraph2: TGUID = '{36B73882-C2C8-11CF-8B46-00805F6CEF60}';
  112.   IID_IStreamBuilder: TGUID = '{56A868BF-0AD4-11CE-B03A-0020AF0BA770}';
  113.   IID_IAsyncReader: TGUID = '{56A868AA-0AD4-11CE-B03A-0020AF0BA770}';
  114.   IID_IGraphVersion: TGUID = '{56A868AB-0AD4-11CE-B03A-0020AF0BA770}';
  115.   IID_IResourceConsumer: TGUID = '{56A868AD-0AD4-11CE-B03A-0020AF0BA770}';
  116.   IID_IResourceManager: TGUID = '{56A868AC-0AD4-11CE-B03A-0020AF0BA770}';
  117.   IID_IDistributorNotify: TGUID = '{56A868AF-0AD4-11CE-B03A-0020AF0BA770}';
  118.   IID_IAMStreamControl: TGUID = '{36b73881-c2c8-11cf-8b46-00805f6cef60}';
  119.   IID_ISeekingPassThru: TGUID = '{36B73883-C2C8-11CF-8B46-00805F6CEF60}';
  120.   IID_IAMStreamConfig: TGUID = '{C6E13340-30AC-11d0-A18C-00A0C9118956}';
  121.   IID_IConfigInterleaving: TGUID = '{BEE3D220-157B-11d0-BD23-00A0C911CE86}';
  122.   IID_IConfigAviMux: TGUID = '{5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6}';
  123.   IID_IAMVideoCompression: TGUID = '{C6E13343-30AC-11d0-A18C-00A0C9118956}';
  124.   IID_IAMVfwCaptureDialogs: TGUID = '{D8D715A0-6E5E-11D0-B3F0-00AA003761C5}';
  125.   IID_IAMVfwCompressDialogs: TGUID = '{D8D715A3-6E5E-11D0-B3F0-00AA003761C5}';
  126.   IID_IAMDroppedFrames: TGUID = '{C6E13344-30AC-11d0-A18C-00A0C9118956}';
  127.   IID_IAMAudioInputMixer: TGUID = '{54C39221-8380-11d0-B3F0-00AA003761C5}';
  128.   IID_IAMAnalogVideoDecoder: TGUID = '{C6E13350-30AC-11d0-A18C-00A0C9118956}';
  129.   IID_IAMVideoProcAmp: TGUID = '{C6E13360-30AC-11d0-A18C-00A0C9118956}';
  130.   IID_IAMCameraControl: TGUID = '{C6E13370-30AC-11d0-A18C-00A0C9118956}';
  131.   IID_IAMCrossbar: TGUID = '{C6E13380-30AC-11d0-A18C-00A0C9118956}';
  132.   IID_IAMTuner: TGUID = '{211A8761-03AC-11d1-8D13-00AA00BD8339}';
  133.   IID_IAMTunerNotification: TGUID = '{211A8760-03AC-11d1-8D13-00AA00BD8339}';
  134.   IID_IAMTVTuner: TGUID = '{211A8766-03AC-11d1-8D13-00AA00BD8339}';
  135.   IID_IBPCSatelliteTuner: TGUID = '{211A8765-03AC-11d1-8D13-00AA00BD8339}';
  136.   IID_IAMTVAudio: TGUID = '{83EC1C30-23D1-11d1-99E6-00A0C9560266}';
  137.   IID_IAMTVAudioNotification: TGUID = '{83EC1C33-23D1-11D1-99E6-00A0C9560266}';
  138.   IID_IAMAnalogVideoEncoder: TGUID = '{C6E133B0-30AC-11d0-A18C-00A0C9118956}';
  139.   IID_IMediaPropertyBag: TGUID = '{6025A880-C0D5-11D0-BD4E-00A0C911CE86}';
  140.   IID_IPersistMediaPropertyBag: TGUID = '{5738E040-B67F-11d0-BD4D-00A0C911CE86}';
  141.   IID_IAMPhysicalPinInfo: TGUID = '{F938C991-3029-11CF-8C44-00AA006B6814}';
  142.   IID_IAMExtDevice: TGUID = '{B5730A90-1A2C-11CF-8C23-00AA006B6814}';
  143.   IID_IAMExtTransport: TGUID = '{A03CD5F0-3045-11CF-8C44-00AA006B6814}';
  144.   IID_IAMTimecodeReader: TGUID = '{9B496CE1-811B-11CF-8C77-00AA006B6814}';
  145.   IID_IAMTimecodeGenerator: TGUID = '{9B496CE0-811B-11CF-8C77-00AA006B6814}';
  146.   IID_IAMTimecodeDisplay: TGUID = '{9B496CE2-811B-11CF-8C77-00AA006B6814}';
  147.   IID_IAMDevMemoryAllocator: TGUID = '{C6545BF0-E76B-11D0-BD52-00A0C911CE86}';
  148.   IID_IAMDevMemoryControl: TGUID = '{C6545BF1-E76B-11D0-BD52-00A0C911CE86}';
  149.   IID_IAMStreamSelect: TGUID = '{C1960960-17F5-11D1-ABE1-00A0C905F375}';
  150.   IID_IAMovie: TGUID = '{359ACE10-7688-11CF-8B23-00805F6CEF60}';
  151.   IID_ICreateDevEnum: TGUID = '{29840822-5B84-11D0-BD3B-00A0C911CE86}';
  152.   IID_IDvdControl: TGUID = '{A70EFE61-E2A3-11D0-A9BE-00AA0061BE93}';
  153.   IID_IDvdInfo: TGUID = '{A70EFE60-E2A3-11D0-A9BE-00AA0061BE93}';
  154.   IID_IDvdGraphBuilder: TGUID = '{FCC152B6-F372-11d0-8E00-00C04FD7C08B}';
  155.  
  156. const
  157.   CHARS_IN_GUID = 39;
  158.  
  159.   MAX_PIN_NAME    = 128;
  160.   MAX_FILTER_NAME = 128;
  161.  
  162. type
  163.   TAM_Media_Type = record
  164.     majortype: TGUID;
  165.     subtype: TGUID;
  166.     bFixedSizeSamples: BOOL;
  167.     bTemporalCompression: BOOL;
  168.     lSampleSize: ULONG;
  169.     formattype: TGUID;
  170.     pUnk: IUnknown;
  171.     cbFormat: ULONG;
  172.     pbFormat: Pointer;
  173.   end;
  174.   PAM_Media_Type = ^TAM_Media_Type;
  175.  
  176.   TPin_Direction = (
  177.     PINDIR_INPUT,
  178.     PINDIR_OUTPUT
  179.   );
  180.  
  181.   TRefTime = double;
  182.  
  183.   HSEMAPHORE = Longint;
  184.  
  185.   TAllocator_Properties = record
  186.     cBuffers: Longint;
  187.     cbBuffer: Longint;
  188.     cbAlign: Longint;
  189.     cbPrefix: Longint;
  190.   end;
  191.  
  192.   IBaseFilter = interface;
  193.  
  194.   TPin_Info = record
  195.     pFilter: IBaseFilter;
  196.     dir: TPin_Direction;
  197.     achName: array[0..127] of WCHAR;
  198.   end;
  199.  
  200.   IEnumMediaTypes = interface;
  201.  
  202.   IPin = interface(IUnknown)
  203.     ['{56A86891-0AD4-11CE-B03A-0020AF0BA770}']
  204.     function Connect(pReceivePin: IPin; const pmt: TAM_Media_Type): HResult; stdcall;
  205.     function ReceiveConnection(pConnector: IPin; const pmt: TAM_Media_Type): HResult; stdcall;
  206.     function Disconnect: HResult; stdcall;
  207.     function ConnectedTo(out pPin: IPin): HResult; stdcall;
  208.     function ConnectionMediaType(out pmt: TAM_Media_Type): HResult; stdcall;
  209.     function QueryPinInfo(out pInfo: TPin_Info): HResult; stdcall;
  210.     function QueryDirection(var pPinDir: TPin_Direction): HResult; stdcall;
  211.     function QueryId(var Id: LPWSTR): HResult; stdcall;
  212.     function QueryAccept(const pmt: TAM_Media_Type): HResult; stdcall;
  213.     function EnumMediaTypes(out ppEnum: IEnumMediaTypes): HResult; stdcall;
  214.     function QueryInternalConnections(out apPin: IPin; var nPin: ULONG): HResult; stdcall;
  215.     function EndOfStream: HResult; stdcall;
  216.     function BeginFlush: HResult; stdcall;
  217.     function EndFlush: HResult; stdcall;
  218.     function NewSegment(tStart, tStop: TReference_Time; dRate: double): HResult; stdcall;
  219.   end;
  220.  
  221.   IEnumPins = interface(IUnknown)
  222.     ['{56A86892-0AD4-11CE-B03A-0020AF0BA770}']
  223.     function Next(cPins: ULONG; out ppPins; var pcFetched: ULONG): HResult; stdcall;
  224.     function Skip(cPins: ULONG): HResult; stdcall;
  225.     function Reset: HResult; stdcall;
  226.     function Clone(out ppEnum: IEnumPins): HResult; stdcall;
  227.   end;
  228.  
  229.   IEnumMediaTypes = interface(IUnknown)
  230.     ['{89C31040-846B-11CE-97D3-00AA0055595A}']
  231.     function Next(cMediaTypes: ULONG; var ppMediaTypes: PAM_Media_Type;
  232.         var pcFetched: ULONG): HResult; stdcall;
  233.     function Skip(cMediaTypes: ULONG): HResult; stdcall;
  234.     function Reset: HResult; stdcall;
  235.     function Clone(out ppEnum: IEnumMediaTypes): HResult; stdcall;
  236.   end;
  237.  
  238.   IEnumFilters = interface;
  239.  
  240.   IFilterGraph = interface(IUnknown)
  241.     ['{56A8689F-0AD4-11CE-B03A-0020AF0BA770}']
  242.     function AddFilter(pFilter: IBaseFilter; pName: LPCWSTR): HResult; stdcall;
  243.     function RemoveFilter(pFilter: IBaseFilter): HResult; stdcall;
  244.     function EnumFilters(out ppEnum: IEnumFilters): HResult; stdcall;
  245.     function FindFilterByName(pName: LPCWSTR; out ppFilter: IBaseFilter): HResult; stdcall;
  246.     function ConnectDirect(ppinOut, ppinIn: IPin; const pmt: TAM_Media_Type): HResult; stdcall;
  247.     function Reconnect(ppin: IPin): HResult; stdcall;
  248.     function Disconnect(ppin: IPin): HResult; stdcall;
  249.     function SetDefaultSyncSource: HResult; stdcall;
  250.   end;
  251.  
  252.   IEnumFilters = interface(IUnknown)
  253.     ['{56A86893-0AD4-11CE-B03A-0020AF0BA770}']
  254.     function Next(cFilters: ULONG; out ppFilter: IBaseFilter;
  255.         var pcFetched: ULONG): HResult; stdcall;
  256.     function Skip(cFilters: ULONG): HResult; stdcall;
  257.     function Reset: HResult; stdcall;
  258.     function Clone(out ppEnum: IEnumFilters): HResult; stdcall;
  259.   end;
  260.  
  261.   TFilter_State = (
  262.     State_Stopped,
  263.     State_Paused,
  264.     State_Running
  265.   );
  266.  
  267.   IReferenceClock = interface;
  268.  
  269.   IMediaFilter = interface(IPersist)
  270.     ['{56A86899-0AD4-11CE-B03A-0020AF0BA770}']
  271.     function Stop: HResult; stdcall;
  272.     function Pause: HResult; stdcall;
  273.     function Run(tStart: TReference_Time): HResult; stdcall;
  274.     function GetState(dwMilliSecsTimeout: DWORD; var State: TFilter_State): HResult; stdcall;
  275.     function SetSyncSource(pClock: IReferenceClock): HResult; stdcall;
  276.     function GetSyncSource(out pClock: IReferenceClock): HResult; stdcall;
  277.   end;
  278.  
  279.   TFilterInfo = record
  280.     achName: array[0..127] of WCHAR;
  281.     pGraph: IFilterGraph;
  282.   end;
  283.  
  284.   IBaseFilter = interface(IMediaFilter)
  285.     ['{56A86895-0AD4-11CE-B03A-0020AF0BA770}']
  286.     function EnumPins(out ppEnum: IEnumPins): HResult; stdcall;
  287.     function FindPin(Id: LPCWSTR; out ppPin: IPin): HResult; stdcall;
  288.     function QueryFilterInfo(out pInfo: TFilterInfo): HResult; stdcall;
  289.     function JoinFilterGraph(pGraph: IFilterGraph; pName: LPCWSTR): HResult; stdcall;
  290.     function QueryVendorInfo(var pVendorInfo: LPWSTR): HResult; stdcall;
  291.   end;
  292.  
  293.   IReferenceClock = interface(IUnknown)
  294.     ['{56A86897-0AD4-11CE-B03A-0020AF0BA770}']
  295.     function GetTime(var pTime: TReference_Time): HResult; stdcall;
  296.     function AdviseTime(baseTime, streamTime: TReference_Time;
  297.         hEvent: THandle; var pdwAdviseCookie: DWORD): HResult; stdcall;
  298.     function AdvisePeriodic(startTime, periodTime: TReference_Time;
  299.         hSemaphore: HSEMAPHORE; var pdwAdviseCookie: DWORD): HResult; stdcall;
  300.     function Unadvise(dwAdviseCookie: DWORD): HResult; stdcall;
  301.   end;
  302.  
  303.   IReferenceClock2 = interface(IReferenceClock)
  304.     ['{36B73885-C2C8-11CF-8B46-00805F6CEF60}']
  305.   end;
  306.  
  307.   IMediaSample = interface(IUnknown)
  308.     ['{56A8689A-0AD4-11CE-B03A-0020AF0BA770}']
  309.     function GetPointer(var ppBuffer: Pointer): HResult; stdcall;
  310.     function GetSize: Longint; stdcall;
  311.     function GetTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  312.     function SetTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  313.     function IsSyncPoint: HResult; stdcall;
  314.     function SetSyncPoint(bIsSyncPoint: BOOL): HResult; stdcall;
  315.     function IsPreroll: HResult; stdcall;
  316.     function SetPreroll(bIsPreroll: BOOL): HResult; stdcall;
  317.     function GetActualDataLength: Longint; stdcall;
  318.     function SetActualDataLength(lLen: Longint): HResult; stdcall;
  319.     function GetMediaType(var ppMediaType: PAM_Media_Type): HResult; stdcall;
  320.     function SetMediaType(const pMediaType: TAM_Media_Type): HResult; stdcall;
  321.     function IsDiscontinuity: HResult; stdcall;
  322.     function SetDiscontinuity(bDiscontinuity: BOOL): HResult; stdcall;
  323.     function GetMediaTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  324.     function SetMediaTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  325.   end;                                    
  326.  
  327. const
  328.   AM_SAMPLE_SPLICEPOINT         = $1;
  329.   AM_SAMPLE_PREROLL             = $2;
  330.   AM_SAMPLE_DATADISCONTINUITY   = $4;
  331.   AM_SAMPLE_TYPECHANGED         = $8;
  332.   AM_SAMPLE_TIMEVALID           = $10;
  333.   AM_SAMPLE_TIMEDISCONTINUITY   = $40;
  334.   AM_SAMPLE_FLUSH_ON_PAUSE      = $80;
  335.   AM_SAMPLE_STOPVALID           = $100;
  336.   AM_SAMPLE_ENDOFSTREAM         = $200;
  337.   AM_STREAM_MEDIA               = 0;
  338.   AM_STREAM_CONTROL             = 1;
  339.  
  340. type
  341.   TAM_Sample2_Properties = record
  342.     cbData: DWORD;
  343.     dwTypeSpecificFlags: DWORD;
  344.     dwSampleFlags: DWORD;
  345.     lActual: Longint;
  346.     tStart: TReference_Time;
  347.     tStop: TReference_Time;
  348.     dwStreamId: DWORD;
  349.     pMediaType: PAM_Media_Type;
  350.     pbBuffer: Pointer;
  351.     cbBuffer: Longint;
  352.   end;
  353.  
  354. type
  355.   IMediaSample2 = interface(IMediaSample)
  356.     ['{36B73884-C2C8-11CF-8B46-00805F6CEF60}']
  357.     function GetProperties(cbProperties: DWORD; var pbProperties): HResult; stdcall;
  358.     function SetProperties(cbProperties: DWORD; const pbProperties): HResult; stdcall;
  359.   end;
  360.  
  361. const
  362.   AM_GBF_PREVFRAMESKIPPED = 1;
  363.   AM_GBF_NOTASYNCPOINT    = 2;
  364.   AM_GBF_NOWAIT           = 4;
  365.  
  366. type
  367.   IMemAllocator = interface(IUnknown)
  368.     ['{56A8689C-0AD4-11CE-B03A-0020AF0BA770}']
  369.     function SetProperties(const pRequest: TAllocator_Properties;
  370.         var pActual: TAllocator_Properties): HResult; stdcall;
  371.     function GetProperties(var pProps: TAllocator_Properties): HResult; stdcall;
  372.     function Commit: HResult; stdcall;
  373.     function Decommit: HResult; stdcall;      
  374.     function GetBuffer(out ppBuffer: IMediaSample;
  375.         var pStartTime, pEndTime: TReference_Time; dwFlags: DWORD): HResult; stdcall;
  376.     function ReleaseBuffer(pBuffer: IMediaSample): HResult; stdcall;
  377.   end;
  378.  
  379.   IMemInputPin = interface(IUnknown)
  380.     ['{56A8689D-0AD4-11CE-B03A-0020AF0BA770}']
  381.     function GetAllocator(out ppAllocator: IMemAllocator): HResult; stdcall;
  382.     function NotifyAllocator(pAllocator: IMemAllocator; bReadOnly: BOOL): HResult; stdcall;
  383.     function GetAllocatorRequirements(var pProps: TAllocator_Properties): HResult; stdcall;
  384.     function Receive(pSample: IMediaSample): HResult; stdcall;
  385.     function ReceiveMultiple(const pSamples; nSamples: Longint;
  386.         var nSamplesProcessed: Longint): HResult; stdcall;
  387.     function ReceiveCanBlock: HResult; stdcall;
  388.   end;
  389.  
  390.   IAMovieSetup = interface(IUnknown)
  391.     ['{A3D8CEC0-7E5A-11CF-BBC5-00805F6CEF20}']
  392.     function Register: HResult; stdcall;
  393.     function Unregister: HResult; stdcall;
  394.   end;
  395.  
  396. const
  397.   AM_SEEKING_NoPositioning          = 0;
  398.   AM_SEEKING_AbsolutePositioning    = $1;
  399.   AM_SEEKING_RelativePositioning    = $2;
  400.   AM_SEEKING_IncrementalPositioning = $3;
  401.   AM_SEEKING_PositioningBitsMask    = $3;
  402.   AM_SEEKING_SeekToKeyFrame         = $4;
  403.   AM_SEEKING_ReturnTime             = $8;
  404.   AM_SEEKING_Segment                = $10;
  405.   AM_SEEKING_NoFlush                = $20;
  406.  
  407.   AM_SEEKING_CanSeekAbsolute        = $1;
  408.   AM_SEEKING_CanSeekForwards        = $2;
  409.   AM_SEEKING_CanSeekBackwards       = $4;
  410.   AM_SEEKING_CanGetCurrentPos       = $8;
  411.   AM_SEEKING_CanGetStopPos          = $10;
  412.   AM_SEEKING_CanGetDuration         = $20;
  413.   AM_SEEKING_CanPlayBackwards       = $40;
  414.   AM_SEEKING_CanDoSegments          = $80;
  415.   AM_SEEKING_Source                 = $100;
  416.  
  417. type
  418.   IMediaSeeking = interface(IUnknown)
  419.     ['{36B73880-C2C8-11CF-8B46-00805F6CEF60}']
  420.     function GetCapabilities(var pCapabilities: DWORD): HResult; stdcall;
  421.     function CheckCapabilities(var pCapabilities: DWORD): HResult; stdcall;
  422.     function IsFormatSupported(const pFormat: TGUID): HResult; stdcall;
  423.     function QueryPreferredFormat(var pFormat: TGUID): HResult; stdcall;
  424.     function GetTimeFormat(var pFormat: TGUID): HResult; stdcall;
  425.     function IsUsingTimeFormat(const pFormat: TGUID): HResult; stdcall;
  426.     function SetTimeFormat(const pFormat: TGUID): HResult; stdcall;
  427.     function GetDuration(var pDuration: LONGLONG): HResult; stdcall;
  428.     function GetStopPosition(var pStop: LONGLONG): HResult; stdcall;
  429.     function GetCurrentPosition(var pCurrent: LONGLONG): HResult; stdcall;
  430.     function ConvertTimeFormat(var pTarget: LONGLONG; const pTargetFormat: TGUID;
  431.         Source: LONGLONG; const pSourceFormat: TGUID): HResult; stdcall;
  432.     function SetPositions(var pCurrent: LONGLONG; dwCurrentFlags: DWORD;
  433.         var pStop: LONGLONG; dwStopFlags: DWORD): HResult; stdcall;
  434.     function GetPositions(var pCurrent, pStop: LONGLONG): HResult; stdcall;
  435.     function GetAvailable(var pEarliest, pLatest: LONGLONG): HResult; stdcall;
  436.     function SetRate(dRate: double): HResult; stdcall;
  437.     function GetRate(var pdRate: double): HResult; stdcall;
  438.     function GetPreroll(var pllPreroll: LONGLONG): HResult; stdcall;
  439.   end;
  440.  
  441. const
  442.   AM_MEDIAEVENT_NONOTIFY = $01;
  443.  
  444. type
  445.   TRefFilter = record
  446.     Clsid: TGUID;
  447.     Name: LPWSTR;
  448.   end;
  449.   PRefFilter = ^TRefFilter;
  450.  
  451.   IEnumRegFilters = interface(IUnknown)
  452.     ['{56A868A4-0AD4-11CE-B03A-0020AF0BA770}']
  453.     function Next(cFilters: ULONG; var apRegFilter: PRefFilter;
  454.         var pcFetched: ULONG): HResult; stdcall;
  455.     function Skip(cFilters: ULONG): HResult; stdcall;
  456.     function Reset: HResult; stdcall;
  457.     function Clone(out ppEnum: IEnumRegFilters): HResult; stdcall;
  458.   end;
  459.  
  460. const
  461.   MERIT_PREFERRED       = $800000;
  462.   MERIT_NORMAL          = $600000;
  463.   MERIT_UNLIKELY        = $400000;
  464.   MERIT_DO_NOT_USE      = $200000;
  465.   MERIT_SW_COMPRESSOR   = $100000;
  466.   MERIT_HW_COMPRESSOR   = $100050;
  467.  
  468. type
  469.   IFilterMapper = interface(IUnknown)
  470.     ['{56A868A3-0AD4-11CE-B03A-0020AF0BA770}']
  471.     function RegisterFilter(const clsid: TGUID; Name: LPCWSTR; dwMerit: DWORD): HResult; stdcall;
  472.     function RegisterFilterInstance(const clsid: TGUID; Name: LPCWSTR;
  473.         var MRId: TGUID): HResult; stdcall;
  474.     function RegisterPin(const Filter: TGUID; Name: LPCWSTR;
  475.         bRendered, bOutput, bZero, bMany: BOOL; const ConnectsToFilter: TGUID;
  476.         ConnectsToPin: LPCWSTR): HResult; stdcall;
  477.     function RegisterPinType(const clsFilter: TGUID; strName: LPCWSTR;
  478.         const clsMajorType, clsSubType: TGUID): HResult; stdcall;
  479.     function UnregisterFilter(const Filter: TGUID): HResult; stdcall;
  480.     function UnregisterFilterInstance(const MRId: TGUID): HResult; stdcall;
  481.     function UnregisterPin(const Filter: TGUID; Name: LPCWSTR): HResult; stdcall;
  482.     function EnumMatchingFilters(out ppEnum: IEnumRegFilters; dwMerit: DWORD;
  483.         bInputNeeded: BOOL; const clsInMaj, clsInSub: TGUID;
  484.         bRender, bOututNeeded: BOOL; const clsOutMaj, clsOutSub: TGUID): HResult; stdcall;
  485.   end;
  486.  
  487.   PRefInTypes = ^TRefInTypes;
  488.   TRefInTypes = record
  489.     clsMajorType: PGUID;
  490.     clsMinorType: PGUID;
  491.   end;
  492.  
  493.   PRegFilterPins = ^TRegFilterPins;
  494.   TRegFilterPins = record
  495.     strName: LPWSTR;
  496.     bRendered: BOOL;
  497.     bOutput: BOOL;
  498.     bZero: BOOL;
  499.     bMany: BOOL;
  500.     oFilter: PGUID;
  501.     strConnectsToPin: PWCHAR;
  502.     nMediaTypes: UINT;
  503.     lpMediaType: PRefInTypes;
  504.   end;
  505.  
  506.   PRegPinMedium = ^TRegPinMedium;
  507.   TRegPinMedium = record
  508.     clsMedium: TGUID;
  509.     dw1: DWORD;
  510.     dw2: DWORD;
  511.   end;
  512.  
  513. const
  514.   REG_PINFLAG_B_ZERO     = $1;
  515.   REG_PINFLAG_B_RENDERER = $2;
  516.   REG_PINFLAG_B_MANY     = $4;
  517.   REG_PINFLAG_B_OUTPUT   = $8;
  518.  
  519. type
  520.   PRegFilterPins2 = ^TRegFilterPins2;
  521.   TRegFilterPins2 = record
  522.     dwFlags: DWORD;
  523.     cInstances: UINT;
  524.     nMediaTypes: UINT;
  525.     lpMediaType: PRefInTypes;
  526.     lpMedium: PRegPinMedium;
  527.     clsPinCategory: PGUID;
  528.   end;
  529.  
  530.   TRegFilter2 = record
  531.     dwVersion: DWORD;
  532.     dwMerit: DWORD;
  533.     case Integer of
  534.       0: (
  535.         cPins: ULONG;
  536.         cPins2: ULONG;
  537.       );
  538.       1: (
  539.         rgPins: PRegFilterPins;
  540.         rgPins2: PRegFilterPins2;
  541.       );
  542.   end;
  543.  
  544.   IFilterMapper2 = interface(IUnknown)
  545.     ['{B79BB0B0-33C1-11D1-ABE1-00A0C905F375}']
  546.     function CreateCategory(const clsidCategory: TGUID; dwCategoryMerit: DWORD;
  547.         Description: LPCWSTR): HResult; stdcall;
  548.     function UnregisterFilter(const pclsidCategory: TGUID;
  549.         szInstance: PWCHAR; const Filter: TGUID): HResult; stdcall;
  550.     function RegisterFilter(const clsidFilter: TGUID; Name: LPCWSTR;
  551.         out ppMoniker: IMoniker; const pclsidCategory: TGUID;
  552.         szInstance: PWCHAR; const prf2: TRegFilter2): HResult; stdcall;
  553.  
  554.     function EnumMatchingFilters(out ppEnum: IEnumMoniker; dwFlags: DWORD;
  555.         bExactMatch: BOOL; dwMerit: DWORD; bInputNeeded: BOOL; cInputTypes: DWORD;
  556.         const pInputTypes, pPinCategoryIn: TGUID; bRender, bOutputNeeded: BOOL;
  557.         cOutputTypes: DWORD; const pMedOut: TRegPinMedium;
  558.         const pPinCategoryOut: TGUID): HResult; stdcall;
  559.   end;
  560.  
  561.   TQualityMessageType = (
  562.     Famine,
  563.     Flood
  564.   );
  565.  
  566.   TQuality = record
  567.     Typ: TQualityMessageType;
  568.     Proportion: Longint;
  569.     Late: TReference_Time;
  570.     TimeStamp: TReference_Time;
  571.   end;
  572.  
  573.   IQualityControl = interface(IUnknown)
  574.     ['{56A868A5-0AD4-11CE-B03A-0020AF0BA770}']
  575.     function Notify(pSelf: IBaseFilter; q: TQuality): HResult; stdcall;
  576.     function SetSink(piqc: IQualityControl): HResult; stdcall;
  577.   end;
  578.  
  579. const
  580.   CK_NOCOLORKEY = $0;
  581.   CK_INDEX      = $1;
  582.   CK_RGB        = $2;
  583.  
  584. type
  585.   TColorKey = record
  586.     KeyType: DWORD;
  587.     PaletteIndex: DWORD;
  588.     LowColorValue: COLORREF;
  589.     HighColorValue: COLORREF;
  590.   end;
  591.  
  592. const
  593.   ADVISE_NONE       = 0;
  594.   ADVISE_CLIPPING   = $1;
  595.   ADVISE_PALETTE    = $2;
  596.   ADVISE_COLORKEY   = $4;
  597.   ADVISE_POSITION   = $8;
  598.  
  599.   ADVISE_ALL = ADVISE_CLIPPING or ADVISE_PALETTE or ADVISE_COLORKEY or ADVISE_POSITION;
  600.  
  601. type
  602.   IOverlayNotify = interface(IUnknown)
  603.     ['{56A868A0-0AD4-11CE-B03A-0020AF0BA770}']
  604.     function OnPaletteChange(dwColors: DWORD; const pPalette): HResult; stdcall;
  605.     function OnClipChange(const pSourceRect, pDestinationRect: TRect;
  606.         const pRgnData: TRgnData): HResult; stdcall;
  607.     function OnColorKeyChange(const pColorKey: TColorKey): HResult; stdcall;
  608.     function OnPositionChange(const pSourceRect, pDestinationRect: TRect): HResult; stdcall;
  609.   end;
  610.  
  611.   IOverlay = interface(IUnknown)
  612.     ['{56A868A1-0AD4-11CE-B03A-0020AF0BA770}']
  613.     function GetPalette(var pdwColors: DWORD; var ppPalette): HResult; stdcall;
  614.     function SetPalette(dwColors: DWORD; const pPalette): HResult; stdcall;
  615.     function GetDefaultColorKey(var pColorKey: TColorKey): HResult; stdcall;
  616.     function GetColorKey(var pColorKey: TColorKey): HResult; stdcall;
  617.     function SetColorKey(const pColorKey: TColorKey): HResult; stdcall;
  618.     function GetWindowHandle(var pHwnd: HWND): HResult; stdcall;
  619.     function GetClipList(var pSourceRect, pDestinationRect: TRect;
  620.         var ppRgnData: PRgnData): HResult; stdcall;
  621.     function GetVideoPosition(var pSourceRect, pDestinationRect: TRect): HResult; stdcall;
  622.     function Advise(pOverlayNotify: IOverlayNotify; dwInterests: DWORD): HResult; stdcall;
  623.     function Unadvise: HResult; stdcall;
  624.   end;
  625.  
  626.   IMediaEventSink = interface(IUnknown)
  627.     ['{56A868A2-0AD4-11CE-B03A-0020AF0BA770}']
  628.     function Notify(EventCode, EventParam1, EventParam2: Longint): HResult; stdcall;
  629.   end;
  630.  
  631.   IFileSourceFilter = interface(IUnknown)
  632.     ['{56A868A6-0AD4-11CE-B03A-0020AF0BA770}']
  633.     function Load(pszFileName: PWCHAR; const pmt: TAM_Media_Type): HResult; stdcall;
  634.     function GetCurFile(var ppszFileName: POLESTR; out pmt: TAM_Media_Type): HResult; stdcall;
  635.   end;
  636.  
  637.   IFileSinkFilter = interface(IUnknown)
  638.     ['{A2104830-7C70-11CF-8BCE-00AA00A3F1A6}']
  639.     function SetFileName(pszFileName: POLESTR; const pmt: TAM_Media_Type): HResult; stdcall;
  640.     function GetCurFile(var ppszFileName: POLESTR; out pmt: TAM_Media_Type): HResult; stdcall;
  641.   end;
  642.  
  643.   IFileSinkFilter2 = interface(IFileSinkFilter)
  644.     ['{00855B90-CE1B-11D0-BD4F-00A0C911CE86}']
  645.     function SetMode(dwFlags: DWORD): HResult; stdcall;
  646.     function GetMode(var pdwFlags: DWORD): HResult; stdcall;
  647.   end;
  648.  
  649.   TAM_FileSink_Flags = (
  650.     AM_FILE_INVALID_0,
  651.     AM_FILE_OVERWRITE
  652.   );
  653.  
  654.   PAsyncIOReq = ^TAsyncIOReq;
  655.   TAsyncIOReq = record
  656.     engine: array[0..3] of DWORD;
  657.     lpv: Pointer;
  658.     cb: DWORD;
  659.     dwError: DWORD;
  660.     cbDone: DWORD;
  661.     liPos: TLargeInteger;
  662.     hEvent: DWORD;
  663.     dwUser: DWORD;
  664.   end;
  665.  
  666.   IFileAsyncIO = interface(IUnknown)
  667.     ['{56A868A7-0AD4-11CE-B03A-0020AF0BA770}']
  668.     function QueryAlignment(var pdwAlign: DWORD): HResult; stdcall;
  669.     function Read(const pReq: TAsyncIOReq): HResult; stdcall;
  670.     function Write(const pReq: TAsyncIOReq): HResult; stdcall;
  671.     function WaitForNext(var ppReq: PAsyncIOReq;
  672.         dwTimeout: DWORD): HResult; stdcall;
  673.     function WaitForSpecific(var pReq: TAsyncIOReq;
  674.         dwTimeout: DWORD): HResult; stdcall;
  675.     function DiscardPending: HResult; stdcall;
  676.     function Flush: HResult; stdcall;
  677.   end;
  678.  
  679.   IGraphBuilder = interface(IFilterGraph)
  680.     ['{56A868A9-0AD4-11CE-B03A-0020AF0BA770}']
  681.     function Connect(ppinOut, ppinIn: IPin): HResult; stdcall;
  682.     function Render(ppinOut: IPin): HResult; stdcall;
  683.     function RenderFile(lpcwstrFile, lpcwstrPlayList: LPCWSTR): HResult; stdcall;
  684.     function AddSourceFilter(lpcwstrFileName, lpcwstrFilterName: LPCWSTR;
  685.         out ppFilter: IBaseFilter): HResult; stdcall;
  686.     function SetLogFile(hFile: THandle): HResult; stdcall;
  687.     function Abort: HResult; stdcall;
  688.     function ShouldOperationContinue: HResult; stdcall;
  689.   end;
  690.  
  691.   IAMCopyCaptureFileProgress = interface;
  692.  
  693.   ICaptureGraphBuilder = interface(IUnknown)
  694.     ['{BF87B6E0-8C27-11D0-B3F0-00AA003761C5}']
  695.     function SetFiltergraph(pfg: IGraphBuilder): HResult; stdcall;
  696.     function GetFiltergraph(out ppfg: IGraphBuilder): HResult; stdcall;
  697.     function SetOutputFileName(const pType: TGUID; lpstrFile: PWCHAR;
  698.         out ppf: IBaseFilter; out ppSink: IFileSinkFilter): HResult; stdcall;
  699.     function FindInterface(const pCategory: TGUID; pf: IBaseFilter;
  700.         const riid: TGUID; out ppint): HResult; stdcall;
  701.     function RenderStream(const pCategory: TGUID; pSource: IUnknown;
  702.         pfCompressor, pfRenderer: IBaseFilter): HResult; stdcall;
  703.     function ControlStream(const pCategory: TGUID; pFilter: IBaseFilter;
  704.         const pstart, pstop: TReference_Time; wStartCookie, wStopCookie: WORD): HResult; stdcall;
  705.     function AllocCapFile(lpstr: PWCHAR; dwlSize: LONGLONG): HResult; stdcall;
  706.     function CopyCaptureFile(lpwstrOld, lpwstrNew: PWCHAR; fAllowEscAbort: Integer;
  707.         pCallback: IAMCopyCaptureFileProgress): HResult; stdcall;
  708.   end;
  709.  
  710.   IAMCopyCaptureFileProgress = interface(IUnknown)
  711.     ['{670D1D20-A068-11D0-B3F0-00AA003761C5}']
  712.     function Progress(iProgress: Integer): HResult; stdcall;
  713.   end;
  714.  
  715. const
  716.   AM_RENDEREX_RENDERTOEXISTINGRENDERERS = $01;
  717.  
  718. type
  719.   IFilterGraph2 = interface(IGraphBuilder)
  720.     ['{36B73882-C2C8-11CF-8B46-00805F6CEF60}']
  721.     function AddSourceFilterForMoniker(pMoniker: IMoniker; pCtx: IBindCtx;
  722.         lpcwstrFilterName: LPCWSTR; out ppFilter: IBaseFilter): HResult; stdcall;
  723.     function ReconnectEx(ppin: IPin; const pmt: TAM_Media_Type): HResult; stdcall;
  724.     function RenderEx(pPinOut: IPin; dwFlags: DWORD; pvContext: Pointer): HResult; stdcall;
  725.   end;
  726.  
  727.   IStreamBuilder = interface(IUnknown)
  728.     ['{56A868BF-0AD4-11CE-B03A-0020AF0BA770}']
  729.     function Render(ppinOut: IPin; pGraph: IGraphBuilder): HResult; stdcall;
  730.     function Backout(ppinOut: IPin; pGraph: IGraphBuilder): HResult; stdcall;
  731.   end;
  732.  
  733.   IAsyncReader = interface(IUnknown)
  734.     ['{56A868AA-0AD4-11CE-B03A-0020AF0BA770}']
  735.     function RequestAllocator(pPreferred: IMemAllocator;
  736.         const pProps: TAllocator_Properties; out ppActual: IMemAllocator): HResult; stdcall;
  737.     function Request(pSample: IMediaSample; dwUser: DWORD): HResult; stdcall;
  738.     function WaitForNext(dwTimeout: DWORD; out ppSample: IMediaSample;
  739.         var pdwUser: DWORD): HResult; stdcall;
  740.     function SyncReadAligned(pSample: IMediaSample): HResult; stdcall;
  741.     function SyncRead(llPosition: LONGLONG; lLength: Longint; var pBuffer): HResult; stdcall;
  742.     function Length(var pTotal, pAvailable: LONGLONG): HResult; stdcall;
  743.     function BeginFlush: HResult; stdcall;
  744.     function EndFlush: HResult; stdcall;
  745.   end;
  746.  
  747.   IGraphVersion = interface(IUnknown)
  748.     ['{56A868AB-0AD4-11CE-B03A-0020AF0BA770}']
  749.     function QueryVersion(var pVersion: Longint): HResult; stdcall;
  750.   end;
  751.  
  752.   IResourceConsumer = interface(IUnknown)
  753.     ['{56A868AD-0AD4-11CE-B03A-0020AF0BA770}']
  754.     function AcquireResource(idResource: Longint): HResult; stdcall;
  755.     function ReleaseResource(idResource: Longint): HResult; stdcall;
  756.   end;
  757.  
  758.   IResourceManager = interface(IUnknown)
  759.     ['{56A868AC-0AD4-11CE-B03A-0020AF0BA770}']
  760.     function Register(pName: LPCWSTR; cResource: Longint;
  761.         var plToken: Longint): HResult; stdcall;
  762.     function RegisterGroup(pName: LPCWSTR; cResource: Longint;
  763.         const palTokens: Longint; var plToken: Longint): HResult; stdcall;
  764.     function RequestResource(idResource: Longint; pFocusObject: IUnknown;
  765.         pConsumer: IResourceConsumer): HResult; stdcall;
  766.     function NotifyAcquire(idResource: Longint; pConsumer: IResourceConsumer;
  767.         hr: HResult): HResult; stdcall;
  768.     function NotifyRelease(idResource: Longint; pConsumer: IResourceConsumer;
  769.         bStillWant: BOOL): HResult; stdcall;
  770.     function CancelRequest(idResource: Longint; pConsumer: IResourceConsumer): HResult; stdcall;
  771.     function SetFocus(pFocusObject: IUnknown): HResult; stdcall;
  772.     function ReleaseFocus(pFocusObject: IUnknown): HResult; stdcall;
  773.   end;
  774.  
  775.   IDistributorNotify = interface(IUnknown)
  776.     ['{56A868AF-0AD4-11CE-B03A-0020AF0BA770}']
  777.     function Stop: HResult; stdcall;
  778.     function Pause: HResult; stdcall;
  779.     function Run(tStart: TReference_Time): HResult; stdcall;
  780.     function SetSyncSource(pClock: IReferenceClock): HResult; stdcall;
  781.     function NotifyGraphChange: HResult; stdcall;
  782.   end;
  783.  
  784. const
  785.   AM_STREAM_INFO_START_DEFINED   = $1;
  786.   AM_STREAM_INFO_STOP_DEFINED    = $2;
  787.   AM_STREAM_INFO_DISCARDING      = $4;
  788.   AM_STREAM_INFO_STOP_SEND_EXTRA = $10;
  789.  
  790. type
  791.   {TAM_Stream_Info_Flags = (
  792.     AM_STREAM_INFO_INVALID_0,
  793.     AM_STREAM_INFO_START_DEFINED,
  794.     AM_STREAM_INFO_INVALID_1,
  795.     AM_STREAM_INFO_STOP_DEFINED,
  796.     AM_STREAM_INFO_INVALID_3,
  797.     AM_STREAM_INFO_DISCARDING,
  798.     AM_STREAM_INFO_INVALID_4,
  799.     AM_STREAM_INFO_INVALID_5,
  800.     AM_STREAM_INFO_INVALID_6,
  801.     AM_STREAM_INFO_INVALID_7,
  802.     AM_STREAM_INFO_INVALID_8,
  803.     AM_STREAM_INFO_INVALID_9,
  804.     AM_STREAM_INFO_INVALID_10,
  805.     AM_STREAM_INFO_INVALID_11,
  806.     AM_STREAM_INFO_INVALID_12,
  807.     AM_STREAM_INFO_INVALID_13,
  808.     AM_STREAM_INFO_INVALID_14,
  809.     AM_STREAM_INFO_INVALID_15,
  810.     AM_STREAM_INFO_STOP_SEND_EXTRA
  811.   );
  812.       }
  813.   TAM_Stream_Info = record
  814.     tStart: TReference_Time;
  815.     tStop: TReference_Time;
  816.     dwStartCookie: DWORD;
  817.     dwStopCookie: DWORD;
  818.     dwFlags: DWORD;
  819.   end;
  820.  
  821.   IAMStreamControl = interface(IUnknown)
  822.     ['{36b73881-c2c8-11cf-8b46-00805f6cef60}']
  823.     function StartAt(const ptStart: TReference_Time; dwCookie: DWORD): HResult; stdcall;
  824.     function StopAt(const ptStop: TReference_Time; bSendExtra: BOOL;
  825.         dwCookie: DWORD): HResult; stdcall;
  826.     function GetInfo(out pInfo: TAM_Stream_Info): HResult; stdcall;
  827.   end;
  828.  
  829.   ISeekingPassThru = interface(IUnknown)
  830.     ['{36B73883-C2C8-11CF-8B46-00805F6CEF60}']
  831.     function Init(bSupportRendering: BOOL; pPin: IPin): HResult; stdcall;
  832.   end;
  833.  
  834.   TVideo_Stream_Config_Caps = record
  835.     guid: TGUID;
  836.     VideoStandard: ULONG;
  837.     InputSize: TSize;
  838.     MinCroppingSize: TSize;
  839.     MaxCroppingSize: TSize;
  840.     CropGranularityX: Integer;
  841.     CropGranularityY: Integer;
  842.     CropAlignX: Integer;
  843.     CropAlignY: Integer;
  844.     MinOutputSize: TSize;
  845.     MaxOutputSize: TSize;
  846.     OutputGranularityX: Integer;
  847.     OutputGranularityY: Integer;
  848.     StretchTapsX: Integer;
  849.     StretchTapsY: Integer;
  850.     ShrinkTapsX: Integer;
  851.     ShrinkTapsY: Integer;
  852.     MinFrameInterval: LONGLONG;
  853.     MaxFrameInterval: LONGLONG;
  854.     MinBitsPerSecond: Longint;
  855.     MaxBitsPerSecond: Longint;
  856.   end;
  857.  
  858.   TAudio_Stream_Config_Caps = record
  859.     guid: TGUID;
  860.     MinimumChannels: ULONG;
  861.     MaximumChannels: ULONG;
  862.     ChannelsGranularity: ULONG;
  863.     MinimumBitsPerSample: ULONG;
  864.     MaximumBitsPerSample: ULONG;
  865.     BitsPerSampleGranularity: ULONG;
  866.     MinimumSampleFrequency: ULONG;
  867.     MaximumSampleFrequency: ULONG;
  868.     SampleFrequencyGranularity: ULONG;
  869.   end;
  870.  
  871.   IAMStreamConfig = interface(IUnknown)
  872.     ['{C6E13340-30AC-11d0-A18C-00A0C9118956}']
  873.     function SetFormat(const pmt: TAM_Media_Type): HResult; stdcall;
  874.     function GetFormat(var ppmt: PAM_Media_Type): HResult; stdcall;
  875.     function GetNumberOfCapabilities(var piCount, piSize: Integer): HResult; stdcall;
  876.     function GetStreamCaps(iIndex: Integer; var ppmt: PAM_Media_Type;
  877.         var pSCC): HResult; stdcall;
  878.   end;
  879.  
  880.   TInterleavingMode = (
  881.     INTERLEAVE_NONE,
  882.     INTERLEAVE_CAPTURE,
  883.     INTERLEAVE_FULL
  884.   );
  885.  
  886.   IConfigInterleaving = interface(IUnknown)
  887.     ['{BEE3D220-157B-11d0-BD23-00A0C911CE86}']
  888.     function put_Mode(mode: TInterleavingMode): HResult; stdcall;
  889.     function get_Mode(var pMode: TInterleavingMode): HResult; stdcall;
  890.     function put_Interleaving(const prtInterleave, prtPreroll: TReference_Time): HResult; stdcall;
  891.     function get_Interleaving(var prtInterleave, prtPreroll: TReference_Time): HResult; stdcall;
  892.   end;
  893.  
  894.   IConfigAviMux = interface(IUnknown)
  895.     ['{5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6}']
  896.     function SetMasterStream(iStream: Longint): HResult; stdcall;
  897.     function GetMasterStream(var pStream: Longint): HResult; stdcall;
  898.     function SetOutputCompatibilityIndex(fOldIndex: BOOL): HResult; stdcall;
  899.     function GetOutputCompatibilityIndex(var pfOldIndex: BOOL): HResult; stdcall;
  900.   end;
  901.  
  902. const
  903.   CompressionCaps_CanQuality    = $1;
  904.   CompressionCaps_CanCrunch     = $2;
  905.   CompressionCaps_CanKeyFrame   = $4;
  906.   CompressionCaps_CanBFrame     = $8;
  907.   CompressionCaps_CanWindow     = $10;
  908.  
  909. type
  910.   IAMVideoCompression = interface(IUnknown)
  911.     ['{C6E13343-30AC-11d0-A18C-00A0C9118956}']
  912.     function put_KeyFrameRate(KeyFrameRate: Longint): HResult; stdcall;
  913.     function get_KeyFrameRate(pKeyFrameRate: Longint): HResult; stdcall;
  914.     function put_PFramesPerKeyFrame(PFramesPerKeyFrame: Longint): HResult; stdcall;
  915.     function get_PFramesPerKeyFrame(var pPFramesPerKeyFrame: Longint): HResult; stdcall;
  916.     function put_Quality(Quality: double): HResult; stdcall;
  917.     function get_Quality(var pQuality: double): HResult; stdcall;
  918.     function put_WindowSize(WindowSize: LONGLONG): HResult; stdcall;
  919.     function get_WindowSize(var pWindowSize: LONGLONG): HResult; stdcall;
  920.     function GetInfo(pszVersion: PWCHAR; var pcbVersion: Integer;
  921.         pszDescription: LPWSTR; var pcbDescription: Integer;
  922.         var pDefaultKeyFrameRate, pDefaultPFramesPerKey: Longint;
  923.         var pDefaultQuality: double; pCapabilities: Longint): HResult; stdcall;
  924.     function OverrideKeyFrame(FrameNumber: Longint): HResult; stdcall;
  925.     function OverrideFrameSize(FrameNumber, Size: Longint): HResult; stdcall;
  926.   end;
  927.  
  928. const
  929.   VfwCaptureDialog_Source  = $1;
  930.   VfwCaptureDialog_Format  = $2;
  931.   VfwCaptureDialog_Display = $4;
  932.  
  933.   VfwCompressDialog_Config = $1;
  934.   VfwCompressDialog_About  = $2;
  935.  
  936. type
  937.   IAMVfwCaptureDialogs = interface(IUnknown)
  938.     ['{D8D715A0-6E5E-11D0-B3F0-00AA003761C5}']
  939.     function HasDialog(iDialog: Integer): HResult; stdcall;
  940.     function ShowDialog(iDialog: Integer; hwnd: HWND): HResult; stdcall;
  941.     function SendDriverMessage(iDialog: Integer; uMsg: Integer;
  942.         dw1, dw2: Longint): HResult; stdcall;
  943.   end;
  944.  
  945.   IAMVfwCompressDialogs = interface(IUnknown)
  946.     ['{D8D715A3-6E5E-11D0-B3F0-00AA003761C5}']
  947.     function ShowDialog(iDialog: Integer; hwnd: HWND): HResult; stdcall;
  948.     function GetState(var pState; var pcbState: Integer): HResult; stdcall;
  949.     function SetState(const pState; cbState: Integer): HResult; stdcall;
  950.     function SendDriverMessage(uMsg: Integer; dw1, dw2: Longint): HResult; stdcall;
  951.   end;
  952.  
  953.   IAMDroppedFrames = interface(IUnknown)
  954.     ['{C6E13344-30AC-11d0-A18C-00A0C9118956}']
  955.     function GetNumDropped(var plDropped: Longint): HResult; stdcall;
  956.     function GetNumNotDropped(var plNotDropped: Longint): HResult; stdcall;
  957.     function GetDroppedInfo(lSize: Longint; var plArray: Longint;
  958.         var plNumCopied: Longint): HResult; stdcall;
  959.     function GetAverageFrameSize(var plAverageSize: Longint): HResult; stdcall;
  960.   end;
  961.  
  962. const
  963.   AMF_AUTOMATICGAIN = -1;
  964.  
  965. type
  966.   IAMAudioInputMixer = interface(IUnknown)
  967.     ['{54C39221-8380-11d0-B3F0-00AA003761C5}']
  968.     function put_Enable(fEnable: BOOL): HResult; stdcall;
  969.     function get_Enable(var pfEnable: BOOL): HResult; stdcall;
  970.     function put_Mono(fMono: BOOL): HResult; stdcall;
  971.     function get_Mono(var pfMono: BOOL): HResult; stdcall;
  972.     function put_MixLevel(Level: double): HResult; stdcall;
  973.     function get_MixLevel(var pLevel: double): HResult; stdcall;
  974.     function put_Pan(Pan: double): HResult; stdcall;
  975.     function get_Pan(var pPan: double): HResult; stdcall;
  976.     function put_Loudness(fLoudness: BOOL): HResult; stdcall;
  977.     function get_Loudness(var pfLoudness: BOOL): HResult; stdcall;
  978.     function put_Treble(Treble: double): HResult; stdcall;
  979.     function get_Treble(var pTreble: double): HResult; stdcall;
  980.     function get_TrebleRange(var pRange: double): HResult; stdcall;
  981.     function put_Bass(Bass: double): HResult; stdcall;
  982.     function get_Bass(var pBass: double): HResult; stdcall;
  983.     function get_BassRange(var pRange: double): HResult; stdcall;
  984.   end;
  985.  
  986.   IAMBufferNegotiation = interface(IUnknown)
  987.     ['{56ED71A0-AF5F-11D0-B3F0-00AA003761C5}']
  988.     function SuggestAllocatorProperties(const pprop: TAllocator_Properties): HResult; stdcall;
  989.     function GetAllocatorProperties(var pprop: TAllocator_Properties): HResult; stdcall;
  990.   end;
  991.  
  992. const
  993.   AnalogVideo_None        = 0;
  994.   AnalogVideo_NTSC_M      = $1;
  995.   AnalogVideo_NTSC_M_J    = $2;
  996.   AnalogVideo_NTSC_433    = $4;
  997.   AnalogVideo_PAL_B       = $10;
  998.   AnalogVideo_PAL_D       = $20;
  999.   AnalogVideo_PAL_G       = $40;
  1000.   AnalogVideo_PAL_H       = $80;
  1001.   AnalogVideo_PAL_I       = $100;
  1002.   AnalogVideo_PAL_M       = $200;
  1003.   AnalogVideo_PAL_N       = $400;
  1004.   AnalogVideo_PAL_60      = $800;
  1005.   AnalogVideo_SECAM_B     = $1000;
  1006.   AnalogVideo_SECAM_D     = $2000;
  1007.   AnalogVideo_SECAM_G     = $4000;
  1008.   AnalogVideo_SECAM_H     = $8000;
  1009.   AnalogVideo_SECAM_K     = $10000;
  1010.   AnalogVideo_SECAM_K1    = $20000;
  1011.   AnalogVideo_SECAM_L     = $40000;
  1012.   AnalogVideo_SECAM_L1    = $80000;
  1013.  
  1014.   AnalogVideo_NTSC_Mask   = $00000007;
  1015.   AnalogVideo_PAL_Mask    = $00000FF0;
  1016.   AnalogVideo_SECAM_Mask  = $000FF000;
  1017.  
  1018. type
  1019.   TTunerInputType =(
  1020.     TunerInputCable,
  1021.     TunerInputAntenna
  1022.   );
  1023.  
  1024.   TVideoCopyProtectionType = (
  1025.     VideoCopyProtectionMacrovisionBasic,
  1026.     VideoCopyProtectionMacrovisionCBI
  1027.   );
  1028.  
  1029.   TPhysicalConnectorType = (
  1030.     PhysConn_Video_Tuner,
  1031.     PhysConn_Video_Composite,
  1032.     PhysConn_Video_SVideo,
  1033.     PhysConn_Video_RGB,
  1034.     PhysConn_Video_YRYBY,
  1035.     PhysConn_Video_SerialDigital,
  1036.     PhysConn_Video_ParallelDigital,
  1037.     PhysConn_Video_SCSI,
  1038.     PhysConn_Video_AUX,
  1039.     PhysConn_Video_1394,
  1040.     PhysConn_Video_USB,
  1041.     PhysConn_Video_VideoDecoder,
  1042.     PhysConn_Video_VideoEncoder,
  1043.     PhysConn_Video_SCART,
  1044.     PhysConn_Video_Black,
  1045.     PhysConn_Audio_Tuner,
  1046.     PhysConn_Audio_Line,
  1047.     PhysConn_Audio_Mic,
  1048.     PhysConn_Audio_AESDigital,
  1049.     PhysConn_Audio_SPDIFDigital,
  1050.     PhysConn_Audio_SCSI,
  1051.     PhysConn_Audio_AUX,
  1052.     PhysConn_Audio_1394,
  1053.     PhysConn_Audio_USB,
  1054.     PhysConn_Audio_AudioDecoder
  1055.   );
  1056.  
  1057.   IAMAnalogVideoDecoder = interface(IUnknown)
  1058.     ['{C6E13350-30AC-11d0-A18C-00A0C9118956}']
  1059.     function get_AvailableTVFormats(var lAnalogVideoStandard: Longint): HResult; stdcall;
  1060.     function put_TVFormat(lAnalogVideoStandard: Longint): HResult; stdcall;
  1061.     function get_TVFormat(var plAnalogVideoStandard: Longint): HResult; stdcall;
  1062.     function get_HorizontalLocked(var plLocked: Longint): HResult; stdcall;
  1063.     function put_VCRHorizontalLocking(lVCRHorizontalLocking: Longint): HResult; stdcall;
  1064.     function get_VCRHorizontalLocking(var plVCRHorizontalLocking: Longint): HResult; stdcall;
  1065.     function get_NumberOfLines(var plNumberOfLines: Longint): HResult; stdcall;
  1066.     function put_OutputEnable(lOutputEnable: LongBool): HResult; stdcall;
  1067.     function get_OutputEnable(var plOutputEnable: LongBool): HResult; stdcall;
  1068.   end;
  1069.  
  1070.   TVideoProcAmpProperty = (
  1071.     VideoProcAmp_Brightness,
  1072.     VideoProcAmp_Contrast,
  1073.     VideoProcAmp_Hue,
  1074.     VideoProcAmp_Saturation,
  1075.     VideoProcAmp_Sharpness,
  1076.     VideoProcAmp_Gamma,
  1077.     VideoProcAmp_ColorEnable,
  1078.     VideoProcAmp_WhiteBalance,
  1079.     VideoProcAmp_BacklightCompensation
  1080.   );
  1081.  
  1082.   TVideoProcAmpFlags = (
  1083.     VideoProcAmp_Flags_Manual,
  1084.     VideoProcAmp_Flags_Auto
  1085.   );
  1086.  
  1087.   IAMVideoProcAmp = interface(IUnknown)
  1088.     ['{C6E13360-30AC-11d0-A18C-00A0C9118956}']
  1089.     function GetRange(Property_: TVideoProcAmpProperty;
  1090.         var pMin, pMax, pSteppingDelta, pDefault, pCapsFlags: TVideoProcAmpFlags): HResult; stdcall;
  1091.     function Set_(Property_: TVideoProcAmpProperty; lValue: Longint;
  1092.         Flags: TVideoProcAmpFlags): HResult; stdcall;
  1093.     function Get(Property_: TVideoProcAmpProperty; var lValue: Longint;
  1094.         var Flags: TVideoProcAmpFlags): HResult; stdcall;
  1095.   end;
  1096.  
  1097.   TCameraControlProperty = (
  1098.     CameraControl_Pan,
  1099.     CameraControl_Tilt,
  1100.     CameraControl_Roll,
  1101.     CameraControl_Zoom,
  1102.     CameraControl_Exposure,
  1103.     CameraControl_Iris,
  1104.     CameraControl_Focus
  1105.   );
  1106.  
  1107.   TCameraControlFlags = (
  1108.     CameraControl_Flags_Manual,
  1109.     CameraControl_Flags_Auto
  1110.   );
  1111.  
  1112.   IAMCameraControl = interface(IUnknown)
  1113.     ['{C6E13370-30AC-11d0-A18C-00A0C9118956}']
  1114.     function GetRange(Property_: TCameraControlProperty;
  1115.         var pMin, pMax, pSteppingDelta, pDefault, pCapsFlags: Longint): HResult; stdcall;
  1116.     function Set_(Property_: TCameraControlProperty; lValue: Longint;
  1117.         Flags: TCameraControlFlags): HResult; stdcall;
  1118.     function Get(Property_: TCameraControlProperty; var lValue: Longint;
  1119.         var Flags: TCameraControlFlags): HResult; stdcall;
  1120.   end;
  1121.  
  1122.   IAMCrossbar = interface(IUnknown)
  1123.     ['{C6E13380-30AC-11d0-A18C-00A0C9118956}']
  1124.     function get_PinCounts(var OutputPinCount, InputPinCount: Longint): HResult; stdcall;
  1125.     function CanRoute(OutputPinIndex, InputPinIndex: Longint): HResult; stdcall;
  1126.     function Route(OutputPinIndex, InputPinIndex: Longint): HResult; stdcall;
  1127.     function get_IsRoutedTo(OutputPinIndex: Longint;
  1128.         var InputPinIndex: Longint): HResult; stdcall;
  1129.     function get_CrossbarPinInfo(IsInputPin: BOOL; PinIndex: Longint;
  1130.         var PinIndexRelated, PhysicalType: Longint): HResult; stdcall;
  1131.   end;
  1132.  
  1133. const
  1134.   AMTUNER_SUBCHAN_NO_TUNE = -2;
  1135.   AMTUNER_SUBCHAN_DEFAULT = -1;
  1136.  
  1137.   AMTUNER_HASNOSIGNALSTRENGTH = -1;
  1138.   AMTUNER_NOSIGNAL            = 0;
  1139.   AMTUNER_SIGNALPRESENT       = 1;
  1140.  
  1141.   AMTUNER_MODE_DEFAULT    = 0;
  1142.   AMTUNER_MODE_TV         = $1;
  1143.   AMTUNER_MODE_FM_RADIO   = $2;
  1144.   AMTUNER_MODE_AM_RADIO   = $4;
  1145.   AMTUNER_MODE_DSS        = $8;
  1146.  
  1147. type
  1148.   TAMTunerModeType = DWORD;
  1149.  
  1150.   TAMTunerEventType = (
  1151.     AMTUNER_EVENT_CHANGED
  1152.   );
  1153.   //AMTUNER_EVENT_CHANGED   = $1;
  1154.  
  1155.   IAMTunerNotification = interface;
  1156.  
  1157.   IAMTuner = interface(IUnknown)
  1158.     ['{211A8761-03AC-11d1-8D13-00AA00BD8339}']
  1159.     function put_Channel(lChannel, lVideoSubChannel, lAudioSubChannel: Longint): HResult; stdcall;
  1160.     function get_Channel(var lChannel, lVideoSubChannel, lAudioSubChannel: Longint): HResult; stdcall;
  1161.     function ChannelMinMax(var lChannelMin, lChannelMax): HResult; stdcall;
  1162.     function put_CountryCode(lCountryCode: Longint): HResult; stdcall;
  1163.     function get_CountryCode(var lCountryCode: Longint): HResult; stdcall;
  1164.     function put_TuningSpace(lTuningSpace: Longint): HResult; stdcall;
  1165.     function get_TuningSpace(var lTuningSpace: Longint): HResult; stdcall;
  1166.     function Logon(hCurrentUser: THandle): HResult; stdcall;
  1167.     function Logout: HResult; stdcall;
  1168.     function SignalPresent(var plSignalStrength: Longint): HResult; stdcall;
  1169.     function put_Mode(lMode: TAMTunerModeType): HResult; stdcall;
  1170.     function get_Mode(var plMode: TAMTunerModeType): HResult; stdcall;
  1171.     function GetAvailableModes(var plModes: Longint): HResult; stdcall;
  1172.     function RegisterNotificationCallBack(pNotify: IAMTunerNotification;
  1173.         lEvents: Longint): HResult; stdcall;
  1174.     function UnRegisterNotificationCallBack(pNotify: IAMTunerNotification): HResult; stdcall;
  1175.   end;
  1176.  
  1177.   IAMTunerNotification = interface(IUnknown)
  1178.     ['{211A8760-03AC-11d1-8D13-00AA00BD8339}']
  1179.     function OnEvent(Event: TAMTunerEventType): HResult; stdcall;
  1180.   end;
  1181.  
  1182.   IAMTVTuner = interface(IAMTuner)
  1183.     ['{211A8766-03AC-11d1-8D13-00AA00BD8339}']
  1184.     function get_AvailableTVFormats(var lAnalogVideoStandard: Longint): HResult; stdcall;
  1185.     function get_TVFormat(var plAnalogVideoStandard: Longint): HResult; stdcall;
  1186.     function AutoTune(lChannel: Longint; var plFoundSignal: Longint): HResult; stdcall;
  1187.     function StoreAutoTune: HResult; stdcall;
  1188.     function get_NumInputConnections(var plNumInputConnections: Longint): HResult; stdcall;
  1189.     function put_InputType(lIndex: Longint; InputType: TTunerInputType): HResult; stdcall;
  1190.     function get_InputType(lIndex: Longint; var InputType: TTunerInputType): HResult; stdcall;
  1191.     function put_ConnectInput(lIndex: Longint): HResult; stdcall;
  1192.     function get_ConnectInput(var plIndex: Longint): HResult; stdcall;
  1193.     function get_VideoFrequency(var lFreq: Longint): HResult; stdcall;
  1194.     function get_AudioFrequency(var lFreq: Longint): HResult; stdcall;
  1195.   end;
  1196.  
  1197.   IBPCSatelliteTuner = interface(IAMTuner)
  1198.     ['{211A8765-03AC-11d1-8D13-00AA00BD8339}']
  1199.     function get_DefaultSubChannelTypes(var plDefaultVideoType, plDefaultAudioType: Longint): HResult; stdcall;
  1200.     function put_DefaultSubChannelTypes(lDefaultVideoType, lDefaultAudioType: Longint): HResult; stdcall;
  1201.     function IsTapingPermitted: HResult; stdcall;
  1202.   end;
  1203.  
  1204. const
  1205.   AMTVAUDIO_MODE_MONO   = $1;
  1206.   AMTVAUDIO_MODE_STEREO = $2;
  1207.   AMTVAUDIO_MODE_LANG_A = $10;
  1208.   AMTVAUDIO_MODE_LANG_B = $20;
  1209.   AMTVAUDIO_MODE_LANG_C = $40;
  1210.  
  1211. type
  1212.   TAMTVAudioEventType = (
  1213.     AMTVAUDIO_EVENT_CHANGED
  1214.   );
  1215.  
  1216.   IAMTVAudio = interface(IUnknown)
  1217.     ['{83EC1C30-23D1-11d1-99E6-00A0C9560266}']
  1218.     function GetHardwareSupportedTVAudioModes(var plModes: Longint): HResult; stdcall;
  1219.     function GetAvailableTVAudioModes(var plModes: Longint): HResult; stdcall;
  1220.     function get_TVAudioMode(var plMode: Longint): HResult; stdcall;
  1221.     function put_TVAudioMode(lMode: Longint): HResult; stdcall;
  1222.     function RegisterNotificationCallBack(pNotify: IAMTunerNotification;
  1223.         lEvents: Longint): HResult; stdcall;
  1224.     function UnRegisterNotificationCallBack(pNotify: IAMTunerNotification): HResult; stdcall;
  1225.   end;
  1226.  
  1227.   IAMTVAudioNotification = interface(IUnknown)
  1228.     ['{83EC1C33-23D1-11D1-99E6-00A0C9560266}']
  1229.     function OnEvent(Event: TAMTVAudioEventType): HResult; stdcall;
  1230.   end;
  1231.  
  1232.   IAMAnalogVideoEncoder = interface(IUnknown)
  1233.     ['{C6E133B0-30AC-11d0-A18C-00A0C9118956}']
  1234.     function get_AvailableTVFormats(var lAnalogVideoStandard: Longint): HResult; stdcall;
  1235.     function put_TVFormat(lAnalogVideoStandard: Longint): HResult; stdcall;
  1236.     function get_TVFormat(var plAnalogVideoStandard: Longint): HResult; stdcall;
  1237.     function put_CopyProtection(lVideoCopyProtection: Longint): HResult; stdcall;
  1238.     function get_CopyProtection(var lVideoCopyProtection: Longint): HResult; stdcall;
  1239.     function put_CCEnable(lCCEnable: LongBool): HResult; stdcall;
  1240.     function get_CCEnable(var lCCEnable: LongBool): HResult; stdcall;
  1241.   end;
  1242.  
  1243.   TAMProperty_Pin = (
  1244.     AMPROPERTY_PIN_CATEGORY,
  1245.     AMPROPERTY_PIN_MEDIUM
  1246.   );
  1247.  
  1248.   IMediaPropertyBag = interface(IPropertyBag)
  1249.     ['{6025A880-C0D5-11D0-BD4E-00A0C911CE86}']
  1250.     function EnumProperty(iProperty: ULONG; var pvarPropertyName,
  1251.         pvarPropertyValue: Variant): HResult; stdcall;
  1252.   end;
  1253.  
  1254.   IPersistMediaPropertyBag = interface(IPersist)
  1255.      ['{5738E040-B67F-11d0-BD4D-00A0C911CE86}']
  1256.      function InitNew: HResult; stdcall;
  1257.      function Load(pPropBag: IMediaPropertyBag; pErrorLog: IErrorLog): HResult; stdcall;
  1258.      function Save(pPropBag: IMediaPropertyBag; fClearDirty, fSaveAllProperties: BOOL): HResult; stdcall;
  1259.   end;
  1260.  
  1261.   IAMPhysicalPinInfo = interface(IUnknown)
  1262.     ['{F938C991-3029-11CF-8C44-00AA006B6814}']
  1263.     function GetPhysicalType(var pType: Longint; var ppszType: POLESTR): HResult; stdcall;
  1264.   end;
  1265.  
  1266.   IAMExtDevice = interface(IUnknown)
  1267.     ['{B5730A90-1A2C-11CF-8C23-00AA006B6814}']
  1268.     function GetCapability(Capability: Longint; var pValue: Longint; pdblValue: double): HResult; stdcall;
  1269.     function get_ExternalDeviceID(var ppszData: POLESTR): HResult; stdcall;
  1270.     function get_ExternalDeviceVersion(var ppszData: POLESTR): HResult; stdcall;
  1271.     function put_DevicePower(PowerMode: Longint): HResult; stdcall;
  1272.     function get_DevicePower(var pPowerMode: Longint): HResult; stdcall;
  1273.     function Calibrate(hEvent: THandle; Mode: Longint; var pStatus: Longint): HResult; stdcall;
  1274.     function put_DevicePort(DevicePort: Longint): HResult; stdcall;
  1275.     function get_DevicePort(var pDevicePort: Longint): HResult; stdcall;
  1276.   end;
  1277.  
  1278.   IAMExtTransport = interface(IUnknown)
  1279.     ['{A03CD5F0-3045-11CF-8C44-00AA006B6814}']
  1280.     function GetCapability(Capability: Longint; var pValue: Longint; var pdblValue: double): HResult; stdcall;
  1281.     function put_MediaState(State: Longint): HResult; stdcall;
  1282.     function get_MediaState(var pState: Longint): HResult; stdcall;
  1283.     function put_LocalControl(State: Longint): HResult; stdcall;
  1284.     function get_LocalControl(var pState: Longint): HResult; stdcall;
  1285.     function GetStatus(StatusItem: Longint; var pValue: Longint): HResult; stdcall;
  1286.     function GetTransportBasicParameters(Param: Longint; var pValue: Longint; var ppszData: POLESTR): HResult; stdcall;
  1287.     function SetTransportBasicParameters(Param: Longint; Value: Longint; pszData: POLESTR): HResult; stdcall;
  1288.     function GetTransportVideoParameters(Param: Longint; var pValue: Longint): HResult; stdcall;
  1289.     function SetTransportVideoParameters(Param: Longint; Value: Longint): HResult; stdcall;
  1290.     function GetTransportAudioParameters(Param: Longint; var pValue: Longint): HResult; stdcall;
  1291.     function SetTransportAudioParameters(Param: Longint; Value: Longint): HResult; stdcall;
  1292.     function put_Mode(Mode: Longint): HResult; stdcall;
  1293.     function get_Mode(var pMode: Longint): HResult; stdcall;
  1294.     function put_Rate(dblRate: double): HResult; stdcall;
  1295.     function get_Rate(var pdblRate: double): HResult; stdcall;
  1296.     function GetChase(var pEnabled, pOffset: Longint; var phEvent: THandle): HResult; stdcall;
  1297.     function SetChase(Enable, Offset: Longint; hEvent: THandle): HResult; stdcall;
  1298.     function GetBump(var pSpeed, pDuration: Longint): HResult; stdcall;
  1299.     function SetBump(Speed, Duration: Longint): HResult; stdcall;
  1300.     function get_AntiClogControl(var pEnabled: Longint): HResult; stdcall;
  1301.     function put_AntiClogControl(Enable: Longint): HResult; stdcall;
  1302.     function GetEditPropertySet(EditID: Longint; var pState: Longint): HResult; stdcall;
  1303.     function SetEditPropertySet(var pEditID: Longint; State: Longint): HResult; stdcall;
  1304.     function GetEditProperty(EditID, Param: Longint; var pValue: Longint): HResult; stdcall;
  1305.     function SetEditProperty(EditID, Param, Value: Longint): HResult; stdcall;
  1306.     function get_EditStart(var pValue: Longint): HResult; stdcall;
  1307.     function put_EditStart(Value: Longint): HResult; stdcall;
  1308.   end;
  1309.  
  1310.   TTimeCode = record
  1311.     wFrameRate: Word;
  1312.     wFrameFract: Word;
  1313.     dwFrames: DWORD;
  1314.     qw: LONGLONG;
  1315.   end;
  1316.  
  1317.   TTimeCode_Sample = record
  1318.     qwTick: LONGLONG;
  1319.     timecode: TTimeCode;
  1320.     dwUser: DWORD;
  1321.     dwFlags: DWORD;
  1322.   end;
  1323.  
  1324.   IAMTimecodeReader = interface(IUnknown)
  1325.     ['{9B496CE1-811B-11CF-8C77-00AA006B6814}']
  1326.     function GetTCRMode(Param: Longint; var pValue: Longint): HResult; stdcall;
  1327.     function SetTCRMode(Param: Longint; Value: Longint): HResult; stdcall;
  1328.     function put_VITCLine(Line: Longint): HResult; stdcall;
  1329.     function get_VITCLine(var pLine: Longint): HResult; stdcall;
  1330.     function GetTimecode(var pTimecodeSample: TTimeCode_Sample): HResult; stdcall;
  1331.   end;
  1332.  
  1333.   IAMTimecodeGenerator = interface(IUnknown)
  1334.     ['{9B496CE0-811B-11CF-8C77-00AA006B6814}']
  1335.     function GetTCGMode(Param: Longint; var pValue: Longint): HResult; stdcall;
  1336.     function SetTCGMode(Param: Longint; Value: Longint): HResult; stdcall;
  1337.     function put_VITCLine(Line: Longint): HResult; stdcall;
  1338.     function get_VITCLine(var Line: Longint): HResult; stdcall;
  1339.     function SetTimecode(const pTimecodeSample: TTimeCode_Sample): HResult; stdcall;
  1340.     function GetTimecode(var pTimecodeSample: TTimeCode_Sample): HResult; stdcall;
  1341.   end;
  1342.  
  1343.   IAMTimecodeDisplay = interface(IUnknown)
  1344.     ['{9B496CE2-811B-11CF-8C77-00AA006B6814}']
  1345.     function GetTCDisplayEnable(var pState: Longint): HResult; stdcall;
  1346.     function SetTCDisplayEnable(State: Longint): HResult; stdcall;
  1347.     function GetTCDisplay(Param: Longint; var pValue: Longint): HResult; stdcall;
  1348.     function SetTCDisplay(Param, Value: Longint): HResult; stdcall;
  1349.   end;
  1350.  
  1351.   IAMDevMemoryAllocator = interface(IUnknown)
  1352.     ['{C6545BF0-E76B-11D0-BD52-00A0C911CE86}']
  1353.     function GetInfo(var pdwcbTotalFree, pdwcbLargestFree, pdwcbTotalMemory, pdwcbMinimumChunk: DWORD): HResult; stdcall;
  1354.     function CheckMemory(pBuffer: Pointer): HResult; stdcall;
  1355.     function Alloc(var ppBuffer: Pointer; var pdwcbBuffer: DWORD): HResult; stdcall;
  1356.     function Free(pBuffer: Pointer): HResult; stdcall;
  1357.     function GetDevMemoryObject(out ppUnkInnner: IUnknown; pUnkOuter: IUnknown): HResult; stdcall;
  1358.   end;
  1359.  
  1360.   IAMDevMemoryControl = interface(IUnknown)
  1361.     ['{C6545BF1-E76B-11D0-BD52-00A0C911CE86}']
  1362.     function QueryWriteSync: HResult; stdcall;
  1363.     function WriteSync: HResult; stdcall;
  1364.     function GetDevId(var pdwDevId: DWORD): HResult; stdcall;
  1365.   end;
  1366.  
  1367. const
  1368.   AMSTREAMSELECTINFO_ENABLED     = $1;
  1369.   AMSTREAMSELECTINFO_EXCLUSIVE   = $2;
  1370.  
  1371.   AMSTREAMSELECTENABLE_ENABLE    = $1;
  1372.   AMSTREAMSELECTENABLE_ENABLEALL = $2;
  1373.  
  1374. type
  1375.   IAMStreamSelect = interface(IUnknown)
  1376.     ['{C1960960-17F5-11D1-ABE1-00A0C905F375}']
  1377.     function Count(var pcStreams: DWORD): HResult; stdcall;
  1378.     function Info(lIndex: Longint; var ppmt: PAM_Media_Type;
  1379.         var pdwFlags: DWORD; var plcid: LCID; var pdwGroup: DWORD;
  1380.         var ppszName: PWCHAR; out ppObject: IUnknown; out ppUnk : IUnknown): HResult; stdcall;
  1381.     function Enable(lIndex: Longint; dwFlags: DWORD): HResult; stdcall;
  1382.   end;
  1383.  
  1384.   IAMovie = interface(IFilterGraph)
  1385.     ['{359ACE10-7688-11CF-8B23-00805F6CEF60}']
  1386.     function Connect(ppinOut, ppinIn: IPin): HResult; stdcall;
  1387.     function Render(ppinOut: IPin): HResult; stdcall;
  1388.     function Run: HResult; stdcall;
  1389.     function Pause: HResult; stdcall;
  1390.     function Stop: HResult; stdcall;
  1391.     function GetState(msTimeout: Longint; var pfs: TFilter_State): HResult; stdcall;
  1392.     function RenderFile(strFilename: LPCWSTR): HResult; stdcall;
  1393.     function AddSourceFilter(strFilename: LPCWSTR; out ppUnk: IBaseFilter): HResult; stdcall;
  1394.     function GetEventHandle(out hEvent: THandle): HResult; stdcall;
  1395.     function GetEvent(var lEventCode, lParam1, lParam2: Longint; msTimeout: Longint): HResult; stdcall;
  1396.     function WaitForCompletion(msTimeout: Longint; var pEvCode: Longint): HResult; stdcall;
  1397.     function CancelDefaultHandling(lEvCode: Longint): HResult; stdcall;
  1398.     function RestoreDefaultHandling(lEvCode: Longint): HResult; stdcall;
  1399.     function get_Duration(var plength: TRefTime): HResult; stdcall;
  1400.     function put_CurrentPosition(llTime: TRefTime): HResult; stdcall;
  1401.     function get_CurrentPosition(var pllTime: TRefTime): HResult; stdcall;
  1402.     function get_StopTime(var pllTime: TRefTime): HResult; stdcall;
  1403.     function put_StopTime(llTime: TRefTime): HResult; stdcall;
  1404.     function get_PrerollTime(var pllTime: TRefTime): HResult; stdcall;
  1405.     function put_PrerollTime(llTime: TRefTime): HResult; stdcall;
  1406.     function put_Rate(dRate: double): HResult; stdcall;
  1407.     function get_Rate(var pdRate: double): HResult; stdcall;
  1408.     function RemoveAllFilters: HResult; stdcall;
  1409.     function Play: HResult; stdcall;
  1410.     function PlayFile(strFilename: LPCWSTR): HResult; stdcall;
  1411.     function EnumFiltersByInterface(const riid: TGUID;
  1412.         out ppEnum: IEnumFilters): HResult; stdcall;
  1413.     function EnumPins(out ppEnum: IEnumPins): HResult; stdcall;
  1414.     function EnumPinsIn(out ppEnum: IEnumPins): HResult; stdcall;
  1415.     function EnumPinsOut(out ppEnum: IEnumPins): HResult; stdcall;
  1416.     function RenderAll: HResult; stdcall;
  1417.     function RenderNewFile(strFilename: LPCWSTR): HResult; stdcall;
  1418.     function FreeEventParams(lEvCode, lParam1, lParam2: Longint): HResult; stdcall;
  1419.   end;
  1420.  
  1421. const
  1422.   CDEF_CLASS_DEFAULT        = $1000;
  1423.   CDEF_BYPASS_CLASS_MANAGER = $2000;
  1424.  
  1425. type
  1426.   ICreateDevEnum = interface(IUnknown)
  1427.     ['{29840822-5B84-11D0-BD3B-00A0C911CE86}']
  1428.     function CreateClassEnumerator(const clsidDeviceClass: TGUID;
  1429.         out ppEnumMoniker: IEnumMoniker; dwFlags: DWORD): HResult; stdcall;
  1430.   end;
  1431.  
  1432.   TDVD_Domain = (
  1433.     DVD_DOMAIN_FirstPlay,
  1434.     DVD_DOMAIN_VideoManagerMenu,
  1435.     DVD_DOMAIN_VideoTitleSetMenu,
  1436.     DVD_DOMAIN_Title,
  1437.     DVD_DOMAIN_Stop
  1438.   );
  1439.  
  1440.   TDVD_Menu_ID = (
  1441.     DVD_MENU_INVALID_0,
  1442.     DVD_MENU_INVALID_1,
  1443.     DVD_MENU_Title,
  1444.     DVD_MENU_Root,
  1445.     DVD_MENU_Subpicture,
  1446.     DVD_MENU_Audio,
  1447.     DVD_MENU_Angle,
  1448.     DVD_MENU_Chapter
  1449.   );
  1450.  
  1451.   TDVD_Disc_Side = (
  1452.     DVD_SIDE_INVALID_0,
  1453.     DVD_SIDE_A,
  1454.     DVD_SIDE_B
  1455.   );
  1456.  
  1457.   TDVD_PREFERRED_Display_Mode = (
  1458.     DISPLAY_CONTENT_DEFAULT,
  1459.     DISPLAY_16x9,
  1460.     DISPLAY_4x3_PANSCAN_PREFERRED,
  1461.     DISPLAY_4x3_LETTERBOX_PREFERRED
  1462.   );
  1463.  
  1464.   TDVD_REGISTER = Word;
  1465.  
  1466.   TGPRMArray = array[0..15] of TDVD_REGISTER;
  1467.   TSPRMArray = array[0..23] of TDVD_REGISTER;
  1468.  
  1469.   TDVD_ATR = record
  1470.     ulCAT: ULONG;
  1471.     pbATRI: array[0..767] of Byte;
  1472.   end;
  1473.  
  1474.   TDVD_VideoATR = array[0..1] of Byte;
  1475.   TDVD_AudioATR = array[0..7] of Byte;
  1476.   TDVD_SubpictureATR = array[0..5] of Byte;
  1477.  
  1478.   TDVD_FrameRate = (
  1479.     DVD_FPS_INVALID_0,
  1480.     DVD_FPS_25,
  1481.     DVD_FPS_INVALID_2,
  1482.     DVD_FPS_30NonDrop
  1483.   );
  1484.  
  1485.   TDVD_TimeCode = record
  1486.     Hours1: ULONG;        // Hours
  1487.     Hours10: ULONG;       // Tens of Hours
  1488.  
  1489.     Minutes1: ULONG;      // Minutes
  1490.     Minutes10: ULONG;     // Tens of Minutes
  1491.  
  1492.     Seconds1: ULONG;      // Seconds
  1493.     Seconds10: ULONG;     // Tens of Seconds
  1494.  
  1495.     Frames1: ULONG;       // Frames
  1496.     Frames10: ULONG;      // Tens of Frames
  1497.  
  1498.     FrameRateCode: ULONG; // use DVD_FRAMERATE to indicate frames/sec and drop/non-drop
  1499.   end;
  1500.  
  1501.   TDVD_Playback_Location = record
  1502.     TitleNum: ULONG;
  1503.     ChapterNum: ULONG;
  1504.     TimeCode: ULONG;
  1505.   end;
  1506.  
  1507.   TVALID_UOP_SOMTHING_OR_OTHER = DWORD;
  1508.  
  1509. const
  1510.   DVD_PARENTAL_LEVEL_8    = $8000;
  1511.   DVD_PARENTAL_LEVEL_7    = $4000;
  1512.   DVD_PARENTAL_LEVEL_6    = $2000;
  1513.   DVD_PARENTAL_LEVEL_5    = $1000;
  1514.   DVD_PARENTAL_LEVEL_4    = $0800;
  1515.   DVD_PARENTAL_LEVEL_3    = $0400;
  1516.   DVD_PARENTAL_LEVEL_2    = $0200;
  1517.   DVD_PARENTAL_LEVEL_1    = $0100;
  1518.  
  1519. type
  1520.   IDvdControl = interface(IUnknown)
  1521.     ['{A70EFE61-E2A3-11D0-A9BE-00AA0061BE93}']
  1522.     function TitlePlay(uiTitle: ULONG): HResult; stdcall;
  1523.     function ChapterPlay(uiTitle: ULONG; uiChapter: ULONG): HResult; stdcall;
  1524.     function TimePlay(uiTitle: ULONG; bcdTime: ULONG): HResult; stdcall;
  1525.     function StopForResume: HResult; stdcall;
  1526.     function GoUp: HResult; stdcall;
  1527.     function TimeSearch(bcdTime: ULONG): HResult; stdcall;
  1528.     function ChapterSearch(Chapter: ULONG): HResult; stdcall;
  1529.     function PrevPGSearch: HResult; stdcall;
  1530.     function TopPGSearch: HResult; stdcall;
  1531.     function NextPGSearch: HResult; stdcall;
  1532.     function ForwardScan(dwSpeed: double): HResult; stdcall;
  1533.     function BackwardScan(dwSpeed: double): HResult; stdcall;
  1534.     function MenuCall(MenuID: TDVD_Menu_ID): HResult; stdcall;
  1535.     function Resume: HResult; stdcall;
  1536.     function UpperButtonSelect: HResult; stdcall;
  1537.     function LowerButtonSelect: HResult; stdcall;
  1538.     function LeftButtonSelect: HResult; stdcall;
  1539.     function RightButtonSelect: HResult; stdcall;
  1540.     function ButtonActivate: HResult; stdcall;
  1541.     function ButtonSelectAndActivate(uiButton: ULONG): HResult; stdcall;
  1542.     function StillOff: HResult; stdcall;
  1543.     function PauseOn: HResult; stdcall;
  1544.     function PauseOff: HResult; stdcall;
  1545.     function MenuLanguageSelect(Language: LCID): HResult; stdcall;
  1546.     function AudioStreamChange(nAudio: ULONG): HResult; stdcall;
  1547.     function SubpictureStreamChange(nSubPicture: ULONG; bDisplay: BOOL): HResult; stdcall;
  1548.     function AngleChange(ulAngle: ULONG): HResult; stdcall;
  1549.     function ParentalLevelSelect(ulParentalLevel: ULONG): HResult; stdcall;
  1550.     function ParentalCountrySelect(wCountry: Word): HResult; stdcall;
  1551.     function KaraokeAudioPresentationModeChange(ulMode: ULONG): HResult; stdcall;
  1552.     function VideoModePreferrence(ulPreferredDisplayMode: ULONG): HResult; stdcall;
  1553.     function SetRoot(pszPath: LPCWSTR): HResult; stdcall;
  1554.     function MouseActivate(const point: TPoint): HResult; stdcall;
  1555.     function MouseSelect(const point: TPoint): HResult; stdcall;
  1556.     function ChapterPlayAutoStop(ulTitle, ulChapter, ulChaptersToPlay: ULONG): HResult; stdcall;
  1557.   end;
  1558.  
  1559.   IDvdInfo = interface(IUnknown)
  1560.     ['{A70EFE60-E2A3-11D0-A9BE-00AA0061BE93}']
  1561.     function GetCurrentDomain(var pDomain: TDVD_Domain): HResult; stdcall;
  1562.     function GetCurrentLocation(var pLocation: TDVD_Playback_Location): HResult; stdcall;
  1563.     function GetTotalTitleTime(var pTotalTime: ULONG): HResult; stdcall;
  1564.     function GetCurrentButton(var pnButtonsAvailable, pnCurrentButton: ULONG): HResult; stdcall;
  1565.     function GetCurrentAngle(var pnAnglesAvailable, pnCurrentAngle: ULONG): HResult; stdcall;
  1566.     function GetCurrentAudio(var pnStreamsAvailable, pnCurrentStream: ULONG): HResult; stdcall;
  1567.     function GetCurrentSubpicture(var pnStreamsAvailable, pnCurrentStream: ULONG;
  1568.         pIsDisabled: BOOL): HResult; stdcall;
  1569.     function GetCurrentUOPS(var pUOP: TVALID_UOP_SOMTHING_OR_OTHER): HResult; stdcall;
  1570.     function GetAllSPRMs(var pRegisterArray: TSPRMArray): HResult; stdcall;
  1571.     function GetAllGPRMs(var pRegisterArray: TGPRMArray): HResult; stdcall;
  1572.     function GetAudioLanguage(nStream: ULONG; var pLanguage: LCID): HResult; stdcall;
  1573.     function GetSubpictureLanguage(nStream: ULONG; var pLanguage: LCID): HResult; stdcall;
  1574.     function GetTitleAttributes(nTitle: ULONG; var pATR: TDVD_ATR): HResult; stdcall;
  1575.     function GetVMGAttributes(var pATR: TDVD_ATR): HResult; stdcall;
  1576.     function GetCurrentVideoAttributes(var pATR: TDVD_VideoATR): HResult; stdcall;
  1577.     function GetCurrentAudioAttributes(var pATR: TDVD_AudioATR): HResult; stdcall;
  1578.     function GetCurrentSubpictureAttributes(var pATR: TDVD_SubpictureATR): HResult; stdcall;
  1579.     function GetCurrentVolumeInfo(var pNumOfVol, pThisVolNum: ULONG;
  1580.         var pSide: TDVD_Disc_Side; var pNumOfTitles: ULONG): HResult; stdcall;
  1581.     function GetDVDTextInfo(var pTextManager; cbBufSize: ULONG;
  1582.         var pcbActualSize: ULONG): HResult; stdcall;
  1583.     function GetPlayerParentalLevel(var pParentalLevel, pCountryCode: ULONG): HResult; stdcall;
  1584.     function GetNumberOfChapters(ulTitle: ULONG; var pNumberOfChapters: ULONG): HResult; stdcall;
  1585.     function GetTitleParentalLevels(ulTitle: ULONG; var pParentalLevels: ULONG): HResult; stdcall;
  1586.     function GetRoot(pRoot: PWCHAR; cbBufSize: ULONG; var pcbActualSize: ULONG): HResult; stdcall;
  1587.   end;
  1588.  
  1589. const
  1590.   M_DVD_HWDEC_PREFER     = $1;
  1591.   M_DVD_HWDEC_ONLY       = $2;
  1592.   M_DVD_SWDEC_PREFER     = $4;
  1593.   M_DVD_SWDEC_ONLY       = $8;
  1594.   M_DVD_NOVPE            = $100;
  1595.  
  1596.   AM_DVD_STREAM_VIDEO    = $1;
  1597.   AM_DVD_STREAM_AUDIO    = $2;
  1598.   AM_DVD_STREAM_SUBPIC   = $4;
  1599.  
  1600. type
  1601.   TAM_DVD_RenderStatus = record
  1602.     hrVPEStatus: HResult;
  1603.     bDvdVolInvalid: BOOL;
  1604.     bDvdVolUnknown: BOOL;
  1605.     bNoLine21In: BOOL;
  1606.     bNoLine21Out: BOOL;
  1607.     iNumStreams: Integer;
  1608.     iNumStreamsFailed: Integer;
  1609.     dwFailedStreamsFlag: DWORD;
  1610.   end;
  1611.  
  1612.   IDvdGraphBuilder = interface(IUnknown)
  1613.     ['{FCC152B6-F372-11d0-8E00-00C04FD7C08B}']
  1614.     function GetFiltergraph(out ppGB: IGraphBuilder): HResult; stdcall;
  1615.     function GetDvdInterface(const riid: TGUID; out ppvIF): HResult; stdcall;
  1616.     function RenderDvdVideoVolume(lpcwszPathName: LPCWSTR; dwFlags: DWORD;
  1617.         var pStatus: TAM_DVD_RenderStatus): HResult; stdcall;
  1618.   end;
  1619.  
  1620. (*==========================================================================;
  1621.  *
  1622.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1623.  *
  1624.  *  File:       mmstream.h
  1625.  *
  1626.  ***************************************************************************)
  1627.  
  1628. const
  1629.   IID_IMultiMediaStream: TGUID = '{B502D1BC-9A57-11d0-8FDE-00C04FD9189D}';
  1630.   IID_IMediaStream: TGUID = '{B502D1BD-9A57-11d0-8FDE-00C04FD9189D}';
  1631.   IID_IStreamSample: TGUID = '{B502D1BE-9A57-11d0-8FDE-00C04FD9189D}';
  1632.  
  1633. const
  1634.   MS_S_PENDING                = $80040401;
  1635.   MS_S_NOUPDATE               = $80040402;
  1636.   MS_S_ENDOFSTREAM            = $80040403;
  1637.   MS_E_SAMPLEALLOC            = $00040001;
  1638.   MS_E_PURPOSEID              = $00040002;
  1639.   MS_E_NOSTREAM               = $00040003;
  1640.   MS_E_NOSEEKING              = $00040004;
  1641.   MS_E_INCOMPATIBLE           = $00040005;
  1642.   MS_E_BUSY                   = $00040006;
  1643.   MS_E_NOTINIT                = $00040007;
  1644.   MS_E_SOURCEALREADYDEFINED   = $00040008;
  1645.   MS_E_INVALIDSTREAMTYPE      = $00040009;
  1646.   MS_E_NOTRUNNING             = $0004000A;
  1647.  
  1648.   MSPID_PrimaryVideo: TGUID = (D1:$A35FF56A;D2:$9FDA;D3:$11D0;D4:($8F,$DF,$00,$C0,$4F,$D9,$18,$9D));
  1649.   MSPID_PrimaryAudio: TGUID = (D1:$A35FF56B;D2:$9FDA;D3:$11D0;D4:($8F,$DF,$00,$C0,$4F,$D9,$18,$9D));
  1650.  
  1651. type
  1652.   PAPCFUNC = procedure(dwParam: DWORD); stdcall;
  1653.  
  1654.   TStream_Time = LONGLONG;
  1655.  
  1656.   MSPID = TGUID;
  1657.  
  1658.   TStream_Type = (
  1659.     STREAMTYPE_READ,
  1660.     STREAMTYPE_WRITE,
  1661.     STREAMTYPE_TRANSFORM
  1662.   );
  1663.  
  1664.   TStream_State = (
  1665.     STREAMSTATE_STOP,
  1666.     STREAMSTATE_RUN
  1667.   );
  1668.  
  1669.   TCompletion_Status_Flags = (
  1670.     COMPSTAT_INVALID_0,
  1671.     COMPSTAT_NOUPDATEOK,
  1672.     COMPSTAT_WAIT,
  1673.     COMPSTAT_INVALID_3,
  1674.     COMPSTAT_ABORT
  1675.   );
  1676.  
  1677. const
  1678.   MMSSF_HASCLOCK        = $1;
  1679.   MMSSF_SUPPORTSEEK     = $2;
  1680.   MMSSF_ASYNCHRONOUS    = $4;
  1681.  
  1682.   SSUPDATE_ASYNC = $1;
  1683.   SSUPDATE_CONTINUOUS = $2;
  1684.  
  1685. type
  1686.   IMediaStream = interface;
  1687.   IStreamSample = interface;
  1688.  
  1689.   IMultiMediaStream = interface(IUnknown)
  1690.     ['{B502D1BC-9A57-11d0-8FDE-00C04FD9189D}']
  1691.     function GetInformation(var pdwFlags: DWORD; var pStreamType: TStream_Type): HResult; stdcall;
  1692.     function GetMediaStream(const idPurpose: MSPID;
  1693.         out ppMediaStream: IMediaStream): HResult; stdcall;
  1694.     function EnumMediaStreams(Index: Longint; out ppMediaStream: IMediaStream): HResult; stdcall;
  1695.     function GetState(var pCurrentState: TStream_State): HResult; stdcall;
  1696.     function SetState(NewState: TStream_State): HResult; stdcall;
  1697.     function GetTime(var pCurrentTime: TStream_Time): HResult; stdcall;
  1698.     function GetDuration(var pDuration: TStream_Time): HResult; stdcall;
  1699.     function Seek(SeekTime: TStream_Time): HResult; stdcall;
  1700.     function GetEndOfStreamEventHandle(var phEOS: THandle): HResult; stdcall;
  1701.   end;
  1702.  
  1703.   IMediaStream = interface(IUnknown)
  1704.     ['{B502D1BD-9A57-11d0-8FDE-00C04FD9189D}']
  1705.     function GetMultiMediaStream(out ppMultiMediaStream: IMultiMediaStream): HResult; stdcall;
  1706.     function GetInformation(var pPurposeId: MSPID; var pType: TStream_Type): HResult; stdcall;
  1707.     function SetSameFormat(pStreamThatHasDesiredFormat: IMediaStream;
  1708.         dwFlags: DWORD): HResult; stdcall;
  1709.     function AllocateSample(dwFlags: DWORD; out ppSample: IStreamSample): HResult; stdcall;
  1710.     function CreateSharedSample(pExistingSample: IStreamSample; dwFlags: DWORD;
  1711.         out ppNewSample: IStreamSample): HResult; stdcall;
  1712.     function SendEndOfStream(dwFlags: DWORD): HResult; stdcall;
  1713.   end;
  1714.  
  1715.   IStreamSample = interface(IUnknown)
  1716.     ['{B502D1BE-9A57-11d0-8FDE-00C04FD9189D}']
  1717.     function GetMediaStream(out ppMediaStream: IMediaStream): HResult; stdcall;
  1718.     function GetSampleTimes(var pStartTime, pEndTime,
  1719.         pCurrentTime: TStream_Time): HResult; stdcall;
  1720.     function SetSampleTimes(var pStartTime, pEndTime: TStream_Time): HResult; stdcall;
  1721.     function Update(dwFlags: DWORD; hEvent: THandle; pfnAPC: PAPCFUNC;
  1722.         dwAPCData: DWORD): HResult; stdcall;
  1723.     function CompletionStatus(dwFlags: DWORD; dwMilliseconds: DWORD): HResult; stdcall;
  1724.   end;
  1725.  
  1726. (*==========================================================================;
  1727.  *
  1728.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1729.  *
  1730.  *  File:       amstream.h
  1731.  *
  1732.  ***************************************************************************)
  1733.  
  1734. const
  1735.   IID_IDirectShowStream: TGUID = '{7DB01C96-C0C3-11D0-8FF1-00C04FD9189D}';
  1736.   IID_IAMMultiMediaStream: TGUID = '{BEBE595C-9A6F-11D0-8FDE-00C04FD9189D}';
  1737.   IID_IAMMediaStream: TGUID = '{BEBE595D-9A6F-11D0-8FDE-00C04FD9189D}';
  1738.   IID_IMediaStreamFilter: TGUID = '{BEBE595E-9A6F-11D0-8FDE-00C04FD9189D}';
  1739.   IID_IDirectDrawMediaSampleAllocator: TGUID = '{AB6B4AFC-F6E4-11D0-900D-00C04FD9189D}';
  1740.   IID_IDirectDrawMediaSample: TGUID = '{AB6B4AFE-F6E4-11D0-900D-00C04FD9189D}';
  1741.   IID_IAMMediaTypeStream: TGUID = '{AB6B4AFA-F6E4-11D0-900D-00C04FD9189D}';
  1742.   IID_IAMMediaTypeSample: TGUID = '{AB6B4AFB-F6E4-11D0-900D-00C04FD9189D}';
  1743.  
  1744. const
  1745.   AMMSF_NOGRAPHTHREAD = $1;
  1746.  
  1747.   AMMSF_ADDDEFAULTRENDERER = $1;
  1748.   AMMSF_CREATEPEER = $2;
  1749.  
  1750.   AMMSF_RENDERTYPEMASK  = $3;
  1751.   AMMSF_RENDERTOEXISTING        = 0;
  1752.   AMMSF_RENDERALLSTREAMS        = $1;
  1753.   AMMSF_NORENDER        = $2;
  1754.   AMMSF_NOCLOCK = $4;
  1755.   AMMSF_RUN     = $8;
  1756.  
  1757. type
  1758.   TOutput_State = (
  1759.     Disabled,
  1760.     ReadData,
  1761.     RenderData
  1762.   );
  1763.  
  1764.   IDirectShowStream = interface(IDispatch)
  1765.     ['{7DB01C96-C0C3-11D0-8FF1-00C04FD9189D}']
  1766.     function get_FileName(var pVal: TBSTR): HResult; stdcall;
  1767.     function put_FileName(newVal: TBSTR): HResult; stdcall;
  1768.     function get_Video(var pVal: TOutput_State): HResult; stdcall;
  1769.     function put_Video(newVal: TOutput_State): HResult; stdcall;
  1770.     function get_Audio(var pVal: TOutput_State): HResult; stdcall;
  1771.     function put_Audio(newVal: TOutput_State): HResult; stdcall;
  1772.   end;
  1773.  
  1774.   IMediaStreamFilter = interface;
  1775.  
  1776.   IAMMultiMediaStream = interface(IMultiMediaStream)
  1777.     ['{BEBE595C-9A6F-11D0-8FDE-00C04FD9189D}']
  1778.     function Initialize(StreamType: TStream_Type; dwFlags: DWORD;
  1779.         pFilterGraph: IGraphBuilder): HResult; stdcall;
  1780.     function GetFilterGraph(out ppGraphBuilder: IGraphBuilder): HResult; stdcall;
  1781.     function GetFilter(out ppFilter: IMediaStreamFilter): HResult; stdcall;
  1782.     function AddMediaStream(pStreamObject: IUnknown; const PurposeId: MSPID;
  1783.         dwFlags: DWORD; out ppNewStream: IMediaStream): HResult; stdcall;
  1784.     function OpenFile(pszFileName: LPCWSTR; dwFlags: DWORD): HResult; stdcall;
  1785.     function OpenMoniker(pCtx: IBindCtx; pMoniker: IMoniker; dwFlags: DWORD): HResult; stdcall;
  1786.     function Render(dwFlags: DWORD): HResult; stdcall;
  1787.   end;
  1788.  
  1789.   IAMMediaStream = interface(IMediaStream)
  1790.     ['{BEBE595D-9A6F-11D0-8FDE-00C04FD9189D}']
  1791.     function Initialize(pSourceObject: IUnknown; dwFlags: DWORD;
  1792.         const PurposeId: MSPID; StreamType: TStream_Type): HResult; stdcall;
  1793.     function SetState(State: TFilter_State): HResult; stdcall;
  1794.     function JoinAMMultiMediaStream(pAMMultiMediaStream: IAMMultiMediaStream): HResult; stdcall;
  1795.     function JoinFilter(pMediaStreamFilter: IMediaStreamFilter): HResult; stdcall;
  1796.     function JoinFilterGraph(pFilterGraph: IFilterGraph): HResult; stdcall;
  1797.   end;
  1798.  
  1799.   IMediaStreamFilter = interface(IBaseFilter)
  1800.     ['{BEBE595E-9A6F-11D0-8FDE-00C04FD9189D}']
  1801.     function AddMediaStream(pAMMediaStream: IAMMediaStream): HResult; stdcall;
  1802.     function GetMediaStream(const idPurpose: MSPID;
  1803.         out ppMediaStream: IMediaStream): HResult; stdcall;
  1804.     function EnumMediaStreams(Index: Longint; out ppMediaStream: IMediaStream): HResult; stdcall;
  1805.     function SupportSeeking(bRenderer: BOOL): HResult; stdcall;
  1806.     function ReferenceTimeToStreamTime(var pTime: TReference_Time): HResult; stdcall;
  1807.     function GetCurrentStreamTime(var pCurrentStreamTime: TReference_Time): HResult; stdcall;
  1808.     function WaitUntil(WaitStreamTime: TReference_Time): HResult; stdcall;
  1809.     function Flush(bCancelEOS: BOOL): HResult; stdcall;
  1810.     function EndOfStream: HResult; stdcall;
  1811.   end;
  1812.  
  1813.   IDirectDrawMediaSampleAllocator = interface(IUnknown)
  1814.     ['{AB6B4AFC-F6E4-11D0-900D-00C04FD9189D}']
  1815.     function GetDirectDraw(out ppDirectDraw: IDirectDraw): HResult; stdcall;
  1816.   end;
  1817.  
  1818.   IDirectDrawMediaSample = interface(IUnknown)
  1819.     ['{AB6B4AFE-F6E4-11D0-900D-00C04FD9189D}']
  1820.     function GetSurfaceAndReleaseLock(out ppDirectDrawSurface: IDirectDrawSurface;
  1821.         var pRect: TRect): HResult; stdcall;
  1822.     function LockMediaSamplePointer: HResult; stdcall;
  1823.   end;
  1824.  
  1825.   IAMMediaTypeSample = interface;
  1826.  
  1827.   IAMMediaTypeStream = interface(IMediaStream)
  1828.     ['{AB6B4AFA-F6E4-11D0-900D-00C04FD9189D}']
  1829.     function GetFormat(out pMediaType: TAM_Media_Type; dwFlags: DWORD): HResult; stdcall;
  1830.     function SetFormat(const pMediaType: TAM_Media_Type; dwFlags: DWORD): HResult; stdcall;
  1831.     function CreateSample(lSampleSize: Longint; pbBuffer: Pointer;
  1832.         dwFlags: DWORD; pUnkOuter: IUnknown; out ppAMMediaTypeSample: IAMMediaTypeSample): HResult; stdcall;
  1833.     function GetStreamAllocatorRequirements(var pProps: TAllocator_Properties): HResult; stdcall;
  1834.     function SetStreamAllocatorRequirements(const pProps: TAllocator_Properties): HResult; stdcall;
  1835.   end;
  1836.  
  1837.   IAMMediaTypeSample = interface(IStreamSample)
  1838.     ['{AB6B4AFB-F6E4-11D0-900D-00C04FD9189D}']
  1839.     function SetPointer(pBuffer: Pointer; lSize: Longint): HResult; stdcall;
  1840.     function GetPointer(var ppBuffer: Pointer): HResult; stdcall;
  1841.     function GetSize: Longint; stdcall;
  1842.     function GetTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  1843.     function SetTime(var pTimeStart, pTimeEnd: TReference_Time): HResult; stdcall;
  1844.     function IsSyncPoint: HResult; stdcall;
  1845.     function SetSyncPoint(bIsSyncPoint: BOOL): HResult; stdcall;
  1846.     function IsPreroll: HResult; stdcall;
  1847.     function SetPreroll(bIsPreroll: BOOL): HResult; stdcall;
  1848.     function GetActualDataLength: Longint; stdcall;
  1849.     function SetActualDataLength(l: Longint): HResult; stdcall;
  1850.     function GetMediaType(var ppMediaType: PAM_Media_Type): HResult; stdcall;
  1851.     function SetMediaType(const pMediaType: TAM_Media_Type): HResult; stdcall;
  1852.     function IsDiscontinuity: HResult; stdcall;
  1853.     function SetDiscontinuity(bDiscontinuity: BOOL): HResult; stdcall;
  1854.     function GetMediaTime(var pTimeStart, pTimeEnd: LONGLONG): HResult; stdcall;
  1855.     function SetMediaTime(var pTimeStart, pTimeEnd: LONGLONG): HResult; stdcall;
  1856.   end;
  1857.  
  1858. const
  1859. {
  1860. EXTERN_C const IID LIBID_DirectShowStreamLib;
  1861.  
  1862. EXTERN_C const CLSID CLSID_AMMultiMediaStream;
  1863. }
  1864.   CLSID_AMMultiMediaStream: TGUID = '{49C47CE5-9BA4-11D0-8212-00C04FC32C45}';
  1865.  
  1866.   CLSID_AMDirectDrawStream: TGUID = (D1:$49C47CE4;D2:$9BA4;D3:$11D0;D4:($82,$12,$00,$C0,$4F,$C3,$2C,$45));
  1867.   CLSID_AMAudioStream: TGUID = (D1:$8496E040;D2:$AF4C;D3:$11D0;D4:($82,$12,$00,$C0,$4F,$C3,$2C,$45));
  1868.   CLSID_AMAudioData: TGUID = (D1:$F2468580;D2:$AF8A;D3:$11D0;D4:($82,$12,$00,$C0,$4F,$C3,$2C,$45));
  1869.   CLSID_AMMediaTypeStream: TGUID = (D1:$CF0F2F7C;D2:$F7BF;D3:$11D0;D4:($90,$0D,$00,$C0,$4F,$D9,$18,$9D));
  1870.  
  1871. (*==========================================================================;
  1872.  *
  1873.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1874.  *
  1875.  *  File:       ddstream.h
  1876.  *
  1877.  ***************************************************************************)
  1878.  
  1879. const
  1880.   DDSFF_PROGRESSIVERENDER = $1;
  1881.  
  1882.   IID_IDirectDrawMediaStream: TGUID = '{F4104FCE-9A70-11d0-8FDE-00C04FD9189D}';
  1883.   IID_IDirectDrawStreamSample: TGUID = '{F4104FCF-9A70-11d0-8FDE-00C04FD9189D}';
  1884.  
  1885. type
  1886.   IDirectDrawStreamSample = interface;
  1887.  
  1888.   IDirectDrawMediaStream = interface(IMediaStream)
  1889.     ['{F4104FCE-9A70-11d0-8FDE-00C04FD9189D}']
  1890.     function GetFormat(var pDDSDCurrent: DDSURFACEDESC;
  1891.         out ppDirectDrawPalette: IDirectDrawPalette;
  1892.         var pDDSDDesired: DDSURFACEDESC; var pdwFlags: DWORD): HResult; stdcall;
  1893.     function SetFormat(const pDDSurfaceDesc: DDSURFACEDESC;
  1894.         pDirectDrawPalette: IDirectDrawPalette): HResult; stdcall;
  1895.     function GetDirectDraw(out ppDirectDraw: IDirectDraw): HResult; stdcall;
  1896.     function SetDirectDraw(pDirectDraw: IDirectDraw): HResult; stdcall;
  1897.     function CreateSample(pSurface: IDirectDrawSurface; const pRect: TRect;
  1898.         dwFlags: DWORD; out ppSample: IDirectDrawStreamSample): HResult; stdcall;
  1899.     function GetTimePerFrame(var pFrameTime: TStream_Time): HResult; stdcall;
  1900.   end;
  1901.  
  1902.   IDirectDrawStreamSample = interface(IStreamSample)
  1903.     ['{F4104FCF-9A70-11d0-8FDE-00C04FD9189D}']
  1904.     function GetSurface(out ppDirectDrawSurface: IDirectDrawSurface;
  1905.         var pRect: TRect): HResult; stdcall;
  1906.     function SetRect(const pRect: TRect): HResult; stdcall;
  1907.   end;
  1908.  
  1909. (*==========================================================================;
  1910.  *
  1911.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1912.  *
  1913.  *  File:       austream.h
  1914.  *
  1915.  ***************************************************************************)
  1916.  
  1917. const
  1918.   IID_IAudioMediaStream: TGUID = '{F7537560-A3BE-11D0-8212-00C04FC32C45}';
  1919.   IID_IAudioStreamSample: TGUID = '{345FEE00-ABA5-11D0-8212-00C04FC32C45}';
  1920.   IID_IMemoryData: TGUID = '{327FC560-AF60-11D0-8212-00C04FC32C45}';
  1921.   IID_IAudioData: TGUID = '{54C719C0-AF60-11D0-8212-00C04FC32C45}';
  1922.  
  1923. type
  1924.   IAudioStreamSample = interface;
  1925.   IAudioData = interface;
  1926.  
  1927.   IAudioMediaStream = interface(IMediaStream)
  1928.     ['{F7537560-A3BE-11D0-8212-00C04FC32C45}']
  1929.     function GetFormat(var pWaveFormatCurrent: TWaveFormatEx): HResult; stdcall;
  1930.     function SetFormat(const lpWaveFormat: TWaveFormatEx): HResult; stdcall;
  1931.     function CreateSample(pAudioData: IAudioData; dwFlags: DWORD;
  1932.         out ppSample: IAudioStreamSample): HResult; stdcall;
  1933.   end;
  1934.  
  1935.   IAudioStreamSample = interface(IStreamSample)
  1936.     ['{345FEE00-ABA5-11D0-8212-00C04FC32C45}']
  1937.     function GetAudioData(out ppAudio: IAudioData): HResult; stdcall;
  1938.   end;
  1939.  
  1940.   IMemoryData = interface(IUnknown)
  1941.     ['{327FC560-AF60-11D0-8212-00C04FC32C45}']
  1942.     function SetBuffer(cbSize: DWORD; pbData: Pointer; dwFlags: DWORD): HResult; stdcall;
  1943.     function GetInfo(var pdwLength: DWORD; var ppbData: Pointer;
  1944.         var pcbActualData: DWORD): HResult; stdcall;
  1945.     function SetActual(cbDataValid: DWORD): HResult; stdcall;
  1946.   end;
  1947.  
  1948.   IAudioData = interface(IMemoryData)
  1949.     ['{54C719C0-AF60-11D0-8212-00C04FC32C45}']
  1950.     function GetFormat(var pWaveFormatCurrent: TWaveFormatEx): HResult; stdcall;
  1951.     function SetFormat(const lpWaveFormat: TWaveFormatEx): HResult; stdcall;
  1952.   end;
  1953.  
  1954. (*==========================================================================;
  1955.  *
  1956.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1957.  *
  1958.  *  File:       mpconfig.h
  1959.  *
  1960.  ***************************************************************************)
  1961.  
  1962. const
  1963.   IID_IMixerPinConfig: TGUID = (D1:$593CDDE1;D2:$0759;D3:$11D1;D4:($9E,$69,$00,$C0,$4F,$D7,$C1,$5B));
  1964.  
  1965. type
  1966.   TAM_Aspect_Ratio_Mode = (
  1967.     AM_ARMODE_STRETCHED,        // don't do any aspect ratio correction
  1968.     AM_ARMODE_LETTER_BOX,       // letter box the video, paint background color in the excess region
  1969.     AM_ARMODE_CROP,             // crop the video to the right aspect ratio
  1970.     AM_ARMODE_STRETCHED_AS_PRIMARY
  1971.   );
  1972.  
  1973.   IMixerPinConfig = interface(IUnknown)
  1974.     ['{593CDDE1-0759-11D1-9E69-00C04FD7C15B}']
  1975.     function SetRelativePosition(dwLeft, dwTop, dwRight, dwBottom: DWORD): HResult; stdcall;
  1976.     function GetRelativePosition(var dwLeft, dwTop, dwRight, dwBottom: DWORD): HResult; stdcall;
  1977.     function SetZOrder(dwZOrder: DWORD): HResult; stdcall;
  1978.     function GetZOrder(var dwZOrder: DWORD): HResult; stdcall;
  1979.     function SetColorKey(const pColorKey: TColorKey): HResult; stdcall;
  1980.     function GetColorKey(var pColorKey: TColorKey; var pColor: DWORD): HResult; stdcall;
  1981.     function SetBlendingParameter(dwBlendingParameter: DWORD): HResult; stdcall;
  1982.     function GetBlendingParameter(var dwBlendingParameter: DWORD): HResult; stdcall;
  1983.     function SetAspectRatioMode(amAspectRatioMode: TAM_Aspect_Ratio_Mode): HResult; stdcall;
  1984.     function GetAspectRatioMode(var amAspectRatioMode: TAM_Aspect_Ratio_Mode): HResult; stdcall;
  1985.     function SetStreamTransparent(bStreamTransparent: BOOL): HResult; stdcall;
  1986.     function GetStreamTransparent(var bStreamTransparent: BOOL): HResult; stdcall;
  1987.   end;
  1988.  
  1989. (*==========================================================================;
  1990.  *
  1991.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  1992.  *
  1993.  *  File:       control.h
  1994.  *
  1995.  ***************************************************************************)
  1996.  
  1997. const
  1998.   LIBID_QuartzTypeLib: TGUID = (D1:$56A868B0;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  1999.  
  2000.   IID_IAMCollection: TGUID = (D1:$56A868B9;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2001.   IID_IMediaControl: TGUID = (D1:$56A868B1;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2002.   IID_IMediaEvent: TGUID = (D1:$56A868B6;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2003.   IID_IMediaEventEx: TGUID = (D1:$56A868C0;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2004.   IID_IMediaPosition: TGUID = (D1:$56A868B2;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2005.   IID_IBasicAudio: TGUID = (D1:$56A868B3;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2006.   IID_IVideoWindow: TGUID = (D1:$56A868B4;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2007.   IID_IBasicVideo: TGUID = (D1:$56A868B5;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2008.   IID_IDeferredCommand: TGUID = (D1:$56A868B8;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2009.   IID_IQueueCommand: TGUID = (D1:$56A868B7;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2010.  
  2011.   CLSID_FilgraphManager: TGUID = (D1:$E436EBB3;D2:$524F;D3:$11CE;D4:($9F,$53,$00,$20,$AF,$0B,$A7,$70));
  2012.  
  2013.   IID_IFilterInfo: TGUID = (D1:$56A868BA;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2014.   IID_IRegFilterInfo: TGUID = (D1:$56A868BB;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2015.   IID_IMediaTypeInfo: TGUID = (D1:$56A868BC;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2016.   IID_IPinInfo: TGUID = (D1:$56A868BD;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2017.  
  2018. type
  2019.   OAEVENT = Longint;
  2020.   OAHWND = Longint;
  2021.   OAFilterState = Longint;
  2022.  
  2023. (* Definition of interface: IAMCollection *)
  2024.   IAMCollection = interface(IDispatch)
  2025.     ['{56A868B9-0AD4-11CE-B03A-0020AF0BA770}']
  2026.     (* IAMCollection methods *)
  2027.     function get_Count(var plCount: Longint): HResult; stdcall;
  2028.     function Item(lItem: Longint; out ppUnk: IUnknown): HResult; stdcall;
  2029.     function get__NewEnum(out ppUnk: IUnknown): HResult; stdcall;
  2030.   end;
  2031.  
  2032. (* Definition of interface: IMediaControl *)
  2033.   IMediaControl = interface(IDispatch)
  2034.     ['{56A868B1-0AD4-11CE-B03A-0020AF0BA770}']
  2035.     (* IMediaControl methods *)
  2036.     function Run: HResult; stdcall;
  2037.     function Pause: HResult; stdcall;
  2038.     function Stop: HResult; stdcall;
  2039.     function GetState(msTimeout: Longint; var pfs: OAFilterState): HResult; stdcall;
  2040.     function RenderFile(strFilename: TBSTR): HResult; stdcall;
  2041.     function AddSourceFilter(strFilename: TBSTR; ppUnk: IDispatch): HResult; stdcall;
  2042.     function get_FilterCollection(out ppUnk: IDispatch): HResult; stdcall;
  2043.     function get_RegFilterCollection(out ppUnk: IDispatch): HResult; stdcall;
  2044.     function StopWhenReady: HResult; stdcall;
  2045.   end;
  2046.                                  
  2047. (* Definition of interface: IMediaEvent *)
  2048.   IMediaEvent = interface(IDispatch)
  2049.     ['{56A868B6-0AD4-11CE-B03A-0020AF0BA770}']
  2050.     (* IMediaEvent methods *)
  2051.     function GetEventHandle(var hEvent: OAEVENT): HResult; stdcall;
  2052.     function GetEvent(var lEventCode: Longint; var lParam1, lParam2: Longint;
  2053.         msTimeout: Longint): HResult; stdcall;
  2054.     function WaitForCompletion(msTimeout: Longint; var pEvCode: Longint): HResult; stdcall;
  2055.     function CancelDefaultHandling(lEvCode: Longint): HResult; stdcall;
  2056.     function RestoreDefaultHandling(lEvCode: Longint): HResult; stdcall;
  2057.     function FreeEventParams(lEvCode: Longint; lParam1, lParam2: Longint): HResult; stdcall;
  2058.   end;
  2059.  
  2060. (* Definition of interface: IMediaEventEx *)
  2061.   IMediaEventEx = interface(IMediaEvent)
  2062.     ['{56A868C0-0AD4-11CE-B03A-0020AF0BA770}']
  2063.     (* IMediaEventEx methods *)
  2064.     function SetNotifyWindow(hwnd: OAHWND; lMsg: Longint;
  2065.         lInstanceData: Longint): HResult; stdcall;
  2066.     function SetNotifyFlags(lNoNotifyFlags: Longint): HResult; stdcall;
  2067.     function GetNotifyFlags(var lplNoNotifyFlags: Longint): HResult; stdcall;
  2068.   end;
  2069.  
  2070. (* Definition of interface: IMediaPosition *)
  2071.   IMediaPosition = interface(IDispatch)
  2072.     ['{56A868B2-0AD4-11CE-B03A-0020AF0BA770}']
  2073.     (* IMediaPosition methods *)
  2074.     function get_Duration(var plength: TRefTime): HResult; stdcall;
  2075.     function put_CurrentPosition(llTime: TRefTime): HResult; stdcall;
  2076.     function get_CurrentPosition(var pllTime: TRefTime): HResult; stdcall;
  2077.     function get_StopTime(var pllTime: TRefTime): HResult; stdcall;
  2078.     function put_StopTime(llTime: TRefTime): HResult; stdcall;
  2079.     function get_PrerollTime(var pllTime: TRefTime): HResult; stdcall;
  2080.     function put_PrerollTime(llTime: TRefTime): HResult; stdcall;
  2081.     function put_Rate(dRate: double): HResult; stdcall;
  2082.     function get_Rate(var pdRate: double): HResult; stdcall;
  2083.     function CanSeekForward(var pCanSeekForward: Longint): HResult; stdcall;
  2084.     function CanSeekBackward(var pCanSeekBackward: Longint): HResult; stdcall;
  2085.   end;
  2086.  
  2087. (* Definition of interface: IBasicAudio *)
  2088.   IBasicAudio = interface(IDispatch)
  2089.     ['{56A868B3-0AD4-11CE-B03A-0020AF0BA770}']
  2090.     (* IBasicAudio methods *)
  2091.     function put_Volume(lVolume: Longint): HResult; stdcall;
  2092.     function get_Volume(var plVolume: Longint): HResult; stdcall;
  2093.     function put_Balance(lBalance: Longint): HResult; stdcall;
  2094.     function get_Balance(var plBalance: Longint): HResult; stdcall;
  2095.   end;
  2096.  
  2097. (* Definition of interface: IVideoWindow *)
  2098.   IVideoWindow = interface(IDispatch)
  2099.     ['{56A868B4-0AD4-11CE-B03A-0020AF0BA770}']
  2100.     (* IVideoWindow methods *)
  2101.     function put_Caption(strCaption: TBSTR): HResult; stdcall;
  2102.     function get_Caption(var strCaption: TBSTR): HResult; stdcall;
  2103.     function put_WindowStyle(WindowStyle: Longint): HResult; stdcall;
  2104.     function get_WindowStyle(var WindowStyle: Longint): HResult; stdcall;
  2105.     function put_WindowStyleEx(WindowStyleEx: Longint): HResult; stdcall;
  2106.     function get_WindowStyleEx(var WindowStyleEx: Longint): HResult; stdcall;
  2107.     function put_AutoShow(AutoShow: LongBool): HResult; stdcall;
  2108.     function get_AutoShow(var AutoShow: LongBool): HResult; stdcall;
  2109.     function put_WindowState(WindowState: Longint): HResult; stdcall;
  2110.     function get_WindowState(var WindowState: Longint): HResult; stdcall;
  2111.     function put_BackgroundPalette(BackgroundPalette: Longint): HResult; stdcall;
  2112.     function get_BackgroundPalette(var pBackgroundPalette: Longint): HResult; stdcall;
  2113.     function put_Visible(Visible: LongBool): HResult; stdcall;
  2114.     function get_Visible(var pVisible: LongBool): HResult; stdcall;
  2115.     function put_Left(Left: Longint): HResult; stdcall;
  2116.     function get_Left(var pLeft: Longint): HResult; stdcall;
  2117.     function put_Width(Width: Longint): HResult; stdcall;
  2118.     function get_Width(var pWidth: Longint): HResult; stdcall;
  2119.     function put_Top(Top: Longint): HResult; stdcall;
  2120.     function get_Top(var pTop: Longint): HResult; stdcall;
  2121.     function put_Height(Height: Longint): HResult; stdcall;
  2122.     function get_Height(var pHeight: Longint): HResult; stdcall;
  2123.     function put_Owner(Owner: OAHWND): HResult; stdcall;
  2124.     function get_Owner(var Owner: OAHWND): HResult; stdcall;
  2125.     function put_MessageDrain(Drain: OAHWND): HResult; stdcall;
  2126.     function get_MessageDrain(var Drain: OAHWND): HResult; stdcall;
  2127.     function get_BorderColor(var Color: Longint): HResult; stdcall;
  2128.     function put_BorderColor(Color: Longint): HResult; stdcall;
  2129.     function get_FullScreenMode(var FullScreenMode: LongBool): HResult; stdcall;
  2130.     function put_FullScreenMode(FullScreenMode: LongBool): HResult; stdcall;
  2131.     function SetWindowForeground(Focus: Longint): HResult; stdcall;
  2132.     function NotifyOwnerMessage(hwnd: Longint; uMsg, wParam, lParam: Longint): HResult; stdcall;
  2133.     function SetWindowPosition(Left, Top, Width, Height: Longint): HResult; stdcall;
  2134.     function GetWindowPosition(var pLeft, pTop, pWidth, pHeight: Longint): HResult; stdcall;
  2135.     function GetMinIdealImageSize(var pWidth, pHeight: Longint): HResult; stdcall;
  2136.     function GetMaxIdealImageSize(var pWidth, pHeight: Longint): HResult; stdcall;
  2137.     function GetRestorePosition(var pLeft, pTop, pWidth, pHeight: Longint): HResult; stdcall;
  2138.     function HideCursor(HideCursor: LongBool): HResult; stdcall;
  2139.     function IsCursorHidden(var CursorHidden: LongBool): HResult; stdcall;
  2140.   end;
  2141.  
  2142. (* Definition of interface: IBasicVideo *)
  2143.   IBasicVideo = interface(IDispatch)
  2144.     ['{56A868B5-0AD4-11CE-B03A-0020AF0BA770}']
  2145.     (* IBasicVideo methods *)
  2146.     function get_AvgTimePerFrame(var pAvgTimePerFrame: TRefTime): HResult; stdcall;
  2147.     function get_BitRate(var pBitRate: Longint): HResult; stdcall;
  2148.     function get_BitErrorRate(var pBitErrorRate: Longint): HResult; stdcall;
  2149.     function get_VideoWidth(var pVideoWidth: Longint): HResult; stdcall;
  2150.     function get_VideoHeight(var pVideoHeight: Longint): HResult; stdcall;
  2151.     function put_SourceLeft(SourceLeft: Longint): HResult; stdcall;
  2152.     function get_SourceLeft(var pSourceLeft: Longint): HResult; stdcall;
  2153.     function put_SourceWidth(SourceWidth: Longint): HResult; stdcall;
  2154.     function get_SourceWidth(var pSourceWidth: Longint): HResult; stdcall;
  2155.     function put_SourceTop(SourceTop: Longint): HResult; stdcall;
  2156.     function get_SourceTop(var pSourceTop: Longint): HResult; stdcall;
  2157.     function put_SourceHeight(SourceHeight: Longint): HResult; stdcall;
  2158.     function get_SourceHeight(var pSourceHeight: Longint): HResult; stdcall;
  2159.     function put_DestinationLeft(DestinationLeft: Longint): HResult; stdcall;
  2160.     function get_DestinationLeft(var pDestinationLeft: Longint): HResult; stdcall;
  2161.     function put_DestinationWidth(DestinationWidth: Longint): HResult; stdcall;
  2162.     function get_DestinationWidth(var pDestinationWidth: Longint): HResult; stdcall;
  2163.     function put_DestinationTop(DestinationTop: Longint): HResult; stdcall;
  2164.     function get_DestinationTop(var pDestinationTop: Longint): HResult; stdcall;
  2165.     function put_DestinationHeight(DestinationHeight: Longint): HResult; stdcall;
  2166.     function get_DestinationHeight(var pDestinationHeight: Longint): HResult; stdcall;
  2167.     function SetSourcePosition(Left, Top, Width, Height: Longint): HResult; stdcall;
  2168.     function GetSourcePosition(var pLeft, pTop, pWidth, pHeight: Longint): HResult; stdcall;
  2169.     function SetDefaultSourcePosition: HResult; stdcall;
  2170.     function SetDestinationPosition(Left, Top, Width, Height: Longint): HResult; stdcall;
  2171.     function GetDestinationPosition(var pLeft, pTop, pWidth, pHeight: Longint): HResult; stdcall;
  2172.     function SetDefaultDestinationPosition: HResult; stdcall;
  2173.     function GetVideoSize(var pWidth, Height: Longint): HResult; stdcall;
  2174.     function GetVideoPaletteEntries(StartIndex, Entries: Longint;
  2175.         var pRetrieved: Longint; var pPalette): HResult; stdcall;
  2176.     function GetCurrentImage(var BufferSize: Longint; var pDIBImage): HResult; stdcall;
  2177.     function IsUsingDefaultSource: HResult; stdcall;
  2178.     function IsUsingDefaultDestination: HResult; stdcall;
  2179.   end;
  2180.  
  2181. (* Definition of interface: IDeferredCommand *)
  2182.   IDeferredCommand = interface(IDispatch)
  2183.     ['{56A868B8-0AD4-11CE-B03A-0020AF0BA770}']
  2184.     (* IDeferredCommand methods *)
  2185.     function Cancel: HResult; stdcall;
  2186.     function Confidence(var pConfidence: Longint): HResult; stdcall;
  2187.     function Postpone(newtime: TRefTime): HResult; stdcall;
  2188.     function GetHResult(var phrResult: HResult): HResult; stdcall;
  2189.   end;
  2190.  
  2191. (* Definition of interface: IQueueCommand *)
  2192.   IQueueCommand = interface(IUnknown)
  2193.     ['{56A868B7-0AD4-11CE-B03A-0020AF0BA770}']
  2194.     (* IQueueCommand methods *)
  2195.     function InvokeAtStreamTime(out pCmd: IDeferredCommand; time: TRefTime;
  2196.         const iid: TGUID; dispidMethod: Longint; wFlags: SmallInt;
  2197.         cArgs: Longint; const pDispParams: Variant; var pvarResult: Variant;
  2198.         var puArgErr: SmallInt):  HResult; stdcall;
  2199.     function InvokeAtPresentationTime(out pCmd: IDeferredCommand;
  2200.         time: TRefTime; const iid: TGUID; dispidMethod: Longint;
  2201.         wFlags: SmallInt; cArgs: Longint; const pDispParams: Variant;
  2202.         var pvarResult: Variant; var puArgErr: SmallInt): HResult; stdcall;
  2203.   end;
  2204.  
  2205. (* Definition of interface: IFilterInfo *)
  2206.   IFilterInfo = interface(IDispatch)
  2207.     ['{56A868BA-0AD4-11CE-B03A-0020AF0BA770}']
  2208.     (* IFilterInfo methods *)
  2209.     function FindPin(strPinID: TBSTR; out ppUnk: IDispatch): HResult; stdcall;
  2210.     function get_Name(var strName: TBSTR): HResult; stdcall;
  2211.     function get_VendorInfo(var strVendorInfo: TBSTR): HResult; stdcall;
  2212.     function get_Filter(out ppUnk: IUnknown): HResult; stdcall;
  2213.     function get_Pins(out ppUnk: IDispatch): HResult; stdcall;
  2214.     function get_IsFileSource(var pbIsSource: LongBool): HResult; stdcall;
  2215.     function get_Filename(var pstrFilename: TBSTR): HResult; stdcall;
  2216.     function put_Filename(strFilename: TBSTR): HResult; stdcall;
  2217.   end;
  2218.  
  2219. (* Definition of interface: IRegFilterInfo *)
  2220.   IRegFilterInfo = interface(IDispatch)
  2221.     ['{56A868BB-0AD4-11CE-B03A-0020AF0BA770}']
  2222.     (* IRegFilterInfo methods *)
  2223.     function get_Name(var strName: TBSTR): HResult; stdcall;
  2224.     function Filter(out ppUnk: IDispatch): HResult; stdcall;
  2225.   end;
  2226.  
  2227. (* Definition of interface: IMediaTypeInfo *)
  2228.   IMediaTypeInfo = interface(IDispatch)
  2229.     ['{56A868BC-0AD4-11CE-B03A-0020AF0BA770}']
  2230.     (* IMediaTypeInfo methods *)
  2231.     function get_Type(var strType: TBSTR): HResult; stdcall;
  2232.     function get_Subtype(var strType: TBSTR): HResult; stdcall;
  2233.   end;
  2234.  
  2235. (* Definition of interface: IPinInfo *)
  2236.   IPinInfo = interface(IDispatch)
  2237.     ['{56A868BD-0AD4-11CE-B03A-0020AF0BA770}']
  2238.     (* IPinInfo methods *)
  2239.     function get_Pin(out ppUnk: IUnknown): HResult; stdcall;
  2240.     function get_ConnectedTo(out ppUnk: IDispatch): HResult; stdcall;
  2241.     function get_ConnectionMediaType(out ppUnk: IDispatch): HResult; stdcall;
  2242.     function get_FilterInfo(out ppUnk: IDispatch): HResult; stdcall;
  2243.     function get_Name(var ppUnk: TBSTR): HResult; stdcall;
  2244.     function get_Direction(var ppDirection: Longint): HResult; stdcall;
  2245.     function get_PinID(var strPinID: TBSTR): HResult; stdcall;
  2246.     function get_MediaTypes(out ppUnk: IDispatch): HResult; stdcall;
  2247.     function Connect(pPin: IUnknown): HResult; stdcall;
  2248.     function ConnectDirect(pPin: IUnknown): HResult; stdcall;
  2249.     function ConnectWithType(pPin: IUnknown; pMediaType: IDispatch): HResult; stdcall;
  2250.     function Disconnect: HResult; stdcall;
  2251.     function Render: HResult; stdcall;
  2252.   end;
  2253.  
  2254. (*==========================================================================;
  2255.  *
  2256.  *  Copyright (C) 1996-1997 Microsoft Corporation.  All Rights Reserved.
  2257.  *
  2258.  *  File:       qnetwork.h
  2259.  *
  2260.  ***************************************************************************)
  2261.  
  2262. const
  2263.   LIBID_QuartzNetTypeLib: TGUID = (D1:$56A868B1;D2:$0AD4;D3:$11CE;D4:($B0,$3A,$00,$20,$AF,$0B,$A7,$70));
  2264.  
  2265.   IID_IAMNetShowConfig: TGUID = (D1:$FA2AA8F1;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2266.   IID_IAMChannelInfo: TGUID = (D1:$FA2AA8F2;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2267.   IID_IAMNetworkStatus: TGUID = (D1:$FA2AA8F3;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2268.   IID_IAMExtendedSeeking: TGUID = (D1:$FA2AA8F9;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2269.   IID_IAMNetShowExProps: TGUID = (D1:$FA2AA8F5;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2270.   IID_IAMExtendedErrorInfo: TGUID = (D1:$FA2AA8F6;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2271.   IID_IAMMediaContent: TGUID = (D1:$FA2AA8EF;D2:$8B62;D3:$11D0;D4:($A5,$20,$00,$00,$00,$00,$00,$00));
  2272.  
  2273. type
  2274.   TAMExtendedSeekingCapabilities = (
  2275.     AM_EXSEEK_INVALID_0,
  2276.     AM_EXSEEK_CANSEEK,
  2277.     AM_EXSEEK_CANSCAN,
  2278.     AM_EXSEEK_INVALID_3,
  2279.     AM_EXSEEK_MARKERSEEK,
  2280.     AM_EXSEEK_INVALID_5,
  2281.     AM_EXSEEK_INVALID_6,
  2282.     AM_EXSEEK_INVALID_7,
  2283.     AM_EXSEEK_SCANWITHOUTCLOCK,
  2284.     AM_EXSEEK_INVALID_9,
  2285.     AM_EXSEEK_INVALID_10,
  2286.     AM_EXSEEK_INVALID_11,
  2287.     AM_EXSEEK_INVALID_12,
  2288.     AM_EXSEEK_INVALID_13,
  2289.     AM_EXSEEK_INVALID_14,
  2290.     AM_EXSEEK_INVALID_15,
  2291.     AM_EXSEEK_NOSTANDARDREPAINT
  2292.   );
  2293.  
  2294.   TDate = record
  2295.     da_year: Integer;   // Year - 1980
  2296.     da_day: Byte;       // Day of the month
  2297.     da_mon: Byte;       // Month (1 = Jan)
  2298.   end;
  2299.  
  2300. (* Definition of interface: IAMNetShowConfig *)
  2301.   IAMNetShowConfig = interface(IDispatch)
  2302.     ['{FA2AA8F1-8B62-11D0-A520-000000000000}']
  2303.     (* IAMNetShowConfig methods *)
  2304.     function get_BufferingTime(var p