home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / axextend.idl < prev    next >
Text File  |  1998-04-25  |  131KB  |  3,685 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992 - 1996  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // Extended streaming interface definitions for the ActiveMovie streaming and
  13. // synchronisation architecture. Core streaming interfaces are in AXCore.idl,
  14. // and control interfaces for the type library are in Control.odl
  15.  
  16. // include after unknwn.idl, objidl.idl and axcore.idl
  17.  
  18.  
  19. // forward declarations - these are the interfaces declared in this file
  20.  
  21. interface IEnumRegFilters;
  22. interface IFileSourceFilter;
  23. interface IFileSinkFilter;
  24. interface IFileSinkFilter2;
  25. interface IGraphBuilder;
  26. interface ICaptureGraphBuilder;
  27. interface IAMCopyCaptureFileProgress;
  28. interface IFilterMapper;
  29. interface IFilterMapper2;
  30. interface IMediaEventSink;
  31. interface IOverlay;
  32. interface IOverlayNotify;
  33. interface IQualityControl;
  34. interface ISeekingPassThru;
  35. interface IAMStreamConfig;
  36. interface IAMDevMemoryAllocator;
  37. interface IAMDevMemoryControl;
  38. interface IConfigInterleaving;
  39. interface IConfigAviMux;
  40. interface IAMVideoCompression;
  41. interface IAMVfwCaptureDialogs;
  42. interface IAMVfwCompressDialogs;
  43. interface IAMDroppedFrames;
  44. interface IAMAudioInputMixer;
  45. interface IAMBufferNegotiation;
  46. interface IAMAnalogVideoDecoder;
  47. interface IAMVideoProcAmp;
  48. interface IAMAnalogVideoEncoder;
  49. interface IAMCameraControl;
  50. interface IAMCrossbar;
  51. interface IAMTVTuner;
  52. interface IKsPropertySet;
  53. interface IAMPhysicalPinInfo;
  54. interface IAMExtDevice;
  55. interface IAMExtTransport;
  56. interface IAMTimecodeReader;
  57. interface IAMTimecodeGenerator;
  58. interface IAMTimecodeDisplay;
  59.  
  60.  
  61. //==========================================================================
  62. //==========================================================================
  63. // IEnumRegFilters interface -- enumerates registered filters.
  64. // enumerator interface returned from IFilterMapper::EnumMatchingFilters().
  65. // based on IEnum pseudo-template
  66. //==========================================================================
  67. //==========================================================================
  68.  
  69. typedef struct {
  70.     CLSID Clsid;             // class id of the filter
  71.     LPWSTR Name;             // name of filter
  72. } REGFILTER;
  73.  
  74. [
  75. object,
  76. uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770),
  77. pointer_default(unique)
  78. ]
  79.  
  80. // The point of the mapper is to avoid loading filters.  By looking in the
  81. // registry we can reduce the number of filters which must be loaded and tried.
  82. // This enumerator returns descriptors of filters (including the GUIDs that
  83. // CoCreateInstance can instantiate).  The filters themselves are not loaded.
  84.  
  85. interface IEnumRegFilters : IUnknown {
  86.     import "unknwn.idl";
  87.  
  88.     // The caller must use CoTaskMemFree to free each REGFILTER* returned
  89.     // in the array.
  90.     HRESULT Next
  91.         ( [in]  ULONG cFilters,           // place this many filters...
  92.           [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER*
  93.           [out] ULONG * pcFetched         // actual count passed returned here
  94.         );
  95.  
  96.     // I can't think why anyone would want to skip, so it's not implemented.
  97.     // (anyone who thinks they know what they would be skipping over is probably
  98.     // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL.
  99.  
  100.     HRESULT Skip(
  101.         [in] ULONG cFilters
  102.     );
  103.  
  104.     HRESULT Reset(void);
  105.  
  106.     // No cloning either - also ALWAYS returns E_NOTIMPL.
  107.  
  108.     HRESULT Clone(
  109.         [out] IEnumRegFilters **ppEnum
  110.     );
  111. }
  112.  
  113.  
  114. typedef IEnumRegFilters *PENUMREGFILTERS;
  115.  
  116. //========================================================================
  117. //========================================================================
  118. // abstraction representing the registered information about filters.
  119. // This allows properties of filters to be looked up without loading them.
  120. //========================================================================
  121. //========================================================================
  122.  
  123. [
  124. object,
  125. uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770),
  126. pointer_default(unique)
  127. ]
  128. interface IFilterMapper : IUnknown {
  129.     import "unknwn.idl";
  130.  
  131.     //==========================================================================
  132.     // Registration functions.
  133.     // A filter should be registered before any other use.
  134.     // The registration can be NON_VOLATILE (i.e. permanent, do once ever)
  135.     // or VOLATILE (once per boot of the system).
  136.     // UnregisterFilter (obviously) removes the registration.
  137.     // The action of any of the other calls on unregistered filters is undefined.
  138.     // it will either work or you'll get an error, but I'm not saying which.
  139.     //==========================================================================
  140.  
  141.     // Four predefined values controling the order in which filters are tried
  142.     // for intelligent graph building.  Intermediate values are legal.
  143.     // Any value <=MERIT_DO_NOT_USE will mean that the filter will never
  144.     // be tried by the filtergrah to automatically complete a connection.
  145.  
  146.     enum { MERIT_PREFERRED     = 0x800000,
  147.            MERIT_NORMAL        = 0x600000,
  148.            MERIT_UNLIKELY      = 0x400000,
  149.            MERIT_DO_NOT_USE    = 0x200000,
  150.            MERIT_SW_COMPRESSOR = 0x100000,
  151.            MERIT_HW_COMPRESSOR = 0x100050
  152.          };
  153.  
  154.     // Register a filter
  155.  
  156.     HRESULT RegisterFilter
  157.         ( [in] CLSID   clsid,    // GUID of the filter
  158.           [in] LPCWSTR Name,     // Descriptive name for the filter
  159.           [in] DWORD   dwMerit   // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED.
  160.         );
  161.  
  162.  
  163.     // Register an identifiable instance of a filter.  This deals with cases
  164.     // such as two similar sound cards which are driven by the same driver,
  165.     // but we want to choose which oif these cards the sound will come out of.
  166.     // This is not needed if there is only one instance of the filter
  167.     // (e.g. there is only one sound card in the machine) or if all instances
  168.     // of the filter are equivalent.
  169.  
  170.     // The filter itself must have already been registered   // ??? Is that true?
  171.     HRESULT RegisterFilterInstance
  172.         ( [in]  CLSID  clsid,      // GUID of the filter
  173.           [in]  LPCWSTR Name,      // Descriptive name of instance.
  174.           [out] CLSID *MRId        // Returned Media Resource Id.  A
  175.                                    // locally unique id for this instance
  176.                                    // of this filter
  177.         );
  178.  
  179.  
  180.     HRESULT RegisterPin
  181.         ( [in] CLSID   Filter,           // GUID of filter
  182.           [in] LPCWSTR Name,             // Name of the pin
  183.           [in] BOOL    bRendered,        // The filter renders this input
  184.           [in] BOOL    bOutput,          // TRUE if this is an Output pin
  185.           [in] BOOL    bZero,            // TRUE if OK for zero instances of pin
  186.                                          // In this case you will have to Create
  187.                                          // a pin to have even one instance
  188.           [in] BOOL    bMany,            // TRUE if OK for many instances of pin
  189.           [in] CLSID   ConnectsToFilter, // Filter it connects to if it has
  190.                                          // subterranean connection, else NULL
  191.           [in] LPCWSTR ConnectsToPin     // Name of pin it connects to
  192.                                          // NULL for output pins
  193.         );
  194.  
  195.     HRESULT RegisterPinType
  196.         ( [in] CLSID   clsFilter,        // GUID of filter
  197.           [in] LPCWSTR strName,          // Descriptive name of the pin
  198.           [in] CLSID   clsMajorType,     // Major type of the data stream
  199.           [in] CLSID   clsSubType        // Sub type of the data stream
  200.         );
  201.  
  202.  
  203.     HRESULT UnregisterFilter
  204.         ( [in] CLSID  Filter             // GUID of filter
  205.         );
  206.  
  207.  
  208.     HRESULT UnregisterFilterInstance
  209.         ( [in] CLSID  MRId               // Media Resource Id of this instance
  210.         );
  211.  
  212.  
  213.     HRESULT UnregisterPin
  214.         ( [in] CLSID   Filter,           // GUID of filter
  215.           [in] LPCWSTR Name              // Name of the pin
  216.         );
  217.  
  218.  
  219.     // Set *ppEnum to be an enumerator for filters matching the requirements.
  220.  
  221.     HRESULT EnumMatchingFilters
  222.        ( [out] IEnumRegFilters **ppEnum  // enumerator returned
  223.        , [in]  DWORD dwMerit             // at least this merit needed
  224.        , [in]  BOOL  bInputNeeded        // need at least one input pin
  225.        , [in]  CLSID clsInMaj            // input major type
  226.        , [in]  CLSID clsInSub            // input sub type
  227.        , [in]  BOOL  bRender             // must the input be rendered?
  228.        , [in]  BOOL  bOututNeeded        // need at least one output pin
  229.        , [in]  CLSID clsOutMaj           // output major type
  230.        , [in]  CLSID clsOutSub           // output sub type
  231.        );
  232.  
  233. }
  234.  
  235. // structure used to identify media types a pin handles. Used for
  236. // registration through IFilterMapper and IFilterMapper2
  237. //
  238. typedef struct
  239. {
  240.     const CLSID * clsMajorType;
  241.     const CLSID * clsMinorType;
  242. } REGPINTYPES;
  243.  
  244. // describes pin for filter registration. Used for registration
  245. // through IFilterMapper and IFilterMapper2
  246. //
  247. typedef struct
  248. {
  249.     LPWSTR           strName;
  250.  
  251.     // The filter renders this input
  252.     BOOL             bRendered;
  253.  
  254.     // This is an Output pin
  255.     BOOL             bOutput;
  256.  
  257.     // OK to have zero instances of pin In this case you will have to
  258.     // Create a pin to have even one instance
  259.     BOOL             bZero;
  260.  
  261.     // OK to create many instance of  pin
  262.     BOOL             bMany;
  263.  
  264.     const CLSID *    clsConnectsToFilter;
  265.     const WCHAR *    strConnectsToPin;
  266.  
  267.     UINT             nMediaTypes;
  268.     const REGPINTYPES * lpMediaType;
  269. } REGFILTERPINS;
  270.  
  271. // mediums (as defined in the Windows NT DDK) for registration with
  272. // IFilterMapper2
  273. //
  274. typedef struct
  275. {
  276.     CLSID clsMedium;
  277.     DWORD dw1;
  278.     DWORD dw2;
  279. } REGPINMEDIUM;
  280.  
  281. // flags for dwFlags in REFILTERPINS2
  282. enum
  283. {
  284.     // OK to have zero instances of pin In this case you will have to
  285.     // Create a pin to have even one instance
  286.     REG_PINFLAG_B_ZERO = 0x1,
  287.  
  288.     // The filter renders this input
  289.     REG_PINFLAG_B_RENDERER = 0x2,
  290.  
  291.     // OK to create many instance of  pin
  292.     REG_PINFLAG_B_MANY = 0x4,
  293.  
  294.     // This is an Output pin
  295.     REG_PINFLAG_B_OUTPUT = 0x8
  296. };
  297.  
  298.  
  299. // describes pin for filter registration through IFilterMapper2
  300. typedef struct
  301. {
  302.     // combination of REG_PINFLAG flags
  303.     DWORD dwFlags;
  304.  
  305.     // number of instances of the pin if known
  306.     UINT             cInstances;
  307.  
  308.     UINT             nMediaTypes;
  309.     [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType;
  310.  
  311.     UINT             nMediums;
  312.     [size_is(nMediums)] const REGPINMEDIUM *lpMedium;
  313.  
  314.     // pin category (for Kernel Streaming pins) as defined in the
  315.     // Windows NT DDK
  316.     const CLSID      *clsPinCategory;
  317.  
  318. } REGFILTERPINS2;
  319.  
  320. // describes filter for registration through IFilterMapper2
  321. typedef struct
  322. {
  323.     DWORD dwVersion;            // 1 or 2
  324.     DWORD dwMerit;
  325.  
  326.     /* unnamed union */
  327.     [switch_is(dwVersion)] [switch_type(DWORD)] union
  328.     {
  329.         [case(1)]
  330.  
  331.             struct
  332.             {
  333.                 ULONG cPins;
  334.                 [size_is(cPins)] const REGFILTERPINS *rgPins;
  335.             };
  336.  
  337.         [case(2)]
  338.  
  339.             struct
  340.             {
  341.                 ULONG cPins2;
  342.                 [size_is(cPins2)] const REGFILTERPINS2 *rgPins2;
  343.             };
  344.  
  345.         [default]
  346.             ;
  347.     } ;
  348.  
  349. } REGFILTER2;
  350.  
  351.  
  352.  
  353. [
  354. object,
  355. uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375),
  356. pointer_default(unique)
  357. ]
  358. interface IFilterMapper2 : IUnknown {
  359.     import "unknwn.idl";
  360.  
  361.     // create or rename ActiveMovie category
  362.     HRESULT CreateCategory
  363.         ( [in] REFCLSID clsidCategory,
  364.           [in] DWORD dwCategoryMerit,
  365.           [in] LPCWSTR Description
  366.           );
  367.  
  368.     HRESULT UnregisterFilter
  369.         ( [in] const CLSID *pclsidCategory,
  370.           [in] const OLECHAR *szInstance,
  371.           [in] REFCLSID Filter // GUID of filter
  372.         );
  373.  
  374.     // Register a filter, pins, and media types under a category.
  375.     HRESULT RegisterFilter
  376.         ( [in] REFCLSID clsidFilter,     // GUID of the filter
  377.           [in] LPCWSTR Name,             // Descriptive name for the filter
  378.  
  379.           // ppMoniker can be null. or *ppMoniker can contain the
  380.           // moniker where this filter data will be written;
  381.           // *ppMoniker will be set to null on return. or *ppMoniker
  382.           // can be null in which case the moniker will be returned
  383.           // with refcount.
  384.           [in, out] IMoniker **ppMoniker,
  385.  
  386.           // can be null
  387.           [in] const CLSID *pclsidCategory,
  388.  
  389.           // cannot be null
  390.           [in] const OLECHAR *szInstance,
  391.  
  392.           // rest of filter and pin registration
  393.           [in] const REGFILTER2 *prf2
  394.         );
  395.  
  396.     // Set *ppEnum to be an enumerator for filters matching the
  397.     // requirements.
  398.     HRESULT EnumMatchingFilters
  399.        ( [out] IEnumMoniker **ppEnum           // enumerator returned
  400.        , [in]  DWORD dwFlags                   // 0
  401.        , [in]  BOOL bExactMatch                // don't match wildcards
  402.        , [in]  DWORD dwMerit                   // at least this merit needed
  403.        , [in]  BOOL  bInputNeeded              // need at least one input pin
  404.        , [in]  DWORD cInputTypes               // Number of input types to match
  405.                                                // Any match is OK
  406.        , [size_is(cInputTypes*2)]  const GUID *pInputTypes // input major+subtype pair array
  407.        , [in]  const REGPINMEDIUM *pMedIn      // input medium
  408.        , [in]  const CLSID *pPinCategoryIn     // input pin category
  409.        , [in]  BOOL  bRender                   // must the input be rendered?
  410.        , [in]  BOOL  bOutputNeeded             // need at least one output pin
  411.        , [in]  DWORD cOutputTypes              // Number of output types to match
  412.                                                // Any match is OK
  413.        , [size_is(cOutputTypes*2)]  const GUID *pOutputTypes // output major+subtype pair array
  414.        , [in]  const REGPINMEDIUM *pMedOut     // output medium
  415.        , [in]  const CLSID *pPinCategoryOut    // output pin category
  416.        );
  417. }
  418.  
  419. //========================================================================
  420. //========================================================================
  421. // Defines IQualityControl interface
  422. //
  423. // Defines quality messages and allows a quality manager to install itself
  424. // as the sink for quality messages.
  425. //========================================================================
  426. //========================================================================
  427.  
  428. typedef enum tagQualityMessageType {
  429.     Famine,
  430.     Flood
  431. } QualityMessageType;
  432.  
  433. typedef struct tagQuality {
  434.     QualityMessageType Type;
  435.     long                Proportion;   // milli-units.  1000 = no change
  436.                             // for Flood:
  437.                             // What proportion of the media samples currently
  438.                             // coming through are required in the future.
  439.                             // 800 means please drop another 20%
  440.                             // For Famine:
  441.                             // How much to "keep in" e.g. 800 means send me
  442.                             // 20% less e.g. by dropping 20% of the samples.
  443.                             // 1100 would mean "I'm coping, send me more".
  444.     REFERENCE_TIME       Late;
  445.                             // How much you need to catch up by
  446.     REFERENCE_TIME       TimeStamp;
  447.                             // The stream time when this was generated (probably
  448.                             // corresponds to the start time on some sample).
  449. } Quality;
  450.  
  451. typedef IQualityControl *PQUALITYCONTROL;
  452.  
  453.  
  454. [
  455. object,
  456. uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770),
  457. pointer_default(unique)
  458. ]
  459. interface IQualityControl : IUnknown {
  460.  
  461.     // Notify the recipient that a quality change is requested.
  462.     // pSelf is the IBaseFilter* of the sender.
  463.     // this is sent from a filter
  464.     // to (the quality manager or) an upstream peer.
  465.     HRESULT Notify
  466.         ( [in] IBaseFilter * pSelf,
  467.           [in] Quality q
  468.         );
  469.  
  470.     // Notify the recipient that future quality messages are to be sent
  471.     // to iqc.  If piqc is NULL then quality messages are to default back to
  472.     // the upstream peer.
  473.     // This is sent from the quality manager to a filter.
  474.     // The recipient should hold piqc as a WEAK reference,
  475.     // i.e. do not AddRef it, do not Release it.
  476.     HRESULT SetSink
  477.         ( [in] IQualityControl * piqc
  478.         );
  479. }
  480.  
  481. //=====================================================================
  482. //=====================================================================
  483. // Definitions required for overlay transport
  484. //=====================================================================
  485. //=====================================================================
  486.  
  487.  
  488. // Used to communicate the colour that the IOverlay client wants the window
  489. // painted in so that it can draw directly to the correct clipping region
  490. // A colour key can be described in two alternate ways, the first is by a
  491. // range of one or more (system) palette indices. The second is by defining
  492. // a colour cube with two RGB values, any of which would be acceptable.
  493. //
  494. // The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros
  495.  
  496.  
  497. enum { CK_NOCOLORKEY = 0x0,     // No color key is required
  498.        CK_INDEX       = 0x1,    // Index into the current system palette
  499.        CK_RGB         = 0x2 };  // Color key is an RGB value (or range)
  500.  
  501. typedef struct tagCOLORKEY {
  502.  
  503.     DWORD    KeyType;           // Explains meaning of the structure
  504.     DWORD    PaletteIndex;      // Palette index if available
  505.     COLORREF LowColorValue;     // Low colour space RGB value
  506.     COLORREF HighColorValue;    // Defines the high RGB value
  507.  
  508. } COLORKEY;
  509.  
  510. // When a filter sets up an advise link it can ask that only certain types
  511. // of notifications be sent, for example just palette changes. While this
  512. // doesn't mean that the other notification call backs won't ever be called
  513. // the IOverlay implementation may use this as an efficiency optimisation
  514.  
  515. enum { ADVISE_NONE = 0x0,               // No notifications required
  516.        ADVISE_CLIPPING = 0x1,           // Synchronous clip information
  517.        ADVISE_PALETTE = 0x2,            // Palette change notifications
  518.        ADVISE_COLORKEY = 0x4,           // Called when colour key changes
  519.        ADVISE_POSITION = 0x8 };         // Likewise when window moves etc
  520.  
  521. const DWORD ADVISE_ALL = ADVISE_CLIPPING |
  522.                          ADVISE_PALETTE |
  523.                          ADVISE_COLORKEY |
  524.                          ADVISE_POSITION;
  525.  
  526. // This isn't defined when you run IDL
  527.  
  528. cpp_quote("#ifndef _WINGDI_")
  529.  
  530. typedef struct _RGNDATAHEADER {
  531.     DWORD dwSize;
  532.     DWORD iType;
  533.     DWORD nCount;
  534.     DWORD nRgnSize;
  535.     RECT  rcBound;
  536. } RGNDATAHEADER;
  537.  
  538. typedef struct _RGNDATA {
  539.     RGNDATAHEADER rdh;
  540.     char Buffer[1];
  541. } RGNDATA;
  542.  
  543. cpp_quote("#endif")
  544.  
  545.  
  546. //=====================================================================
  547. //=====================================================================
  548. // Defines IOverlayNotify interface
  549. //
  550. // This interface gives asynchronous notifications of changes to the
  551. // rendering window - such as changes to the exposed window area
  552. //=====================================================================
  553. //=====================================================================
  554.  
  555. [
  556. object,
  557. local,
  558. uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770),
  559. pointer_default(unique)
  560. ]
  561. interface IOverlayNotify : IUnknown {
  562.  
  563.     // IOverlayNotify methods
  564.  
  565.     // This notifies the filter of palette changes, the filter should copy
  566.     // the array of RGBQUADs if it needs to use them after returning. This
  567.     // is not called when the palette is actually changed in the display
  568.     // but at a short time after (in sync with WM_PALETTECHANGED messages)
  569.  
  570.     HRESULT OnPaletteChange(
  571.         [in] DWORD dwColors,                // Number of colours present
  572.         [in] const PALETTEENTRY *pPalette); // Array of palette colours
  573.  
  574.     // This provides synchronous clip changes so that the client is called
  575.     // before the window is moved to freeze the video, and then when the
  576.     // window has stabilised it is called again to start playback again.
  577.     // If the window rect is all zero then the window is invisible, the
  578.     // filter must take a copy of the information if it wants to keep it
  579.  
  580.     HRESULT OnClipChange(
  581.         [in] const RECT *pSourceRect,       // Region of video to use
  582.         [in] const RECT *pDestinationRect,  // Where video goes
  583.         [in] const RGNDATA *pRgnData);      // Defines clipping information
  584.  
  585.     HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey);
  586.  
  587.     // The calls to OnClipChange happen in sync with the window. So it is
  588.     // called with an empty clip list before the window moves to freeze
  589.     // the video, and then when the window has stabilised it is called
  590.     // again with the new clip list. The OnPositionChange callback is for
  591.     // overlay cards that don't want the expense of synchronous clipping
  592.     // updates and just want to know when the source or destination video
  593.     // positions change. They will NOT be called in sync with the window
  594.     // but at some point after the window has changed (basicly in time
  595.     // with WM_SIZE etc messages received). This is therefore suitable
  596.     // for overlay cards that don't inlay their data to the frame buffer
  597.     // NOTE the destination is NOT clipped to the visible display area
  598.  
  599.     HRESULT OnPositionChange([in] const RECT *pSourceRect,
  600.                              [in] const RECT *pDestinationRect);
  601. }
  602.  
  603. typedef IOverlayNotify *POVERLAYNOTIFY;
  604.  
  605.  
  606. //=====================================================================
  607. //=====================================================================
  608. // Defines IOverlay interface
  609. //
  610. // This interface provides information so that a filter can write direct to
  611. // the frame buffer while placing the video in the correct window position
  612. //=====================================================================
  613. //=====================================================================
  614.  
  615. [
  616. object,
  617. local,
  618. uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770),
  619. pointer_default(unique)
  620. ]
  621. interface IOverlay : IUnknown {
  622.  
  623.     // IOverlay methods
  624.  
  625.     HRESULT GetPalette(
  626.         [out] DWORD *pdwColors,              // Number of colours present
  627.         [out] PALETTEENTRY **ppPalette);     // Where to put palette data
  628.  
  629.     HRESULT SetPalette(
  630.         [in] DWORD dwColors,                 // Number of colours present
  631.         [in] PALETTEENTRY *pPalette);        // Colours to use for palette
  632.  
  633.     // If you change the colour key through SetColorKey then all the advise
  634.     // links will receive an OnColorKeyChange callback with the new colour
  635.  
  636.     HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey);
  637.     HRESULT GetColorKey([out] COLORKEY *pColorKey);
  638.     HRESULT SetColorKey([in,out] COLORKEY *pColorKey);
  639.     HRESULT GetWindowHandle([out] HWND *pHwnd);
  640.  
  641.     // The IOverlay implementation allocates the memory for the clipping
  642.     // rectangles as it can be variable in length. The filter calling
  643.     // this method should free the memory when it is finished with it
  644.  
  645.     HRESULT GetClipList([out] RECT *pSourceRect,
  646.                         [out] RECT *pDestinationRect,
  647.                         [out] RGNDATA **ppRgnData);
  648.  
  649.     // Returns the current video source and destination
  650.  
  651.     HRESULT GetVideoPosition([out] RECT *pSourceRect,
  652.                              [out] RECT *pDestinationRect);
  653.  
  654.     HRESULT Advise(
  655.         [in] IOverlayNotify *pOverlayNotify, // Notification interface
  656.         [in] DWORD dwInterests);             // Callbacks interested in
  657.  
  658.     HRESULT Unadvise();                      // Stop the callbacks now
  659. }
  660.  
  661. typedef IOverlay *POVERLAY;
  662.  
  663.  
  664. //=====================================================================
  665. //=====================================================================
  666. // control related interfaces (others are defined in control.odl)
  667. //=====================================================================
  668. //=====================================================================
  669.  
  670.  
  671. //=====================================================================
  672. //=====================================================================
  673. // Defines IMediaEventSink interface
  674. //
  675. // Exposed by filtergraph. Called by filters to notify events. Will be
  676. // passed on to application by the IMediaControl event methods.
  677. //=====================================================================
  678. //=====================================================================
  679.  
  680. [
  681.         object,
  682.         uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770),
  683.         pointer_default(unique)
  684. ]
  685. interface IMediaEventSink : IUnknown {
  686.  
  687.     // notify an event. will be queued, but not delivered to
  688.     // the application on this thread.
  689.     HRESULT Notify(
  690.         [in] long EventCode,
  691.         [in] long EventParam1,
  692.         [in] long EventParam2
  693.     );
  694. }
  695.  
  696. typedef IMediaEventSink *PMEDIAEVENTSINK;
  697.  
  698. //=====================================================================
  699. //=====================================================================
  700. // Defines IFileSourceFilter interface
  701. //
  702. // Exposed by source filters to set the file name and media type.
  703. //=====================================================================
  704. //=====================================================================
  705.  
  706. [
  707.         object,
  708.         uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770),
  709.         pointer_default(unique)
  710. ]
  711. interface IFileSourceFilter : IUnknown {
  712.  
  713.     // Load a file and assign it the given media type
  714.     HRESULT Load(
  715.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of file to open
  716.         [in] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  717.     );
  718.     // Get the currently loaded file name
  719.     HRESULT GetCurFile(
  720.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  721.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  722.     );
  723. }
  724.  
  725. typedef IFileSourceFilter *PFILTERFILESOURCE;
  726.  
  727. //=====================================================================
  728. //=====================================================================
  729. // Defines IFileSinkFilter interface
  730. //
  731. // Exposed by renderers to set the output file name.
  732. //=====================================================================
  733. //=====================================================================
  734.  
  735. [
  736.         object,
  737.         uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6),
  738.         pointer_default(unique)
  739. ]
  740. interface IFileSinkFilter : IUnknown {
  741.  
  742.     // Output to this file. default is to open the existing file
  743.     HRESULT SetFileName(
  744.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of output file
  745.         [in] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  746.     );
  747.     // Get the current file name
  748.     HRESULT GetCurFile(
  749.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  750.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  751.     );
  752. }
  753.  
  754. typedef IFileSinkFilter *PFILTERFILESINK;
  755.  
  756. [
  757.         object,
  758.         uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86),
  759.         pointer_default(unique)
  760. ]
  761. interface IFileSinkFilter2 : IFileSinkFilter {
  762.  
  763.     HRESULT SetMode(
  764.         [in] DWORD dwFlags              // AM_FILESINK_FLAGS
  765.     );
  766.  
  767.     HRESULT GetMode(
  768.         [out] DWORD *pdwFlags           // AM_FILESINK_FLAGS
  769.     );
  770. }
  771.  
  772. typedef IFileSinkFilter2 *PFILESINKFILTER2;
  773.  
  774. typedef enum {
  775.  
  776.     // create a new file
  777.     AM_FILE_OVERWRITE = 0x00000001,
  778.  
  779. } AM_FILESINK_FLAGS;
  780.  
  781.  
  782. //=====================================================================
  783. //=====================================================================
  784. // Defines IFileAsyncIO interface
  785. //
  786. // Exposed by high performance file readers
  787. //=====================================================================
  788. //=====================================================================
  789.  
  790. typedef struct _AsyncIOReq {
  791.    DWORD         engine[4];  // used by IO engine
  792.    [size_is(cb)] BYTE * lpv; // points to buffer of data to be transferred
  793.    DWORD         cb;         // size of data to be transferred
  794.  
  795.    // the following 4 fields intentionally mimic an OVERLAPPED structure
  796.    //
  797.    DWORD         dwError;    // on return, contains error/success code
  798.    DWORD         cbDone;     // number of bytes actually transferred
  799.    LARGE_INTEGER liPos;      // 64 bit seek location. on return contains read/write location
  800.    DWORD         hEvent;     // handle (used to mimic OVERLAPPED structure)
  801.  
  802.    DWORD         dwUser;     // preserved, for user data
  803.    } AsyncIOReq;
  804.  
  805. [
  806.         object,
  807.         uuid(56a868a7-0ad4-11ce-b03a-0020af0ba770),
  808.         pointer_default(unique)
  809. ]
  810. interface IFileAsyncIO : IUnknown {
  811.  
  812.     // query the required alignment for io buffers & sizes
  813.     //
  814.     HRESULT QueryAlignment (
  815.         [out] LPDWORD  pdwAlign
  816.     );
  817.  
  818.     // do async, aligned read from a specific location in the file
  819.     //
  820.     HRESULT Read (
  821.         [in] AsyncIOReq * pReq
  822.     );
  823.  
  824.     // do async, aligned write to a specific location in the file
  825.     // the file may be extended as a result.
  826.     //
  827.     HRESULT Write (
  828.         [in] AsyncIOReq * pReq
  829.     );
  830.  
  831.     // wait for the next available read to complete, on success
  832.     // returns the buffer pointer and
  833.     //
  834.     HRESULT WaitForNext (
  835.         [out] AsyncIOReq **  ppReq,    // returns pointer to next request to complete
  836.         [in]  DWORD          dwTimeout // how long to wait, 0 does not wait
  837.     );
  838.  
  839.     // wait for a specific io request to complete
  840.     //
  841.     HRESULT WaitForSpecific (
  842.         [out] AsyncIOReq * pReq,    // wait for this request to complete
  843.         [in]  DWORD        dwTimeout
  844.     );
  845.  
  846.     // discard all pending io and place all requests on the 'done' queue
  847.     //
  848.     HRESULT DiscardPending (void);
  849.  
  850.     // wait for all pending io's to be complete
  851.     //
  852.     HRESULT Flush (void);
  853. }
  854.  
  855. typedef IFileAsyncIO * PFILEASYNCIO;
  856.  
  857.  
  858. //
  859. // Intelligent connectivity for filters - an interface supported by
  860. // filter graphs (since it is an extension to IFilterGraph) that supports
  861. // building of graphs by automatic selection and connection of appropriate
  862. // filters
  863.  
  864. [
  865.     object,
  866.     local,
  867.     uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770),
  868.     pointer_default(unique)
  869. ]
  870. interface IGraphBuilder : IFilterGraph {
  871.     // Connect these two pins directly or indirectly, using transform filters
  872.     // if necessary.
  873.  
  874.     HRESULT Connect
  875.         ( [in] IPin * ppinOut,    // the output pin
  876.           [in] IPin * ppinIn      // the input pin
  877.         );
  878.  
  879.  
  880.     // Connect this output pin directly or indirectly, using transform filters
  881.     // if necessary to something that will render it.
  882.  
  883.     HRESULT Render
  884.         ( [in] IPin * ppinOut     // the output pin
  885.         );
  886.  
  887.  
  888.     // Build a filter graph that will render this file using this play list.
  889.     // If lpwstrPlayList is NULL then it will use the default play list
  890.     // which will typically render the whole file.
  891.  
  892.     HRESULT RenderFile
  893.         ( [in] LPCWSTR lpcwstrFile,
  894.           [in] LPCWSTR lpcwstrPlayList
  895.         );
  896.  
  897.  
  898.     // Add to the filter graph a source filter for this file.  This would
  899.     // be the same source filter that would be added by calling Render.
  900.     // This call gives you more control over building
  901.     // the rest of the graph, e.g. AddFilter(<a renderer of your choice>)
  902.     // and then Connect the two.
  903.     // The IBaseFilter* interface exposed by the source filter is returned
  904.     // in ppFilter, addrefed already for you
  905.     // The filter will be known by the name lpcwstrFIlterName
  906.     // nn this filter graph,
  907.     HRESULT AddSourceFilter
  908.         ( [in]      LPCWSTR lpcwstrFileName,
  909.           [in]      LPCWSTR lpcwstrFilterName,
  910.           [out]     IBaseFilter* *ppFilter
  911.         );
  912.  
  913.  
  914.     // If this call is made then trace information will be written to the
  915.     // file showing the actions taken in attempting to perform an operation.
  916.     HRESULT SetLogFile
  917.         ( [in]      HANDLE hFile  // open file handle e.g. from CreateFile
  918.         );
  919.  
  920.  
  921.     // Request that the graph builder should return as soon as possible from
  922.     // its current task.
  923.     // Note that it is possible fot the following to occur in the following
  924.     // sequence:
  925.     //     Operation begins; Abort is requested; Operation completes normally.
  926.     // This would be normal whenever the quickest way to finish an operation
  927.     // was to simply continue to the end.
  928.     HRESULT Abort();
  929.  
  930.     // Return S_OK if the curent operation is to continue,
  931.     // return S_FALSE if the current operation is to be aborted.
  932.     // This method can be called as a callback from a filter which is doing
  933.     // some operation at the request of the graph.
  934.     HRESULT ShouldOperationContinue();
  935.  
  936. }
  937.  
  938.  
  939. //
  940. // New capture graph builder
  941.  
  942. [
  943.     object,
  944.     local,
  945.     uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5),
  946.     pointer_default(unique)
  947. ]
  948. interface ICaptureGraphBuilder : IUnknown {
  949.  
  950.     // Use this filtergraph
  951.     HRESULT SetFiltergraph(
  952.     [in] IGraphBuilder *pfg);
  953.  
  954.     // what filtergraph are you using?
  955.     // *ppfg->Release() when you're done with it
  956.     HRESULT GetFiltergraph(
  957.     [out] IGraphBuilder **ppfg);
  958.  
  959.     // creates a rendering section in the filtergraph consisting of a MUX
  960.     // of some filetype, and a file writer (and connects them together)
  961.     // *ppf->Release() when you're done with it
  962.     // *ppSink->Release() when you're done with it
  963.     HRESULT SetOutputFileName(
  964.     [in] const GUID *pType,    // type of file to write, eg. MEDIASUBTYPE_Avi
  965.     [in] LPCOLESTR lpstrFile,    // filename given to file writer
  966.     [out] IBaseFilter **ppf,    // returns pointer to the MUX
  967.         [out] IFileSinkFilter **ppSink);// queried from file writer
  968.  
  969.     // Looks for an interface on the filter and on the output pin of the given
  970.     // category.  Possible categories are "capture" and "preview" and NULL for
  971.     // "don't care". (And in the future "time code" and "VBI data").
  972.     // It will also look upstream and downstream of
  973.     // the pin for the interface, to find interfaces on renderers, MUXES, TV
  974.     // Tuners, etc.
  975.     // Call *ppint->Release() when you're done with it
  976.     HRESULT FindInterface(
  977.     [in] const GUID *pCategory,    // can be NULL for all pins
  978.     [in] IBaseFilter *pf,
  979.     [in] REFIID riid,
  980.     [out] void **ppint);
  981.  
  982.     // Connects the pin of the given category of the source filter to the
  983.     // rendering filter, optionally through another filter (compressor?)
  984.     // For the "capture" category, it will
  985.     // instantiate and connect additional required filters upstream too, like
  986.     // TV Tuners and Crossbars (this part can only be done if you give a
  987.     // Moniker) If there is only one output pin on the source, use a NULL
  988.     // category.  You can also have pSource be a pin, and not use the moniker
  989.     HRESULT RenderStream(
  990.     [in] const GUID *pCategory,    // can be NULL if only one output pin
  991.     [in] IUnknown *pSource,        // must match pMSource
  992.     [in] IBaseFilter *pfCompressor,
  993.     [in] IBaseFilter *pfRenderer);    // can be NULL
  994.  
  995.     // Sends IAMStreamControl messages to the pin of the desired category, eg.
  996.     // "capture" or "preview"
  997.     // REFERENCE_TIME=NULL means NOW
  998.     // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
  999.     // NULL controls all capture filters in the graph - you will get one
  1000.     //     notification for each filter with a pin of that category found
  1001.     // returns S_FALSE if stop will be signalled before last sample is
  1002.     //     rendered.
  1003.     // return a FAILURE code if the filter does not support IAMStreamControl
  1004.     HRESULT ControlStream(
  1005.     [in] const GUID *pCategory,
  1006.     [in] IBaseFilter *pFilter,
  1007.     [in] REFERENCE_TIME *pstart,
  1008.     [in] REFERENCE_TIME *pstop,
  1009.     [in] WORD wStartCookie,        // high word reserved
  1010.     [in] WORD wStopCookie);        // high word reserved
  1011.  
  1012.     // creates a pre-allocated file of a given size in bytes
  1013.     HRESULT AllocCapFile(
  1014.     [in] LPCOLESTR lpstr,
  1015.     [in] DWORDLONG dwlSize);
  1016.  
  1017.     // Copies the valid file data out of the old, possibly huge old capture
  1018.     //   file into a shorter new file.
  1019.     // Return S_FALSE from your progress function to abort capture, S_OK to
  1020.     //   continue
  1021.     HRESULT CopyCaptureFile(
  1022.     [in] LPOLESTR lpwstrOld,
  1023.     [in] LPOLESTR lpwstrNew,
  1024.     [in] int fAllowEscAbort,    // pressing ESC will abort?
  1025.     [in] IAMCopyCaptureFileProgress *pCallback);    // implement this to
  1026.                             // get progress
  1027. }
  1028.  
  1029.  
  1030. //
  1031. // Capture graph builder "CopyCapturedFile" progress callback
  1032.  
  1033. [
  1034.     object,
  1035.     uuid(670d1d20-a068-11d0-b3f0-00aa003761c5),
  1036.     pointer_default(unique)
  1037. ]
  1038. interface IAMCopyCaptureFileProgress : IUnknown {
  1039.  
  1040.     // If you support this interface somewhere, this function will be called
  1041.     // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing
  1042.     // to let you know the progress
  1043.     //
  1044.     // Return S_OK from this function to continue.  Return S_FALSE to abort the
  1045.     // copy
  1046.     HRESULT Progress(
  1047.     [in] int iProgress);        // a number between 0 and 100 (%)
  1048. }
  1049.  
  1050. enum _AM_RENSDEREXFLAGS {
  1051.     AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers
  1052. };
  1053.  
  1054. //
  1055. // IFilterGraph2
  1056. //
  1057. // New methods on for IFilterGraph and IGraphBuilder will have to go here.
  1058. //
  1059.  
  1060. [
  1061.     object,
  1062.     local,
  1063.     uuid(36b73882-c2c8-11cf-8b46-00805f6cef60),
  1064.     pointer_default(unique)
  1065. ]
  1066. interface IFilterGraph2: IGraphBuilder {
  1067.  
  1068.     // Add a Moniker source moniker
  1069.     HRESULT AddSourceFilterForMoniker(
  1070.           [in] IMoniker *pMoniker,
  1071.           [in] IBindCtx *pCtx,
  1072.           [in] LPCWSTR lpcwstrFilterName,
  1073.           [out] IBaseFilter **ppFilter
  1074.     );
  1075.  
  1076.     // Specify the type for a reconnect
  1077.     // This is better than Reconnect as sometime the parties to a
  1078.     // reconnection can't remember what type they'd agreed (!)
  1079.     HRESULT ReconnectEx
  1080.         ( [in] IPin * ppin,             // the pin to disconnect and reconnect
  1081.           [in] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL
  1082.         );
  1083.  
  1084.     // Render a pin without adding any new renderers
  1085.     HRESULT RenderEx( [in] IPin *pPinOut,         // Pin to render
  1086.                       [in] DWORD dwFlags,         // flags
  1087.                       [in, out] LPVOID pvContext   // Unused - set to NULL
  1088.                     );
  1089.  
  1090. #if 0
  1091.     // Method looks for a filter which supports the specified interface.  If such
  1092.     // a filter exists, an AddRef()'ed pointer to the requested interface is placed
  1093.     // in *ppInterface.
  1094.     //
  1095.     // *ppInterface will be NULL on return if such a filter could not be found, and
  1096.     // the method will return E_NOINTERFACE.
  1097.     //
  1098.     // pdwIndex is an internal index that is used for obtaining subsequent interfaces.
  1099.     // *pdwIndex should be initialized to zero.  It is set on return to a value that
  1100.     // allows the implementation of FindFilterInterface to search for further interfaces
  1101.     // if called again.  If no more such interfaces exist, the method will return E_NOINTERFACE.
  1102.     //
  1103.     // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just
  1104.     // a single filter in the graph that supports the interface.  Otherwise it returns
  1105.     // E_NOINTERFACE.
  1106.     //
  1107.     HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex );
  1108.  
  1109.     // Tries to obtain the interface from the filter graph itself.  If this fails,
  1110.     // it attempts to find the unique filter that supports the interface.
  1111.     // On failure the method will return E_NOINTERFACE.  On success, it returns
  1112.     // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface.
  1113.     //
  1114.     HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface );
  1115.  
  1116. #endif
  1117. }
  1118.  
  1119. //
  1120. // StreamBuilder
  1121. // aka Graph building with constraints
  1122. // aka convergent graphs
  1123. // aka Closed captioning
  1124.  
  1125. [
  1126.     object,
  1127.     local,
  1128.     uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770),
  1129.     pointer_default(unique)
  1130. ]
  1131. interface IStreamBuilder : IUnknown {
  1132.  
  1133.     // Connect this output pin directly or indirectly, using transform filters
  1134.     // if necessary to thing(s) that will render it, within this graph
  1135.     // Move from Initial state to Rendered state.
  1136.  
  1137.     HRESULT Render
  1138.         ( [in] IPin * ppinOut,         // the output pin
  1139.           [in] IGraphBuilder * pGraph  // the graph
  1140.         );
  1141.  
  1142.     // Undo what you did in Render.  Return to Initial state.
  1143.     HRESULT Backout
  1144.         ( [in] IPin * ppinOut,         // the output pin
  1145.           [in] IGraphBuilder * pGraph  // the graph
  1146.         );
  1147. }
  1148.  
  1149.  
  1150. // async reader interface - supported by file source filters. Allows
  1151. // multiple overlapped reads from different positions
  1152.  
  1153.  
  1154. [
  1155.         object,
  1156.         uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770),
  1157.         pointer_default(unique)
  1158. ]
  1159. interface IAsyncReader : IUnknown
  1160. {
  1161.     // pass in your preferred allocator and your preferred properties.
  1162.     // method returns the actual allocator to be used. Call GetProperties
  1163.     // on returned allocator to learn alignment and prefix etc chosen.
  1164.     // this allocator will be not be committed and decommitted by
  1165.     // the async reader, only by the consumer.
  1166.     // Must call this before calling Request.
  1167.     HRESULT RequestAllocator(
  1168.                 [in]  IMemAllocator* pPreferred,
  1169.                 [in]  ALLOCATOR_PROPERTIES* pProps,
  1170.                 [out] IMemAllocator ** ppActual);
  1171.  
  1172.     // queue a request for data.
  1173.     // media sample start and stop times contain the requested absolute
  1174.     // byte position (start inclusive, stop exclusive).
  1175.     // may fail if sample not obtained from agreed allocator.
  1176.     // may fail if start/stop position does not match agreed alignment.
  1177.     // samples allocated from source pin's allocator may fail
  1178.     // GetPointer until after returning from WaitForNext.
  1179.     // Stop position must be aligned - this means it may exceed duration.
  1180.     // on completion, stop position will be corrected to unaligned
  1181.     // actual data.
  1182.     HRESULT Request(
  1183.                 [in] IMediaSample* pSample,
  1184.                 [in] DWORD dwUser);            // user context
  1185.  
  1186.     // block until the next sample is completed or the timeout occurs.
  1187.     // timeout (millisecs) may be 0 or INFINITE. Samples may not
  1188.     // be delivered in order. If there is a read error of any sort, a
  1189.     // notification will already have been sent by the source filter,
  1190.     // and HRESULT will be an error.
  1191.     // If ppSample is not null, then a Request completed with the result
  1192.     // code returned.
  1193.     HRESULT WaitForNext(
  1194.                 [in]  DWORD dwTimeout,
  1195.                 [out] IMediaSample** ppSample,  // completed sample
  1196.                 [out] DWORD * pdwUser);        // user context
  1197.  
  1198.     // sync read of data. Sample passed in must have been acquired from
  1199.     // the agreed allocator. Start and stop position must be aligned.
  1200.     // equivalent to a Request/WaitForNext pair, but may avoid the
  1201.     // need for a thread on the source filter.
  1202.     HRESULT SyncReadAligned(
  1203.                 [in] IMediaSample* pSample);
  1204.  
  1205.  
  1206.     // sync read. works in stopped state as well as run state.
  1207.     // need not be aligned. Will fail if read is beyond actual total
  1208.     // length.
  1209.     HRESULT SyncRead(
  1210.                 [in]  LONGLONG llPosition,    // absolute file position
  1211.                 [in]  LONG lLength,        // nr bytes required
  1212.                 [out, size_is(lLength)]
  1213.               BYTE* pBuffer);        // write data here
  1214.  
  1215.     // return total length of stream, and currently available length.
  1216.     // reads for beyond the available length but within the total length will
  1217.     // normally succeed but may block for a long period.
  1218.     HRESULT Length(
  1219.                 [out] LONGLONG* pTotal,
  1220.                 [out] LONGLONG* pAvailable);
  1221.  
  1222.     // cause all outstanding reads to return, possibly with a failure code
  1223.     //(VFW_E_TIMEOUT) indicating they were cancelled.
  1224.     // Between BeginFlush and EndFlush calls, Request calls will fail and
  1225.     // WaitForNext calls will always complete immediately.
  1226.     HRESULT BeginFlush(void);
  1227.     HRESULT EndFlush(void);
  1228. }
  1229.  
  1230.  
  1231. // interface provided by the filtergraph itself to let other objects
  1232. // (especially plug-in distributors, but also apps like graphedt) know
  1233. // when the graph has changed.
  1234. [
  1235.     object,
  1236.     uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770),
  1237.     pointer_default(unique)
  1238. ]
  1239. interface IGraphVersion : IUnknown
  1240. {
  1241.     // returns the current graph version number
  1242.     // this is incremented every time there is a change in the
  1243.     // set of filters in the graph or in their connections
  1244.     //
  1245.     // if this is changed since your last enumeration, then re-enumerate
  1246.     // the graph
  1247.     HRESULT QueryVersion(LONG* pVersion);
  1248. }
  1249.  
  1250.  
  1251.  
  1252.  
  1253. //
  1254. // interface describing an object that uses resources.
  1255. //
  1256. // implement if: you request resources using IResourceManager. You will
  1257. // need to pass your implementation of this pointer as an in param.
  1258. //
  1259. // use if: you are a resource manager who implements IResourceManager
  1260. [
  1261.     object,
  1262.     uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770),
  1263.     pointer_default(unique)
  1264. ]
  1265. interface IResourceConsumer : IUnknown
  1266. {
  1267.     // you may acquire the resource specified.
  1268.     // return values:
  1269.     //      S_OK    -- I have successfully acquired it
  1270.     //      S_FALSE -- I will acquire it and call NotifyAcquire afterwards
  1271.     //      VFW_S_NOT_NEEDED: I no longer need the resource
  1272.     //      FAILED(hr)-I tried to acquire it and failed.
  1273.  
  1274.     HRESULT
  1275.     AcquireResource(
  1276.         [in] LONG idResource);
  1277.  
  1278.  
  1279.  
  1280.     // Please release the resource.
  1281.     // return values:
  1282.     //      S_OK    -- I have released it (and want it again when available)
  1283.     //      S_FALSE -- I will call NotifyRelease when I have released it
  1284.     //      other   something went wrong.
  1285.     HRESULT
  1286.     ReleaseResource(
  1287.         [in] LONG idResource);
  1288. }
  1289.  
  1290.  
  1291.  
  1292. // interface describing a resource manager that will resolve contention for
  1293. // named resources.
  1294. //
  1295. // implement if: you are a resource manager. The filtergraph will be a resource
  1296. // manager, internally delegating to the system wide resource manager
  1297. // (when there is one)
  1298. //
  1299. // use if: you need resources that are limited. Use the resource manager to
  1300. // resolve contention by registering the resource with this interface,
  1301. // and requesting it from this interface whenever needed.
  1302. //
  1303. // or use if: you detect focus changes which should affect resource usage.
  1304. // Notifying change of focus to the resource manager will cause the resource
  1305. // manager to switch contended resources to the objects that have the user's
  1306. // focus
  1307. [
  1308.     object,
  1309.     uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770),
  1310.     pointer_default(unique)
  1311. ]
  1312. interface IResourceManager : IUnknown
  1313. {
  1314.     // tell the manager how many there are of a resource.
  1315.     // ok if already registered. will take new count. if new count
  1316.     // is lower, will de-allocate resources to new count.
  1317.     //
  1318.     // You get back a token that will be used in further calls.
  1319.     //
  1320.     // Passing a count of 0 will eliminate this resource. There is currently
  1321.     // no defined way to find the id without knowing the count.
  1322.     //
  1323.     HRESULT
  1324.     Register(
  1325.         [in] LPCWSTR pName,         // this named resource
  1326.         [in] LONG   cResource,      // has this many instances
  1327.         [out] LONG* plToken         // token placed here on return
  1328.         );
  1329.  
  1330.     HRESULT
  1331.     RegisterGroup(
  1332.         [in] LPCWSTR pName,         // this named resource group
  1333.         [in] LONG cResource,        // has this many resources
  1334.         [in, size_is(cResource)]
  1335.              LONG* palTokens,      // these are the contained resources
  1336.         [out] LONG* plToken        // group resource id put here on return
  1337.         );
  1338.  
  1339.     // request the use of a given, registered resource.
  1340.     // possible return values:
  1341.     //      S_OK == yes you can use it now
  1342.     //      S_FALSE == you will be called back when the resource is available
  1343.     //      other - there is an error.
  1344.     //
  1345.     // The priority of this request should be affected by the associated
  1346.     // focus object -- that is, when SetFocus is called for that focus
  1347.     // object (or a 'related' object) then my request should be put through.
  1348.     //
  1349.     // A filter should pass the filter's IUnknown here. The filtergraph
  1350.     // will match filters to the filtergraph, and will attempt to trace
  1351.     // filters to common source filters when checking focus objects.
  1352.     // The Focus object must be valid for the entire lifetime of the request
  1353.     // -- until you call CancelRequest or NotifyRelease(id, p, FALSE)
  1354.     HRESULT
  1355.     RequestResource(
  1356.         [in] LONG idResource,
  1357.         [in] IUnknown* pFocusObject,
  1358.         [in] IResourceConsumer* pConsumer
  1359.         );
  1360.  
  1361.  
  1362.     // notify the resource manager that an acquisition attempt completed.
  1363.     // Call this method after an AcquireResource method returned
  1364.     // S_FALSE to indicate asynchronous acquisition.
  1365.     // HR should be S_OK if the resource was successfully acquired, or a
  1366.     // failure code if the resource could not be acquired.
  1367.     HRESULT
  1368.     NotifyAcquire(
  1369.         [in] LONG idResource,
  1370.         [in] IResourceConsumer* pConsumer,
  1371.         [in] HRESULT hr);
  1372.  
  1373.     // Notify the resource manager that you have released a resource. Call
  1374.     // this in response to a ReleaseResource method, or when you have finished
  1375.     // with the resource. bStillWant should be TRUE if you still want the
  1376.     // resource when it is next available, or FALSE if you no longer want
  1377.     // the resource.
  1378.     HRESULT
  1379.     NotifyRelease(
  1380.         [in] LONG idResource,
  1381.         [in] IResourceConsumer* pConsumer,
  1382.         [in] BOOL bStillWant);
  1383.  
  1384.     // I don't currently have the resource, and I no longer need it.
  1385.     HRESULT
  1386.     CancelRequest(
  1387.         [in] LONG idResource,
  1388.         [in] IResourceConsumer* pConsumer);
  1389.  
  1390.     // Notify the resource manager that a given object has been given the
  1391.     // user's focus. In ActiveMovie, this will normally be a video renderer
  1392.     // whose window has received the focus. The filter graph will switch
  1393.     // contended resources to (in order):
  1394.     //      requests made with this same focus object
  1395.     //      requests whose focus object shares a common source with this
  1396.     //      requests whose focus object shares a common filter graph
  1397.     // After calling this, you *must* call ReleaseFocus before the IUnknown
  1398.     // becomes invalid, unless you can guarantee that another SetFocus
  1399.     // of a different object is done in the meantime. No addref is held.
  1400.     //
  1401.     // The resource manager will hold this pointer until replaced or cancelled,
  1402.     // and will use it to resolve resource contention. It will call
  1403.     // QueryInterface for IBaseFilter at least and if found will call methods on
  1404.     // that interface.
  1405.     HRESULT
  1406.     SetFocus(
  1407.         [in] IUnknown* pFocusObject);
  1408.  
  1409.     // Sets the focus to NULL if the current focus object is still
  1410.     // pFocusObject. Call this when
  1411.     // the focus object is about to be destroyed to ensure that no-one is
  1412.     // still referencing the object.
  1413.     HRESULT
  1414.     ReleaseFocus(
  1415.         [in] IUnknown* pFocusObject);
  1416.  
  1417.  
  1418.  
  1419. // !!! still need
  1420. //      -- app override (some form of SetPriority)
  1421. //      -- enumeration and description of resources
  1422.  
  1423. }
  1424.  
  1425.  
  1426. //
  1427. // Interface representing an object that can be notified about state
  1428. // and other changes within a filter graph. The filtergraph will call plug-in
  1429. // distributors that expose this optional interface so that they can
  1430. // respond to appropriate changes.
  1431. //
  1432. // Implement if: you are a plug-in distributor (your class id is found
  1433. // under HKCR\Interface\<IID>\Distributor= for some interface).
  1434. //
  1435. // Use if: you are the filtergraph.
  1436. [
  1437.     object,
  1438.     uuid(56a868af-0ad4-11ce-b03a-0020af0ba770),
  1439.     pointer_default(unique)
  1440. ]
  1441. interface IDistributorNotify : IUnknown
  1442. {
  1443.     // called when graph is entering stop state. Called before
  1444.     // filters are stopped.
  1445.     HRESULT Stop(void);
  1446.  
  1447.     // called when graph is entering paused state, before filters are
  1448.     // notified
  1449.     HRESULT Pause(void);
  1450.  
  1451.     // called when graph is entering running state, before filters are
  1452.     // notified. tStart is the stream-time offset parameter that will be
  1453.     // given to each filter's IBaseFilter::Run method.
  1454.     HRESULT Run(REFERENCE_TIME tStart);
  1455.  
  1456.     // called when the graph's clock is changing, with the new clock. Addref
  1457.     // the clock if you hold it beyond this method. Called before
  1458.     // the filters are notified.
  1459.     HRESULT SetSyncSource(
  1460.         [in] IReferenceClock * pClock);
  1461.  
  1462.     // called when the set of filters or their connections has changed.
  1463.     // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything
  1464.     // that will lead to one of these).
  1465.     // You don't need to rebuild your list of interesting filters at this point
  1466.     // but you should release any refcounts you hold on any filters that
  1467.     // have been removed.
  1468.     HRESULT NotifyGraphChange(void);
  1469. }
  1470.  
  1471. typedef enum {
  1472.     AM_STREAM_INFO_START_DEFINED = 0x00000001,
  1473.     AM_STREAM_INFO_STOP_DEFINED  = 0x00000002,
  1474.     AM_STREAM_INFO_DISCARDING    = 0x00000004,
  1475.     AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010
  1476. } AM_STREAM_INFO_FLAGS;
  1477.  
  1478. //  Stream information
  1479. typedef struct {
  1480.     REFERENCE_TIME tStart;
  1481.     REFERENCE_TIME tStop;
  1482.     DWORD dwStartCookie;
  1483.     DWORD dwStopCookie;
  1484.     DWORD dwFlags;
  1485. } AM_STREAM_INFO;
  1486.  
  1487. //
  1488. // IAMStreamControl
  1489. //
  1490.  
  1491. [
  1492.     object,
  1493.     uuid(36b73881-c2c8-11cf-8b46-00805f6cef60),
  1494.     pointer_default(unique)
  1495. ]
  1496. interface IAMStreamControl : IUnknown
  1497. {
  1498.     // The REFERENCE_TIME pointers may be null, which
  1499.     // indicates immediately.  If the pointer is non-NULL
  1500.     // and dwCookie is non-zero, then pins should send
  1501.     // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED
  1502.     // with an IPin pointer and the cookie, thus allowing
  1503.     // apps to tie the events back to their requests.
  1504.     // If either dwCookies is zero, or the pointer is null,
  1505.     // then no event is sent.
  1506.  
  1507.     // If you have a capture pin hooked up to a MUX input pin and they
  1508.     // both support IAMStreamControl, you'll want the MUX to signal the
  1509.     // stop so you know the last frame was written out.  In order for the
  1510.     // MUX to know it's finished, the capture pin will have to send one
  1511.     // extra sample after it was supposed to stop, so the MUX can trigger
  1512.     // off that.  So you would set bSendExtra to TRUE for the capture pin
  1513.     // Leave it FALSE in all other cases.
  1514.  
  1515.     HRESULT StartAt( [in] const REFERENCE_TIME * ptStart,
  1516.                      [in] DWORD dwCookie );
  1517.     HRESULT StopAt(  [in] const REFERENCE_TIME * ptStop,
  1518.                      [in] BOOL bSendExtra,
  1519.                      [in] DWORD dwCookie );
  1520.     HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo);
  1521. }
  1522.  
  1523.  
  1524.  
  1525. //
  1526. // ISeekingPassThru
  1527. //
  1528.  
  1529. [
  1530.     object,
  1531.     uuid(36b73883-c2c8-11cf-8b46-00805f6cef60),
  1532.     pointer_default(unique)
  1533. ]
  1534. interface ISeekingPassThru : IUnknown
  1535. {
  1536.     HRESULT Init(  [in] BOOL bSupportRendering,
  1537.                    [in] IPin *pPin);
  1538. }
  1539.  
  1540.  
  1541.  
  1542. //
  1543. // IAMStreamConfig - pin interface
  1544. //
  1545.  
  1546. // A capture filter or compression filter's output pin
  1547. // supports this interface - no matter what data type you produce.
  1548.  
  1549. // This interface can be used to set the output format of a pin (as an
  1550. // alternative to connecting the pin using a specific media type).
  1551. // After setting an output format, the pin will use that format
  1552. // the next time it connects to somebody, so you can just Render that
  1553. // pin and get a desired format without using Connect(CMediaType)
  1554. // Your pin should do that by ONLY OFFERING the media type set in SetFormat
  1555. // in its enumeration of media types, and no others.  This will ensure that
  1556. // that format is indeed used for connection (or at least offer it first).
  1557. // An application interested in enumerating accepted mediatypes may have to
  1558. // do so BEFORE calling SetFormat.
  1559.  
  1560. // But this interface's GetStreamCaps function can get more information
  1561. // about accepted media types than the traditional way of enumerating a pin's
  1562. // media types, so it should typically be used instead.
  1563. // GetStreamCaps gets information about the kinds of formats allowed... how
  1564. // it can stretch and crop, and the frame rate and data rates allowed (for
  1565. // video)
  1566.  
  1567. // VIDEO EXAMPLE
  1568. //
  1569. // GetStreamCaps returns a whole array of {MediaType, Capabilities}.
  1570. // Let's say your capture card supports JPEG anywhere between 160x120 and
  1571. // 320x240, and also the size 640x480.  Also, say it supports RGB24 at
  1572. // resolutions between 160x120 and 320x240 but only multiples of 8.  You would
  1573. // expose these properties by offering a media type of 320 x 240 JPEG
  1574. // (if that is your default or preferred size) coupled with
  1575. // capabilities saying minimum 160x120 and maximum 320x240 with granularity of
  1576. // 1.  The next pair you expose is a media type of 640x480 JPEG coupled with
  1577. // capabilities of min 640x480 max 640x480.  The third pair is media type
  1578. // 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8.
  1579. // In this way you can expose almost every quirk your card might have.
  1580. // An application interested in knowing what compression formats you provide
  1581. // can get all the pairs and make a list of all the unique sub types of the
  1582. // media types.
  1583. //
  1584. // If a filter's output pin is connected with a media type that has rcSource
  1585. // and rcTarget not empty, it means the filter is being asked to stretch the
  1586. // rcSource sub-rectangle of its InputSize (the format of the input pin for
  1587. // a compressor, and the largest bitmap a capture filter can generate with
  1588. // every pixel unique) into the rcTarget sub-rectangle of its output format.
  1589. // For instance, if a video compressor has as input 160x120 RGB, and as output
  1590. // 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100)
  1591. // this means the compressor is being asked to take a 10x10 piece of the 160x120
  1592. // RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap,
  1593. // leaving the rest of the 320x240 bitmap untouched.
  1594. // A filter does not have to support this and can fail to connect with a
  1595. // media type where rcSource and rcTarget are not empty.
  1596. //
  1597. // Your output pin is connected to the next filter with a certain media
  1598. // type (either directly or using the media type passed by SetFormat),
  1599. // and you need to look at the AvgBytesPerSecond field of the format
  1600. // of that mediatype to see what data rate you are being asked to compress
  1601. // the video to, and use that data rate.  Using the number of frames per
  1602. // second in AvgTimePerFrame, you can figure out how many bytes each frame
  1603. // is supposed to be.  You can make it smaller, but NEVER EVER make a bigger
  1604. // data rate.  For a video compressor, your input pin's media type tells you
  1605. // the frame rate (use that AvgTimePerFrame).  For a capture filter, the
  1606. // output media type tells you, so use that AvgTimePerFrame.
  1607. //
  1608. // The cropping rectangle described below is the same as the rcSrc of the
  1609. // output pin's media type.
  1610. //
  1611. // The output rectangle described below is the same of the width and height
  1612. // of the BITMAPINFOHEADER of the media type of the output pin's media type
  1613.  
  1614.  
  1615. // AUDIO EXAMPLE
  1616. //
  1617. // This API can return an array of pairs of (media type, capabilities).
  1618. // This can be used to expose all kinds of wierd capabilities.  Let's say you
  1619. // do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or
  1620. // stereo, and you also do 48,000 16bit stereo as a special combination.
  1621. // You would expose 3 pairs.  The first pair would have Min Freq of 11025 and
  1622. // Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the
  1623. // capabilites structure, and a media type of anything you like, maybe
  1624. // 22kHz, 8bit stereo as a default.
  1625. // The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in
  1626. // the capabilities structure and the media type could be something like
  1627. // 44kHz, 16bit stereo as a default (the media type in the pair should always
  1628. // be something legal as described by the capabilities structure... the
  1629. // structure tells you how you can change the media type to produce other
  1630. // legal media types... for instance changing 44kHz to 29010Hz would be legal,
  1631. // but changing bits from 16 to 14 would not be.)
  1632. // The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2
  1633. // MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo.
  1634. // You can also use the Granularity elements of the structure (like the example
  1635. // for video) if you support values that multiples of n, eg.  you could say
  1636. // minimum bits per sample 8, max 16, and granularity 8 to describe doing
  1637. // either 8 or 16 bit all in one structure
  1638. //
  1639. // If you support non-PCM formats, the media type returned in GetStreamCaps
  1640. // can show which non-PCM formats you support (with a default sample rate,
  1641. // bit rate and channels) and the capabilities structure going with that
  1642. // media type can describe which other sample rates, bit rates and channels
  1643. // you support.
  1644.  
  1645. [
  1646.     object,
  1647.     uuid(C6E13340-30AC-11d0-A18C-00A0C9118956),
  1648.     pointer_default(unique)
  1649. ]
  1650. interface IAMStreamConfig : IUnknown
  1651. {
  1652.  
  1653.     // this is the structure returned by a VIDEO filter
  1654.     //
  1655.     typedef struct _VIDEO_STREAM_CONFIG_CAPS {
  1656.  
  1657.     GUID        guid;    // will be MEDIATYPE_Video
  1658.  
  1659.     // the logical or of all the AnalogVideoStandard's supported
  1660.     // typically zero if not supported
  1661.     ULONG        VideoStandard;
  1662.  
  1663.     // the inherent size of the incoming signal... taken from the input
  1664.     // pin for a compressor, or the largest size a capture filter can
  1665.     // digitize the signal with every pixel still unique
  1666.         SIZE        InputSize;
  1667.  
  1668.     // The input of a compressor filter may have to be connected for these
  1669.     // to be known
  1670.  
  1671.     // smallest rcSrc cropping rect allowed
  1672.         SIZE        MinCroppingSize;
  1673.     // largest rcSrc cropping rect allowed
  1674.         SIZE        MaxCroppingSize;
  1675.     // granularity of cropping size - eg only widths a multiple of 4 allowed
  1676.         int         CropGranularityX;
  1677.         int         CropGranularityY;
  1678.     // alignment of cropping rect - eg rect must start on multiple of 4
  1679.     int        CropAlignX;
  1680.     int        CropAlignY;
  1681.  
  1682.     // The input of a compressor filter may have to be connected for these
  1683.     // to be known
  1684.  
  1685.     // smallest bitmap this pin can produce
  1686.         SIZE        MinOutputSize;
  1687.     // largest bitmap this pin can produce
  1688.         SIZE        MaxOutputSize;
  1689.     // granularity of output bitmap size
  1690.         int         OutputGranularityX;
  1691.         int         OutputGranularityY;
  1692.     // !!! what about alignment of rcTarget inside BIH if different?
  1693.  
  1694.     // how well can you stretch in the x direction?  0==not at all
  1695.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1696.     // etc.
  1697.     int        StretchTapsX;
  1698.     int        StretchTapsY;
  1699.     // how well can you shrink in the x direction?  0==not at all
  1700.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1701.     // etc.
  1702.     int        ShrinkTapsX;
  1703.     int        ShrinkTapsY;
  1704.  
  1705.     // CAPTURE filter only - what frame rates are allowed?
  1706.         LONGLONG    MinFrameInterval;
  1707.         LONGLONG    MaxFrameInterval;
  1708.  
  1709.     // what data rates can this pin produce?
  1710.         LONG        MinBitsPerSecond;
  1711.         LONG        MaxBitsPerSecond;
  1712.     } VIDEO_STREAM_CONFIG_CAPS;
  1713.  
  1714.  
  1715.     // this is the structure returned by an AUDIO filter
  1716.     //
  1717.     typedef struct _AUDIO_STREAM_CONFIG_CAPS {
  1718.  
  1719.       GUID       guid;    // will be MEDIATYPE_Audio
  1720.     ULONG        MinimumChannels;
  1721.        ULONG      MaximumChannels;
  1722.     ULONG      ChannelsGranularity;
  1723.        ULONG      MinimumBitsPerSample;
  1724.        ULONG      MaximumBitsPerSample;
  1725.     ULONG      BitsPerSampleGranularity;
  1726.        ULONG      MinimumSampleFrequency;
  1727.        ULONG      MaximumSampleFrequency;
  1728.     ULONG      SampleFrequencyGranularity;
  1729.     } AUDIO_STREAM_CONFIG_CAPS;
  1730.  
  1731.     // - only allowed when pin is not streaming, else the call will FAIL
  1732.     // - If your output pin is not yet connected, and you can
  1733.     //   connect your output pin with this media type, you should
  1734.     //   succeed the call, and start offering it first (enumerate as format#0)
  1735.     //   from GetMediaType so that this format will be used to connect with
  1736.     //   when you do connect to somebody
  1737.     // - if your output pin is already connected, and you can provide this
  1738.     //   type, reconnect your pin.  If the other pin can't accept it, FAIL
  1739.     //   this call and leave your connection alone.
  1740.     HRESULT SetFormat(
  1741.             [in] AM_MEDIA_TYPE *pmt);
  1742.  
  1743.     // the format it's connected with, or will connect with
  1744.     // the application is responsible for calling DeleteMediaType(*ppmt);
  1745.     HRESULT GetFormat(
  1746.             [out] AM_MEDIA_TYPE **ppmt);
  1747.  
  1748.     // how many different Stream Caps structures are there?
  1749.     // also, how big is the stream caps structure?
  1750.     HRESULT GetNumberOfCapabilities(
  1751.             [out] int *piCount,
  1752.         [out] int *piSize);    // pSCC of GetStreamCaps needs to be this big
  1753.  
  1754.     // - gets one of the pairs of {Mediatype, Caps}
  1755.     // - return S_FALSE if iIndex is too high
  1756.     // - the application is responsible for calling DeleteMediaType(*ppmt);
  1757.     // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video
  1758.     //   or MEDIATYPE_Audio, so you can tell if you have a pointer to a
  1759.     //   VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure
  1760.     //   There could potentially be many more possibilities other than video
  1761.     //   or audio.
  1762.     HRESULT GetStreamCaps(
  1763.         [in]  int iIndex,    // 0 to #caps-1
  1764.         [out] AM_MEDIA_TYPE **ppmt,
  1765.             [out] BYTE *pSCC);
  1766.  
  1767. }
  1768.  
  1769.  
  1770.  
  1771. // Interface to control interleaving of different streams in one file
  1772. [
  1773. object,
  1774. uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86),
  1775. pointer_default(unique)
  1776. ]
  1777. interface IConfigInterleaving : IUnknown
  1778. {
  1779.     import "unknwn.idl";
  1780.  
  1781.     typedef enum
  1782.     {
  1783.         // uninterleaved - samples written out in the order they
  1784.         // arrive
  1785.         INTERLEAVE_NONE,
  1786.  
  1787.             // approximate interleaving with less overhead for video
  1788.             // capture
  1789.         INTERLEAVE_CAPTURE,
  1790.  
  1791.         // full, precise interleaving. slower.
  1792.         INTERLEAVE_FULL
  1793.  
  1794.     } InterleavingMode;
  1795.  
  1796.     HRESULT put_Mode(
  1797.         [in] InterleavingMode mode
  1798.         );
  1799.  
  1800.     HRESULT get_Mode(
  1801.         [out] InterleavingMode *pMode
  1802.         );
  1803.  
  1804.     HRESULT put_Interleaving(
  1805.         [in] const REFERENCE_TIME *prtInterleave,
  1806.         [in] const REFERENCE_TIME *prtPreroll
  1807.         );
  1808.  
  1809.     HRESULT get_Interleaving(
  1810.         [out] REFERENCE_TIME *prtInterleave,
  1811.         [out] REFERENCE_TIME *prtPreroll
  1812.         );
  1813. }
  1814.  
  1815. // Interface to control the AVI mux
  1816. [
  1817. object,
  1818. uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6),
  1819. pointer_default(unique)
  1820. ]
  1821. interface IConfigAviMux : IUnknown
  1822. {
  1823.     import "unknwn.idl";
  1824.  
  1825.     // control whether the AVI mux adjusts the frame rate or audio
  1826.     // sampling rate for drift when the file is closed. -1 to disables
  1827.     // this behavior.
  1828.     HRESULT SetMasterStream([in] LONG iStream);
  1829.     HRESULT GetMasterStream([out] LONG *pStream);
  1830.  
  1831.     // control whether the AVI mux writes out an idx1 index chunk for
  1832.     // compatibility with older AVI players.
  1833.     HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex);
  1834.     HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex);
  1835. }
  1836.  
  1837.     //---------------------------------------------------------------------
  1838.     //  CompressionCaps enum
  1839.     //---------------------------------------------------------------------
  1840.  
  1841.     // This tells you which features of IAMVideoCompression are supported
  1842.  
  1843.     // CanCrunch means that it can compress video to a specified data rate
  1844.     // If so, then the output pin's media type will contain that data rate
  1845.     // in the format's AvgBytesPerSecond field, and that should be used.
  1846.  
  1847.     typedef enum
  1848.     {
  1849.         CompressionCaps_CanQuality =  0x01,
  1850.         CompressionCaps_CanCrunch =   0x02,
  1851.         CompressionCaps_CanKeyFrame = 0x04,
  1852.         CompressionCaps_CanBFrame =   0x08,
  1853.         CompressionCaps_CanWindow =   0x10
  1854.     } CompressionCaps;
  1855.  
  1856.  
  1857.  
  1858.     //---------------------------------------------------------------------
  1859.     // IAMVideoCompression interface
  1860.     //
  1861.     // Control compression parameters - pin interface
  1862.     //---------------------------------------------------------------------
  1863.  
  1864.     // This interface is implemented by the output pin of a video capture
  1865.     // filter or video compressor that provides video data
  1866.  
  1867.     // You use this interface to control how video is compressed... how
  1868.     // many keyframes, etc., and to find information like capabilities and
  1869.     // the description of this compressor
  1870.  
  1871.     [
  1872.     object,
  1873.         uuid(C6E13343-30AC-11d0-A18C-00A0C9118956),
  1874.         pointer_default(unique)
  1875.     ]
  1876.     interface IAMVideoCompression : IUnknown
  1877.     {
  1878.     // - Only valid if GetInfo's pCapabilities sets
  1879.     //   CompressionCaps_CanKeyFrame
  1880.         // - KeyFrameRate < 0 means use the compressor default
  1881.     // - KeyFrames == 0 means only the first frame is a key
  1882.         HRESULT put_KeyFrameRate (
  1883.                     [in] long KeyFrameRate);
  1884.  
  1885.         HRESULT get_KeyFrameRate (
  1886.                     [out] long * pKeyFrameRate);
  1887.  
  1888.     // - Only valid if GetInfo's pCapabilities sets
  1889.     //   CompressionCaps_CanBFrame
  1890.     // - If keyframes are every 10, and there are 3 P Frames per key,
  1891.     //   they will be spaced evenly between the key frames and the other
  1892.     //   6 frames will be B frames
  1893.     // - PFramesPerKeyFrame < 0 means use the compressor default
  1894.         HRESULT put_PFramesPerKeyFrame (
  1895.                     [in] long PFramesPerKeyFrame);
  1896.  
  1897.         HRESULT get_PFramesPerKeyFrame (
  1898.                     [out] long * pPFramesPerKeyFrame);
  1899.  
  1900.     // - Only valid if GetInfo's pCapabilities sets
  1901.     //   CompressionCaps_CanQuality
  1902.     // - Controls image quality
  1903.     // - If you are compressing to a fixed data rate, a high quality
  1904.     //   means try and use all of the data rate, and a low quality means
  1905.     //   feel free to use much lower than the data rate if you want to.
  1906.         // - Quality < 0 means use the compressor default
  1907.         HRESULT put_Quality (
  1908.                     [in] double Quality);
  1909.  
  1910.         HRESULT get_Quality (
  1911.                     [out] double * pQuality);
  1912.  
  1913.     // If you have set a data rate of 100K/sec on a 10fps movie, that
  1914.     // will normally mean each frame must be <=10K.  But a window size
  1915.     // means every consecutive n frames must average to the data rate,
  1916.     // but an individual frame (if n > 1) is allowed to exceed the
  1917.     // frame size suggested by the data rate
  1918.         HRESULT put_WindowSize (
  1919.                     [in] DWORDLONG WindowSize);
  1920.  
  1921.         HRESULT get_WindowSize (
  1922.                     [out] DWORDLONG * pWindowSize);
  1923.  
  1924.     // - pszVersion might be "Version 2.1.0"
  1925.     // - pszDescription might be "Danny's awesome video compressor"
  1926.     // - pcbVersion and pcbDescription will be filled in with the
  1927.     //   required length if they are too short
  1928.     // - *pCapabilities is a logical OR of some CompressionCaps flags
  1929.         HRESULT GetInfo(
  1930.                     [out, size_is(*pcbVersion)] WCHAR * pszVersion,
  1931.                     [in,out] int *pcbVersion,
  1932.                     [out, size_is(*pcbDescription)] LPWSTR pszDescription,
  1933.                     [in,out] int *pcbDescription,
  1934.             [out] long *pDefaultKeyFrameRate,
  1935.             [out] long *pDefaultPFramesPerKey,
  1936.             [out] double *pDefaultQuality,
  1937.                     [out] long *pCapabilities  //CompressionCaps
  1938.         );
  1939.  
  1940.     // - this means when this frame number comes along after the graph
  1941.     //   is running, make it a keyframe even if you weren't going to
  1942.         HRESULT OverrideKeyFrame(
  1943.                     [in]  long FrameNumber
  1944.         );
  1945.  
  1946.     // - Only valid if GetInfo's pCapabilities sets
  1947.     //   CompressionCaps_CanCrunch
  1948.     // - this means when this frame number comes along after the graph
  1949.     //   is running, make it this many bytes big instead of whatever size
  1950.     //   you were going to make it.
  1951.         HRESULT OverrideFrameSize(
  1952.                     [in]  long FrameNumber,
  1953.                     [in]  long Size
  1954.         );
  1955.  
  1956.     }
  1957.  
  1958.     //---------------------------------------------------------------------
  1959.     //  VfwCaptureDialogs enum
  1960.     //---------------------------------------------------------------------
  1961.  
  1962.     typedef enum
  1963.     {
  1964.          VfwCaptureDialog_Source = 0x01,
  1965.      VfwCaptureDialog_Format = 0x02,
  1966.      VfwCaptureDialog_Display = 0x04
  1967.     } VfwCaptureDialogs;
  1968.  
  1969.  
  1970.     //---------------------------------------------------------------------
  1971.     //  VfwCompressDialogs enum
  1972.     //---------------------------------------------------------------------
  1973.  
  1974.     typedef enum
  1975.     {
  1976.          VfwCompressDialog_Config = 0x01,
  1977.      VfwCompressDialog_About =  0x02
  1978.     } VfwCompressDialogs;
  1979.  
  1980.  
  1981.     //---------------------------------------------------------------------
  1982.     // IAMVfwCaptureDialogs - filter interface
  1983.     //
  1984.     // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY
  1985.     //---------------------------------------------------------------------
  1986.  
  1987.     // This interface is supported only by Microsoft's Video For Windows
  1988.     // capture driver Capture Filter.  It allows an application to bring up
  1989.     // one of the 3 driver dialogs that VfW capture drivers have.
  1990.  
  1991.     [
  1992.     object,
  1993.     local,
  1994.         uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5),
  1995.         pointer_default(unique)
  1996.     ]
  1997.     interface IAMVfwCaptureDialogs : IUnknown
  1998.     {
  1999.         HRESULT HasDialog(
  2000.                     [in]  int iDialog    // VfwCaptureDialogs enum
  2001.         );
  2002.  
  2003.         HRESULT ShowDialog(
  2004.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2005.             [in]  HWND hwnd
  2006.         );
  2007.  
  2008.         HRESULT SendDriverMessage(
  2009.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2010.                     [in]  int uMsg,
  2011.                     [in]  long dw1,
  2012.                     [in]  long dw2
  2013.         );
  2014.  
  2015.         // - iDialog can be one of the VfwCaptureDialogs enums
  2016.         // - HasDialog returns S_OK if it has the dialog, else S_FALSE
  2017.      // - ShowDialog can only be called when not streaming or when another
  2018.     //   dialog is not already up
  2019.     // - SendDriverMessage can send a secret message to the capture driver.
  2020.     //   USE IT AT YOUR OWN RISK!
  2021.     }
  2022.  
  2023.     //---------------------------------------------------------------------
  2024.     // IAMVfwCompressDialogs - filter interface
  2025.     //
  2026.     // Show a VfW codec driver dialog - CONFIG or ABOUT
  2027.     //---------------------------------------------------------------------
  2028.  
  2029.     // This interface is supported only by Microsoft's ICM Compressor filter
  2030.     // (Co).  It allows an application to bring up either the Configure or
  2031.     // About dialogs for the ICM codec that it is currently using.
  2032.  
  2033.     [
  2034.     object,
  2035.     local,
  2036.         uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5),
  2037.         pointer_default(unique)
  2038.     ]
  2039.     interface IAMVfwCompressDialogs : IUnknown
  2040.     {
  2041.  
  2042.         // Bring up a dialog for this codec
  2043.         HRESULT ShowDialog(
  2044.                     [in]  int iDialog,   // VfwCompressDialogs enum
  2045.             [in]  HWND hwnd
  2046.         );
  2047.  
  2048.         // Calls ICGetState and gives you the result
  2049.         HRESULT GetState(
  2050.                     [out, size_is(*pcbState)] LPVOID pState,
  2051.             [in, out]  int *pcbState
  2052.         );
  2053.  
  2054.         // Calls ICSetState
  2055.         HRESULT SetState(
  2056.                     [in, size_is(cbState)] LPVOID pState,
  2057.             [in]  int cbState
  2058.         );
  2059.  
  2060.         // Send a codec specific message
  2061.         HRESULT SendDriverMessage(
  2062.                     [in]  int uMsg,
  2063.                     [in]  long dw1,
  2064.                     [in]  long dw2
  2065.         );
  2066.  
  2067.         // - iDialog can be one of the VfwCaptureDialogs enums
  2068.      // - ShowDialog can only be called when not streaming or when no other
  2069.     //   dialog is up already
  2070.      // - an application can call GetState after ShowDialog(CONFIG) to
  2071.     //   see how the compressor was configured and next time the graph
  2072.        //   is used, it can call SetState with the data it saved to return
  2073.     //   the codec to the state configured by the dialog box from last time
  2074.     // - GetState with a NULL pointer returns the size needed
  2075.     // - SendDriverMessage can send a secret message to the codec.
  2076.     //   USE IT AT YOUR OWN RISK!
  2077.     }
  2078.  
  2079.  
  2080.     //---------------------------------------------------------------------
  2081.     // IAMDroppedFrames interface
  2082.     //
  2083.     // Report status of capture - pin interface
  2084.     //---------------------------------------------------------------------
  2085.  
  2086.     // A capture filter's video output pin supports this.  It reports
  2087.     // how many frames were not sent (dropped), etc.
  2088.  
  2089.     // Every time your filter goes from STOPPED-->PAUSED, you reset all your
  2090.     // counts to zero.
  2091.  
  2092.     // An app may call this all the time while you are capturing to see how
  2093.     // capturing is going.  MAKE SURE you always return as current information
  2094.     // as possible while you are running.
  2095.  
  2096.     // When your capture filter starts running, it starts by sending frame 0,
  2097.     // then 1, 2, 3, etc.  The time stamp of each frame sent should correspond
  2098.     // to the graph clock's time when the image was digitized.  The end time
  2099.     // is the start time plus the duration of the video frame.
  2100.     // You should also set the MediaTime of each sample (SetMediaTime) as well.
  2101.     // This should be the frame number ie (0,1) (1,2) (2,3).
  2102.     // If a frame is dropped, a downstream filter will be able to tell easily
  2103.     // not by looking for gaps in the regular time stamps, but by noticing a
  2104.     // frame number is missing (eg.  (1,2) (2,3) (4,5) (5,6) means frame 3
  2105.     // was dropped.
  2106.  
  2107.     // Using the info provided by this interface, an application can figure out
  2108.     // the number of frames dropped, the frame rate achieved (the length of
  2109.     // time the graph was running divided by the number of frames not dropped),
  2110.     // and the data rate acheived (the length of time the graph was running
  2111.     // divided by the average frame size).
  2112.  
  2113.     // If your filter is running, then paused, and then run again, you need
  2114.     // to continue to deliver frames as if it was never paused.  The first
  2115.     // frame after the second RUN cannot be time stamped earlier than the last
  2116.     // frame sent before the pause.
  2117.  
  2118.     // Your filter must always increment the MediaTime of each sample sent.
  2119.     // Never send the same frame # twice, and never go back in time.  The
  2120.     // regular time stamp of a sample can also never go back in time.
  2121.  
  2122.     [
  2123.     object,
  2124.         uuid(C6E13344-30AC-11d0-A18C-00A0C9118956),
  2125.         pointer_default(unique)
  2126.     ]
  2127.     interface IAMDroppedFrames : IUnknown
  2128.     {
  2129.         // Get the number of dropped frames
  2130.         HRESULT GetNumDropped(
  2131.                     [out]  long * plDropped
  2132.  
  2133.         );
  2134.  
  2135.         //Get the number of non-dropped frames
  2136.         HRESULT GetNumNotDropped(
  2137.                     [out]  long * plNotDropped
  2138.  
  2139.         );
  2140.  
  2141.     // - plArray points to an array of lSize longs.  The filter will
  2142.     //   fill it with the frame number of the first lSize frames dropped.
  2143.     //   A filter may not have bothered to remember as many as you asked
  2144.     //   for, so it will set *plNumCopied to the number of frames it filled
  2145.     //   in.
  2146.         HRESULT GetDroppedInfo(
  2147.                     [in]   long lSize,
  2148.                     [out]  long * plArray,
  2149.                     [out]  long *  plNumCopied
  2150.         );
  2151.  
  2152.     // - This is the average size of the frames it didn't drop (in bytes)
  2153.         HRESULT GetAverageFrameSize(
  2154.                     [out]  long * plAverageSize
  2155.  
  2156.         );
  2157.  
  2158.     }
  2159.  
  2160.  
  2161.  
  2162.     cpp_quote("#define AMF_AUTOMATICGAIN -1.0")
  2163.  
  2164.     //---------------------------------------------------------------------
  2165.     // IAMAudioInputMixer interface
  2166.     //
  2167.     // Sets the recording levels, pan and EQ for the audio card inputs
  2168.     //---------------------------------------------------------------------
  2169.  
  2170.     // This interface is implemented by each input pin of an audio capture
  2171.     // filter, to tell it what level, panning, and EQ to use for each input.
  2172.     // The name of each pin will reflect the type of input, eg. "Line input 1"
  2173.     // or "Mic".  An application uses the pin names to decide how it wants to
  2174.     // set the recording levels
  2175.  
  2176.     // This interface can also be supported by the audio capture filter itself
  2177.     // to control to overall record level and panning after the mix
  2178.  
  2179.     [
  2180.     object,
  2181.         uuid(54C39221-8380-11d0-B3F0-00AA003761C5),
  2182.         pointer_default(unique)
  2183.     ]
  2184.     interface IAMAudioInputMixer : IUnknown
  2185.     {
  2186.     // This interface is only supported by the input pins, not the filter
  2187.      // If disabled, this channel will not be mixed in as part of the
  2188.     // recorded signal.
  2189.         HRESULT put_Enable (
  2190.             [in] BOOL fEnable);    // TRUE=enable FALSE=disable
  2191.  
  2192.     //Is this channel enabled?
  2193.         HRESULT get_Enable (
  2194.             [out] BOOL *pfEnable);
  2195.  
  2196.     // When set to mono mode, making a stereo recording of this channel
  2197.      // will have both channels contain the same data... a mixture of the
  2198.     // left and right signals
  2199.         HRESULT put_Mono (
  2200.             [in] BOOL fMono);    // TRUE=mono FALSE=multi channel
  2201.  
  2202.         //all channels combined into a mono signal?
  2203.         HRESULT get_Mono (
  2204.             [out] BOOL *pfMono);
  2205.  
  2206.      // !!! WILL CARDS BE ABLE TO BOOST THE GAIN?
  2207.         //Set the record level for this channel
  2208.         HRESULT put_MixLevel (
  2209.                     [in] double Level);    // 0 = off, 1 = full (unity?) volume
  2210.                     // AMF_AUTOMATICGAIN, if supported,
  2211.                     // means automatic
  2212.  
  2213.         //Get the record level for this channel
  2214.         HRESULT get_MixLevel (
  2215.                     [out] double *pLevel);
  2216.  
  2217.     // For instance, when panned full left, and you make a stereo recording
  2218.     // of this channel, you will record a silent right channel.
  2219.         HRESULT put_Pan (
  2220.                     [in] double Pan);    // -1 = full left, 0 = centre, 1 = right
  2221.  
  2222.         //Get the pan for this channel
  2223.         HRESULT get_Pan (
  2224.                     [out] double *pPan);
  2225.  
  2226.     // Boosts the bass of low volume signals before they are recorded
  2227.     // to compensate for the fact that your ear has trouble hearing quiet
  2228.     // bass sounds
  2229.         HRESULT put_Loudness (
  2230.             [in] BOOL fLoudness);// TRUE=on FALSE=off
  2231.  
  2232.         HRESULT get_Loudness (
  2233.             [out] BOOL *pfLoudness);
  2234.  
  2235.     // boosts or cuts the treble of the signal before it's recorded by
  2236.     // a certain amount of dB
  2237.         HRESULT put_Treble (
  2238.                     [in] double Treble); // gain in dB (-ve = attenuate)
  2239.  
  2240.         //Get the treble EQ for this channel
  2241.         HRESULT get_Treble (
  2242.                     [out] double *pTreble);
  2243.  
  2244.     // This is the maximum value allowed in put_Treble.  ie 6.0 means
  2245.     // any value between -6.0 and 6.0 is allowed
  2246.         HRESULT get_TrebleRange (
  2247.                     [out] double *pRange); // largest value allowed
  2248.  
  2249.     // boosts or cuts the bass of the signal before it's recorded by
  2250.     // a certain amount of dB
  2251.         HRESULT put_Bass (
  2252.                     [in] double Bass); // gain in dB (-ve = attenuate)
  2253.  
  2254.         // Get the bass EQ for this channel
  2255.         HRESULT get_Bass (
  2256.                     [out] double *pBass);
  2257.  
  2258.     // This is the maximum value allowed in put_Bass.  ie 6.0 means
  2259.     // any value between -6.0 and 6.0 is allowed
  2260.         HRESULT get_BassRange (
  2261.                     [out] double *pRange); // largest value allowed
  2262.  
  2263.     }
  2264.  
  2265.  
  2266.     //---------------------------------------------------------------------
  2267.     // IAMBufferNegotiation interface
  2268.     //
  2269.     // Tells a pin what kinds of buffers to use when connected
  2270.     //---------------------------------------------------------------------
  2271.  
  2272.     // This interface can be implemented by any pin that will connect to
  2273.     // another pin using IMemInputPin.  All capture filters should support
  2274.     // this interface.
  2275.  
  2276.     // SuggestAllocatorProperties is a way for an application to get
  2277.     // in on the buffer negotiation process for a pin.  This pin will use
  2278.     // the numbers given to it by the application as its request to the
  2279.     // allocator.  An application can use a negative number for any element
  2280.     // in the ALLOCATOR_PROPERTIES to mean "don't care".  An application must
  2281.     // call this function before the pin is connected, or it will be too late
  2282.     // To ensure that an application gets what it wants, it would be wise to
  2283.     // call this method on both pins being connected together, so the other
  2284.     // pin doesn't overrule the application's request.
  2285.  
  2286.     // GetAllocatorProperties can only be called after a pin is connected and
  2287.     // it returns the properties of the current allocator being used
  2288.  
  2289.     [
  2290.     object,
  2291.         uuid(56ED71A0-AF5F-11D0-B3F0-00AA003761C5),
  2292.         pointer_default(unique)
  2293.     ]
  2294.     interface IAMBufferNegotiation : IUnknown
  2295.     {
  2296.         HRESULT SuggestAllocatorProperties (
  2297.             [in] const ALLOCATOR_PROPERTIES *pprop);
  2298.  
  2299.         HRESULT GetAllocatorProperties (
  2300.             [out] ALLOCATOR_PROPERTIES *pprop);
  2301.  
  2302.     }
  2303.  
  2304.  
  2305.     //---------------------------------------------------------------------
  2306.     // AnalogVideoStandard enum
  2307.     //---------------------------------------------------------------------
  2308.  
  2309.     typedef enum tagAnalogVideoStandard
  2310.     {
  2311.         AnalogVideo_None     = 0x00000000,  // This is a digital sensor
  2312.         AnalogVideo_NTSC_M   = 0x00000001,  //        75 IRE Setup
  2313.         AnalogVideo_NTSC_M_J = 0x00000002,  // Japan,  0 IRE Setup
  2314.         AnalogVideo_NTSC_433 = 0x00000004,
  2315.  
  2316.         AnalogVideo_PAL_B    = 0x00000010,
  2317.         AnalogVideo_PAL_D    = 0x00000020,
  2318.         AnalogVideo_PAL_G    = 0x00000040,
  2319.         AnalogVideo_PAL_H    = 0x00000080,
  2320.         AnalogVideo_PAL_I    = 0x00000100,
  2321.         AnalogVideo_PAL_M    = 0x00000200,
  2322.         AnalogVideo_PAL_N    = 0x00000400,
  2323.  
  2324.         AnalogVideo_PAL_60   = 0x00000800,
  2325.  
  2326.         AnalogVideo_SECAM_B  = 0x00001000,
  2327.         AnalogVideo_SECAM_D  = 0x00002000,
  2328.         AnalogVideo_SECAM_G  = 0x00004000,
  2329.         AnalogVideo_SECAM_H  = 0x00008000,
  2330.         AnalogVideo_SECAM_K  = 0x00010000,
  2331.         AnalogVideo_SECAM_K1 = 0x00020000,
  2332.         AnalogVideo_SECAM_L  = 0x00040000,
  2333.         AnalogVideo_SECAM_L1 = 0x00080000
  2334.     } AnalogVideoStandard;
  2335.  
  2336.     cpp_quote("#define AnalogVideo_NTSC_Mask  0x00000007")
  2337.     cpp_quote("#define AnalogVideo_PAL_Mask   0x00000FF0")
  2338.     cpp_quote("#define AnalogVideo_SECAM_Mask 0x000FF000")
  2339.  
  2340.  
  2341.     //---------------------------------------------------------------------
  2342.     // TunerInputType enum
  2343.     //---------------------------------------------------------------------
  2344.  
  2345.     typedef enum tagTunerInputType
  2346.     {
  2347.         TunerInputCable,
  2348.         TunerInputAntenna
  2349.     } TunerInputType;
  2350.  
  2351.     //---------------------------------------------------------------------
  2352.     // VideoCopyProtectionType enum
  2353.     //---------------------------------------------------------------------
  2354.  
  2355.     typedef enum
  2356.     {
  2357.         VideoCopyProtectionMacrovisionBasic,
  2358.         VideoCopyProtectionMacrovisionCBI
  2359.     } VideoCopyProtectionType;
  2360.  
  2361.     //---------------------------------------------------------------------
  2362.     // PhysicalConnectorType enum
  2363.     //---------------------------------------------------------------------
  2364.  
  2365.     typedef enum tagPhysicalConnectorType
  2366.     {
  2367.         PhysConn_Video_Tuner = 1,
  2368.         PhysConn_Video_Composite,
  2369.         PhysConn_Video_SVideo,
  2370.         PhysConn_Video_RGB,
  2371.         PhysConn_Video_YRYBY,
  2372.         PhysConn_Video_SerialDigital,
  2373.         PhysConn_Video_ParallelDigital,
  2374.         PhysConn_Video_SCSI,
  2375.         PhysConn_Video_AUX,
  2376.         PhysConn_Video_1394,
  2377.         PhysConn_Video_USB,
  2378.         PhysConn_Video_VideoDecoder,
  2379.         PhysConn_Video_VideoEncoder,
  2380.         PhysConn_Video_SCART,
  2381.         PhysConn_Video_Black,            
  2382.  
  2383.  
  2384.         PhysConn_Audio_Tuner = 0x1000,
  2385.         PhysConn_Audio_Line,
  2386.         PhysConn_Audio_Mic,
  2387.         PhysConn_Audio_AESDigital,
  2388.         PhysConn_Audio_SPDIFDigital,
  2389.         PhysConn_Audio_SCSI,
  2390.         PhysConn_Audio_AUX,
  2391.         PhysConn_Audio_1394,
  2392.         PhysConn_Audio_USB,
  2393.         PhysConn_Audio_AudioDecoder,
  2394.     } PhysicalConnectorType;
  2395.  
  2396.  
  2397.  
  2398.  
  2399.     //---------------------------------------------------------------------
  2400.     // IAMAnalogVideoDecoder interface
  2401.     //---------------------------------------------------------------------
  2402.  
  2403.     [
  2404.     object,
  2405.         uuid(C6E13350-30AC-11d0-A18C-00A0C9118956),
  2406.     pointer_default(unique)
  2407.     ]
  2408.     interface IAMAnalogVideoDecoder : IUnknown
  2409.     {
  2410.  
  2411.          //Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1...
  2412.         HRESULT get_AvailableTVFormats(
  2413.                     [out] long *lAnalogVideoStandard
  2414.                     );
  2415.  
  2416.         //Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2417.         HRESULT put_TVFormat(
  2418.                     [in] long lAnalogVideoStandard
  2419.                     );
  2420.  
  2421.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2422.         HRESULT get_TVFormat(
  2423.                     [out] long * plAnalogVideoStandard
  2424.                     );
  2425.  
  2426.         // True if horizontal sync is locked
  2427.         HRESULT get_HorizontalLocked (
  2428.                     [out] long * plLocked);
  2429.  
  2430.         // True if connected to a VCR (changes PLL timing)
  2431.         HRESULT put_VCRHorizontalLocking (
  2432.                     [in] long lVCRHorizontalLocking);
  2433.  
  2434.         HRESULT get_VCRHorizontalLocking (
  2435.                     [out] long * plVCRHorizontalLocking);
  2436.  
  2437.         // Returns the number of lines in the video signal")]
  2438.         HRESULT get_NumberOfLines (
  2439.                     [out] long *plNumberOfLines);
  2440.  
  2441.         // Enables or disables the output bus
  2442.         HRESULT put_OutputEnable (
  2443.                     [in] long lOutputEnable);
  2444.  
  2445.         HRESULT get_OutputEnable (
  2446.                     [out] long *plOutputEnable);
  2447.  
  2448.     }
  2449.  
  2450.  
  2451.     //---------------------------------------------------------------------
  2452.     // VideoProcAmp Property enum
  2453.     //---------------------------------------------------------------------
  2454.  
  2455.     typedef enum tagVideoProcAmpProperty
  2456.     {
  2457.         VideoProcAmp_Brightness,
  2458.         VideoProcAmp_Contrast,
  2459.         VideoProcAmp_Hue,
  2460.         VideoProcAmp_Saturation,
  2461.         VideoProcAmp_Sharpness,
  2462.         VideoProcAmp_Gamma,
  2463.         VideoProcAmp_ColorEnable,
  2464.         VideoProcAmp_WhiteBalance,
  2465.         VideoProcAmp_BacklightCompensation
  2466.     } VideoProcAmpProperty;
  2467.  
  2468.     //---------------------------------------------------------------------
  2469.     // VideoProcAmp Flags enum
  2470.     //---------------------------------------------------------------------
  2471.  
  2472.     typedef enum tagVideoProcAmpFlags
  2473.     {
  2474.         VideoProcAmp_Flags_Manual = 0x0000,
  2475.         VideoProcAmp_Flags_Auto   = 0x0001,
  2476.     } VideoProcAmpFlags;
  2477.  
  2478.     //---------------------------------------------------------------------
  2479.     // IAMVideoProcAmp interface
  2480.     //
  2481.     // Adjusts video quality in either the analog or digital domain.
  2482.     //
  2483.     //---------------------------------------------------------------------
  2484.  
  2485.     [
  2486.     object,
  2487.         uuid(C6E13360-30AC-11d0-A18C-00A0C9118956),
  2488.     pointer_default(unique)
  2489.     ]
  2490.     interface IAMVideoProcAmp : IUnknown
  2491.     {
  2492.         // Returns min, max, step size, and default values
  2493.         HRESULT GetRange(
  2494.             [in] long Property,         // Which property to query
  2495.             [out] long * pMin,          // Range minimum
  2496.             [out] long * pMax,          // Range maxumum
  2497.             [out] long * pSteppingDelta,// Step size
  2498.             [out] long * pDefault,      // Default value
  2499.             [out] long * pCapsFlags     // VideoProcAmpFlags
  2500.  
  2501.         );
  2502.  
  2503.         // Set a VideoProcAmp property
  2504.         HRESULT Set(
  2505.             [in]  long Property,        // VideoProcAmpProperty
  2506.             [in]  long lValue,          // Value to set
  2507.             [in]  long Flags            // VideoProcAmp_Flags_*
  2508.  
  2509.         );
  2510.  
  2511.         // Get a VideoProcAmp property
  2512.         HRESULT Get(
  2513.             [in]  long Property,        // VideoProcAmpProperty
  2514.             [out] long * lValue,        // Current value
  2515.             [out] long * Flags          // VideoProcAmp_Flags_*
  2516.         );
  2517.     }
  2518.  
  2519.  
  2520.     //---------------------------------------------------------------------
  2521.     // CameraControl Property enum
  2522.     //---------------------------------------------------------------------
  2523.  
  2524.     typedef enum tagCameraControlProperty
  2525.     {
  2526.         CameraControl_Pan,
  2527.         CameraControl_Tilt,
  2528.         CameraControl_Roll,
  2529.         CameraControl_Zoom,
  2530.         CameraControl_Exposure,
  2531.         CameraControl_Iris,
  2532.         CameraControl_Focus
  2533.     } CameraControlProperty;
  2534.  
  2535.     //---------------------------------------------------------------------
  2536.     // CameraControl Flags enum
  2537.     //---------------------------------------------------------------------
  2538.  
  2539.     typedef enum tagCameraControlFlags
  2540.     {
  2541.         CameraControl_Flags_Manual   = 0x0000,
  2542.         CameraControl_Flags_Auto     = 0x0001
  2543.     } CameraControlFlags;
  2544.  
  2545.     //---------------------------------------------------------------------
  2546.     // IAMCameraControl interface
  2547.     //
  2548.     // Control of local or remote cameras
  2549.     //---------------------------------------------------------------------
  2550.  
  2551.     [
  2552.     object,
  2553.         uuid(C6E13370-30AC-11d0-A18C-00A0C9118956),
  2554.     pointer_default(unique)
  2555.     ]
  2556.     interface IAMCameraControl : IUnknown
  2557.     {
  2558.         // Returns min, max, step size, and default values
  2559.         HRESULT GetRange(
  2560.             [in] long Property,         // Which property to query
  2561.             [out] long * pMin,          // Range minimum
  2562.             [out] long * pMax,          // Range maxumum
  2563.             [out] long * pSteppingDelta,// Step size
  2564.             [out] long * pDefault,      // Default value
  2565.             [out] long * pCapsFlags     // CamaeraControlFlags
  2566.  
  2567.         );
  2568.  
  2569.         // Set a CameraControl property
  2570.         HRESULT Set(
  2571.             [in]  long Property,        // CameraControlProperty
  2572.             [in]  long lValue,          // Value to set
  2573.             [in]  long Flags            // CameraControl_Flags_*
  2574.  
  2575.         );
  2576.  
  2577.         // Get a CameraControl property
  2578.         HRESULT Get(
  2579.             [in]  long Property,        // CameraControlProperty
  2580.             [out] long * lValue,        // Current value
  2581.             [out] long * Flags          // CameraControl_Flags_*
  2582.         );
  2583.     }
  2584.  
  2585.  
  2586.     //---------------------------------------------------------------------
  2587.     // IAMCrossbar interface
  2588.     //
  2589.     // Controls a routing matrix for analog or digital video or audio
  2590.     //---------------------------------------------------------------------
  2591.  
  2592.     [
  2593.     object,
  2594.         uuid(C6E13380-30AC-11d0-A18C-00A0C9118956),
  2595.     pointer_default(unique)
  2596.     ]
  2597.     interface IAMCrossbar : IUnknown
  2598.     {
  2599.  
  2600.         // How many pins are there?
  2601.         HRESULT get_PinCounts(
  2602.                 [out] long * OutputPinCount,        // count of output pins
  2603.                 [out] long * InputPinCount);        // count of input pins
  2604.  
  2605.         // True if routing is possible
  2606.         HRESULT CanRoute (
  2607.                 [in]  long OutputPinIndex,          // the output pin
  2608.                 [in]  long InputPinIndex);          // the input pin
  2609.  
  2610.         // Routes an input pin to an output pin
  2611.         HRESULT Route (
  2612.                 [in]  long OutputPinIndex,          // the output pin
  2613.                 [in]  long InputPinIndex);          // the input pin
  2614.  
  2615.         // Returns the input pin connected to a given output pin
  2616.         HRESULT get_IsRoutedTo (
  2617.                 [in]  long OutputPinIndex,          // the output pin
  2618.                 [out] long * InputPinIndex);        // the connected input pin
  2619.  
  2620.         // Returns a pin which is related to a given pin
  2621.         // (ie. this audio pin is related to a video pin)
  2622.         HRESULT get_CrossbarPinInfo (
  2623.                 [in] BOOL IsInputPin,               // TRUE for input pins
  2624.                 [in] long PinIndex,                 // a pin
  2625.                 [out] long * PinIndexRelated,       // Index of related pin
  2626.                 [out] long * PhysicalType);         // Physical type of pin
  2627.  
  2628.     }
  2629.  
  2630.  
  2631.     //---------------------------------------------------------------------
  2632.     // IAMTuner interface
  2633.     //
  2634.     // base tuner device
  2635.     //---------------------------------------------------------------------
  2636.     
  2637.     // predefined subchannel values
  2638.     typedef enum tagAMTunerSubChannel 
  2639.     {
  2640.         AMTUNER_SUBCHAN_NO_TUNE     = -2,   // don't tune
  2641.         AMTUNER_SUBCHAN_DEFAULT     = -1    // use default sub chan
  2642.     } AMTunerSubChannel;
  2643.     
  2644.     // predefined signal strength values
  2645.     typedef enum tagAMTunerSignalStrength
  2646.     {
  2647.         AMTUNER_HASNOSIGNALSTRENGTH = -1,   // cannot indicate signal strength
  2648.         AMTUNER_NOSIGNAL            = 0,    // no signal available
  2649.         AMTUNER_SIGNALPRESENT       = 1     // signal present
  2650.     } AMTunerSignalStrength;
  2651.  
  2652.     // specifies the mode of operation of the tuner    
  2653.     typedef enum tagAMTunerModeType
  2654.     {
  2655.         AMTUNER_MODE_DEFAULT    = 0x0000,   // default tuner mode
  2656.         AMTUNER_MODE_TV         = 0x0001,   // tv
  2657.         AMTUNER_MODE_FM_RADIO   = 0x0002,   // fm radio
  2658.         AMTUNER_MODE_AM_RADIO   = 0x0004,   // am radio
  2659.         AMTUNER_MODE_DSS        = 0x0008,   // dss
  2660.     } AMTunerModeType;
  2661.     
  2662.     // Events reported by IAMTunerNotification
  2663.     typedef enum tagAMTunerEventType{
  2664.         AMTUNER_EVENT_CHANGED   = 0x0001,   // status changed
  2665.     } AMTunerEventType;
  2666.     
  2667.     interface IAMTunerNotification;
  2668.  
  2669.     [
  2670.         object,
  2671.         local,
  2672.         uuid(211A8761-03AC-11d1-8D13-00AA00BD8339),
  2673.         pointer_default(unique)
  2674.     ]
  2675.     interface IAMTuner : IUnknown
  2676.     {
  2677.         // Sets and gets the Channel
  2678.         HRESULT put_Channel(
  2679.             [in] long lChannel,
  2680.             [in] long lVideoSubChannel,
  2681.             [in] long lAudioSubChannel
  2682.             );
  2683.         HRESULT get_Channel(
  2684.             [out] long *plChannel,
  2685.             [out] long *plVideoSubChannel,
  2686.             [out] long *plAudioSubChannel
  2687.             );
  2688.     
  2689.         // Gets the minimum and maximum channel available
  2690.         HRESULT ChannelMinMax(
  2691.             [out] long *lChannelMin,
  2692.             [out] long *lChannelMax
  2693.             );
  2694.     
  2695.         // CountryCode is the same as the international
  2696.         // long distance telephone dialing prefix
  2697.         
  2698.         HRESULT put_CountryCode(
  2699.             [in] long lCountryCode
  2700.             );
  2701.         HRESULT get_CountryCode(
  2702.             [out] long *plCountryCode
  2703.             );
  2704.     
  2705.         HRESULT put_TuningSpace(
  2706.             [in] long lTuningSpace
  2707.             );
  2708.         HRESULT get_TuningSpace(
  2709.             [out] long *plTuningSpace
  2710.             );
  2711.     
  2712.         HRESULT Logon(
  2713.             [in] HANDLE hCurrentUser
  2714.             );
  2715.         HRESULT Logout();
  2716.     
  2717.         // Signal status for current channel
  2718.         // signal strength == TUNER_NOSIGNAL, or strength value
  2719.         HRESULT SignalPresent(
  2720.             [out] long * plSignalStrength    // AMTunerSignalStrength
  2721.             );
  2722.     
  2723.         // allow multifunction tuner to be switch between modes
  2724.         HRESULT put_Mode(
  2725.             [in] AMTunerModeType lMode        // AMTunerModeType
  2726.             );
  2727.         HRESULT get_Mode(
  2728.             [out] AMTunerModeType *plMode    // AMTunerModeType
  2729.             );
  2730.     
  2731.         // retrieve a bitmask of the possible modes
  2732.         HRESULT GetAvailableModes(
  2733.             [out] long *plModes                // AMTunerModeType
  2734.             );
  2735.     
  2736.         // allow IAMTuner clients to receive event notification
  2737.         HRESULT RegisterNotificationCallBack(
  2738.             [in] IAMTunerNotification *pNotify,
  2739.             [in] long lEvents       // bitmask from AMTunerEventType enumeration
  2740.             );
  2741.         HRESULT UnRegisterNotificationCallBack(
  2742.             IAMTunerNotification *pNotify
  2743.             );
  2744.     }
  2745.     
  2746.     //---------------------------------------------------------------------
  2747.     // IAMTunerNotification interface
  2748.     //
  2749.     // Provided to IAMTuner if notification callbacks are desired
  2750.     //---------------------------------------------------------------------
  2751.     
  2752.     [
  2753.         object,
  2754.         local,
  2755.         uuid(211A8760-03AC-11d1-8D13-00AA00BD8339),
  2756.         pointer_default(unique)
  2757.     ]
  2758.     interface IAMTunerNotification : IUnknown
  2759.     {
  2760.         HRESULT OnEvent([in] AMTunerEventType Event);
  2761.     }
  2762.     
  2763.     
  2764.     //---------------------------------------------------------------------
  2765.     // IAMTVTuner interface
  2766.     //
  2767.     // Controls an analog TV tuner device
  2768.     //---------------------------------------------------------------------
  2769.  
  2770.     [
  2771.         object,
  2772.         local,
  2773.         uuid(211A8766-03AC-11d1-8D13-00AA00BD8339),
  2774.         pointer_default(unique)
  2775.     ]
  2776.     interface IAMTVTuner : IAMTuner
  2777.     {
  2778.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...
  2779.         HRESULT get_AvailableTVFormats(
  2780.             [out] long *lAnalogVideoStandard
  2781.             );
  2782.     
  2783.         // Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  2784.         HRESULT get_TVFormat(
  2785.             [out] long * plAnalogVideoStandard
  2786.             );
  2787.     
  2788.         // Scans for a signal on a given channel
  2789.         // NOTE: this is equivalent to put_Channel(), SignalStrength()
  2790.         HRESULT AutoTune(
  2791.             [in] long lChannel,
  2792.             [out] long * plFoundSignal
  2793.             );
  2794.     
  2795.         // Saves the fine tuning information for all channels")]
  2796.         HRESULT StoreAutoTune();
  2797.     
  2798.         // The number of TV sources plugged into the tuner
  2799.         HRESULT get_NumInputConnections(
  2800.             [out] long * plNumInputConnections
  2801.             );
  2802.     
  2803.         // Sets or gets the tuner input type (Cable or Antenna)
  2804.         HRESULT put_InputType(
  2805.             [in] long lIndex,
  2806.             [in] TunerInputType InputType
  2807.             );
  2808.         HRESULT get_InputType(
  2809.             [in] long lIndex,
  2810.             [out] TunerInputType * pInputType
  2811.             );
  2812.     
  2813.         // Sets or gets the tuner input
  2814.         HRESULT put_ConnectInput(
  2815.             [in] long lIndex
  2816.             );
  2817.         HRESULT get_ConnectInput(
  2818.             [out] long *plIndex
  2819.             );
  2820.     
  2821.         // Gets the video and audio carrier frequencies
  2822.         HRESULT get_VideoFrequency(
  2823.             [out] long *lFreq
  2824.             );
  2825.         HRESULT get_AudioFrequency(
  2826.             [out] long *lFreq
  2827.             );
  2828.     }
  2829.  
  2830.     
  2831.     //---------------------------------------------------------------------
  2832.     // IBPCSatelliteTuner interface
  2833.     //
  2834.     // An interface supporting Satellite tuning-related functions
  2835.     //---------------------------------------------------------------------
  2836.     [
  2837.         object,
  2838.         local,
  2839.         uuid(211A8765-03AC-11d1-8D13-00AA00BD8339),
  2840.         pointer_default(unique)
  2841.     ]
  2842.     interface IBPCSatelliteTuner : IAMTuner
  2843.     {
  2844.         HRESULT get_DefaultSubChannelTypes(
  2845.             [out] long *plDefaultVideoType, // Provider-specific service type
  2846.             [out] long *plDefaultAudioType  // Provider-specific service type
  2847.             );
  2848.     
  2849.         HRESULT put_DefaultSubChannelTypes(
  2850.             [in] long lDefaultVideoType,    // Provider-specific service type
  2851.             [in] long lDefaultAudioType     // Provider-specific service type
  2852.             );
  2853.     
  2854.         HRESULT IsTapingPermitted();        // S_OK yes, S_FALSE no
  2855.     }
  2856.  
  2857.  
  2858.  
  2859.     //---------------------------------------------------------------------
  2860.     // IAMTVAudio interface
  2861.     //
  2862.     // TV Audio control
  2863.     //---------------------------------------------------------------------
  2864.     
  2865.     typedef enum tagTVAudioMode
  2866.     {
  2867.         AMTVAUDIO_MODE_MONO            = 0x0001,       // Mono                   
  2868.         AMTVAUDIO_MODE_STEREO       = 0x0002,       // Stereo
  2869.         AMTVAUDIO_MODE_LANG_A       = 0x0010,       // Primary language
  2870.         AMTVAUDIO_MODE_LANG_B       = 0x0020,       // 2nd avail language
  2871.         AMTVAUDIO_MODE_LANG_C       = 0x0040,       // 3rd avail language
  2872.     } TVAudioMode;
  2873.  
  2874.     // Events reported by IAMTVAudioNotification
  2875.     typedef enum tagAMTVAudioEventType
  2876.     {
  2877.         AMTVAUDIO_EVENT_CHANGED     = 0x0001,       // mode changed
  2878.     } AMTVAudioEventType;
  2879.  
  2880.     interface IAMTVAudioNotification;
  2881.  
  2882.     [
  2883.         object,
  2884.         local,
  2885.         uuid(83EC1C30-23D1-11d1-99E6-00A0C9560266),
  2886.         pointer_default(unique)
  2887.     ]
  2888.     interface IAMTVAudio : IUnknown
  2889.     {
  2890.         // retrieve a bitmask of the formats available in the hardware
  2891.         HRESULT GetHardwareSupportedTVAudioModes(
  2892.             [out] long *plModes                // TVAudioMode
  2893.             );
  2894.             
  2895.         // retrieve a bitmask of the possible modes
  2896.         HRESULT GetAvailableTVAudioModes(
  2897.             [out] long *plModes                // TVAudioMode
  2898.             );
  2899.             
  2900.         HRESULT get_TVAudioMode(
  2901.             [out] long *plMode              // TVAudioMode
  2902.             );
  2903.         HRESULT put_TVAudioMode(
  2904.             [in] long lMode                    // TVAudioMode
  2905.             );
  2906.  
  2907.         // allow IAMTVAudio clients to receive event notification
  2908.         HRESULT RegisterNotificationCallBack(
  2909.             [in] IAMTunerNotification *pNotify,
  2910.             [in] long lEvents       // bitmask from AMTVAudioEventType enumeration
  2911.             );
  2912.         HRESULT UnRegisterNotificationCallBack(
  2913.             IAMTunerNotification *pNotify
  2914.             );
  2915.     }
  2916.  
  2917.     //---------------------------------------------------------------------
  2918.     // IAMTVAudioNotification interface
  2919.     //
  2920.     // Provided to IAMTVAudio clients if notification callbacks are desired
  2921.     //---------------------------------------------------------------------
  2922.     
  2923.     [
  2924.         object,
  2925.         local,
  2926.         uuid(83EC1C33-23D1-11d1-99E6-00A0C9560266),
  2927.         pointer_default(unique)
  2928.     ]
  2929.     interface IAMTVAudioNotification : IUnknown
  2930.     {
  2931.         HRESULT OnEvent([in] AMTVAudioEventType Event);
  2932.     }
  2933.  
  2934.  
  2935.  
  2936.  
  2937.     //---------------------------------------------------------------------
  2938.     // IAMAnalogVideoEncoder interface
  2939.     //---------------------------------------------------------------------
  2940.  
  2941.     [
  2942.    object,
  2943.         uuid(C6E133B0-30AC-11d0-A18C-00A0C9118956),
  2944.     pointer_default(unique)
  2945.     ]
  2946.     interface IAMAnalogVideoEncoder : IUnknown
  2947.     {
  2948.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...)
  2949.         HRESULT get_AvailableTVFormats(
  2950.                     [out] long *lAnalogVideoStandard
  2951.                     );
  2952.  
  2953.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  2954.         HRESULT put_TVFormat(
  2955.                     [in] long lAnalogVideoStandard
  2956.                     );
  2957.  
  2958.         HRESULT get_TVFormat(
  2959.                     [out] long * plAnalogVideoStandard
  2960.                     );
  2961.  
  2962.         // Sets or gets the copy protection
  2963.         HRESULT put_CopyProtection (
  2964.                     [in]  long lVideoCopyProtection); // VideoCopyProtectionType
  2965.  
  2966.         HRESULT get_CopyProtection (
  2967.                     [out] long *lVideoCopyProtection); // VideoCopyProtectionType
  2968.  
  2969.  
  2970.         // Enables and disables close captioning
  2971.         HRESULT put_CCEnable (
  2972.                     [in] long lCCEnable);
  2973.  
  2974.         HRESULT get_CCEnable (
  2975.                     [out] long *lCCEnable);
  2976.  
  2977.     }
  2978.  
  2979.     // used by IKsPropertySet set AMPROPSETID_Pin
  2980.     typedef enum {
  2981.     AMPROPERTY_PIN_CATEGORY,
  2982.         AMPROPERTY_PIN_MEDIUM
  2983.     } AMPROPERTY_PIN;
  2984.  
  2985.     //---------------------------------------------------------------------
  2986.     // IKsPropertySet interface
  2987.     //
  2988.     // Sets or gets a property identified by a property set GUID and a
  2989.     // property ID.
  2990.     //
  2991.     // Return codes for all 3 methods:
  2992.     //    E_PROP_SET_UNSUPPORTED  the property set is not supported
  2993.     //    E_PROP_ID_UNSUPPORTED   the property ID is not supported
  2994.     //                                for the specified property set
  2995.     //---------------------------------------------------------------------
  2996.  
  2997. cpp_quote("#ifndef _IKsPropertySet_")
  2998. cpp_quote("#define _IKsPropertySet_")
  2999.  
  3000.     //---------------------------------------------------------------------
  3001.     // #defines for IKsPropertySet::QuerySupported return result in pTypeSupport
  3002.     //---------------------------------------------------------------------
  3003.  
  3004. cpp_quote("#define KSPROPERTY_SUPPORT_GET  1")
  3005. cpp_quote("#define KSPROPERTY_SUPPORT_SET  2")
  3006.  
  3007.  
  3008.     [
  3009.     object,
  3010.     local,
  3011.         uuid(31EFAC30-515C-11d0-A9AA-00AA0061BE93),
  3012.     pointer_default(unique)
  3013.     ]
  3014.     interface IKsPropertySet : IUnknown
  3015.     {
  3016.         HRESULT Set(
  3017.                     [in]    REFGUID     guidPropSet,
  3018.                     [in]    DWORD       dwPropID,
  3019.                     [out, size_is(cbInstanceData)] LPVOID pInstanceData,
  3020.                     [in]    DWORD        cbInstanceData,
  3021.                     [out, size_is(cbPropData)] LPVOID pPropData,
  3022.                     [in]    DWORD        cbPropData);
  3023.  
  3024.         // To get a property, the caller allocates a buffer which the called
  3025.         // function fills in.  To determine necessary buffer size, call Get with
  3026.         // pPropData=NULL and cbPropData=0.
  3027.         HRESULT Get(
  3028.                     [in]    REFGUID     guidPropSet,
  3029.                     [in]    DWORD       dwPropID,
  3030.                     [out, size_is(cbInstanceData)] LPVOID pInstanceData,
  3031.                     [in]    DWORD        cbInstanceData,
  3032.                     [out, size_is(cbPropData)] LPVOID pPropData,
  3033.                     [in]    DWORD        cbPropData,
  3034.                     [out]   DWORD *        pcbReturned);
  3035.  
  3036.         // QuerySupported must either return E_NOTIMPL or correctly indicate
  3037.         // if getting or setting the property set and property is supported.
  3038.         // S_OK indicates the property set and property ID combination is
  3039.         HRESULT QuerySupported(
  3040.                     [in]    REFGUID     guidPropSet,
  3041.                     [in]    DWORD       dwPropID,
  3042.                     [out]   DWORD       *pTypeSupport);
  3043.     }
  3044. cpp_quote("#endif // _IKsPropertySet_")
  3045.  
  3046. [
  3047. object,
  3048. uuid(6025A880-C0D5-11d0-BD4E-00A0C911CE86),
  3049. pointer_default(unique)
  3050. ]
  3051. interface IMediaPropertyBag : IPropertyBag
  3052. {
  3053.     import "ocidl.idl";
  3054.  
  3055.     typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG;
  3056.  
  3057.     // return the i'th element in the property bag
  3058.     [local]
  3059.     HRESULT EnumProperty(
  3060.         [in]  ULONG iProperty,
  3061.         [in, out] VARIANT * pvarPropertyName,
  3062.         [in, out] VARIANT * pvarPropertyValue
  3063.         );
  3064.  
  3065. }
  3066.  
  3067.  
  3068. [
  3069. object,
  3070. uuid(5738E040-B67F-11d0-BD4D-00A0C911CE86),
  3071. pointer_default(unique)
  3072. ]
  3073. interface IPersistMediaPropertyBag : IPersist
  3074. {
  3075.     import "ocidl.idl";
  3076.     import "unknwn.idl";
  3077.  
  3078.     HRESULT InitNew(
  3079.         void
  3080.         );
  3081.  
  3082.     HRESULT Load(
  3083.         [in] IMediaPropertyBag * pPropBag,
  3084.         [in] IErrorLog * pErrorLog
  3085.         );
  3086.  
  3087.     HRESULT Save(
  3088.         [in] IMediaPropertyBag * pPropBag,
  3089.         [in] BOOL fClearDirty,
  3090.         [in] BOOL fSaveAllProperties
  3091.         );
  3092.  
  3093.  
  3094.     typedef IPersistMediaPropertyBag * LPPERSISTMEDIAPROPERTYBAG;
  3095. }
  3096.  
  3097.  
  3098.    //---------------------------------------------------------------------
  3099.    //
  3100.    // Defines IAMPhysicalPinInfo Interface
  3101.    //
  3102.    // Returns an enum and string that describes an input pin's physical type.
  3103.    //
  3104.    // Implement if: you have physical input pins such as video or audio (like
  3105.    // on a video capture card or a VCR)
  3106.    //
  3107.    // Use if: you want to communicate to a user available physical input pins
  3108.    // and allow them to select the active one if there is more than one
  3109.    //---------------------------------------------------------------------
  3110.  
  3111.  
  3112. [
  3113.     object,
  3114.      uuid(F938C991-3029-11cf-8C44-00AA006B6814),
  3115.      pointer_default(unique)
  3116.  ]
  3117. interface IAMPhysicalPinInfo : IUnknown {
  3118.  
  3119.     // Returns VFW_E_NO_ACCEPTABLE_TYPES if not a physical pin
  3120.     HRESULT GetPhysicalType(
  3121.         [out] long *pType,            // the enum representing the Physical Type
  3122.         [out] LPOLESTR *ppszType        // a friendly name
  3123.     );
  3124. }
  3125. typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO;
  3126.  
  3127.    //---------------------------------------------------------------------
  3128.    // Defines IAMExtDevice Interface
  3129.    //
  3130.    // Base interface for external professional devices
  3131.    //
  3132.    // Implement if: the filter controls an external device such as a VCR,
  3133.    // timecode reader/generator, etc.  The intent is to build a object from
  3134.    // this implementation plus another that specifically describes the device,
  3135.    // such as IAMExtTransport.
  3136.    //
  3137.    // Use if: you want to control and external device such as a VCR
  3138.    //
  3139.    // See edevdefs.h for the enumerated parameter list
  3140.    //---------------------------------------------------------------------
  3141.  [
  3142.     object,
  3143.      uuid(B5730A90-1A2C-11cf-8C23-00AA006B6814),
  3144.     pointer_default(unique)
  3145.  ]
  3146.  interface IAMExtDevice : IUnknown
  3147.  {
  3148.     // General device capabilities property.  See edevdefs.h for supported
  3149.     // values
  3150.     HRESULT GetCapability(
  3151.          [in] long Capability,        // identify the property
  3152.         [out] long *pValue,            // return value
  3153.         [out] double *pdblValue        // return value
  3154.      );
  3155.  
  3156.     // Get external device identification string.  Usually the model #
  3157.     // of the device
  3158.     HRESULT get_ExternalDeviceID(
  3159.         [out] LPOLESTR *ppszData        // ID string
  3160.     );
  3161.     
  3162.     HRESULT get_ExternalDeviceVersion(
  3163.         [out] LPOLESTR *ppszData        // revision string
  3164.     );
  3165.     
  3166.     // Controls the external device's power mode
  3167.     HRESULT put_DevicePower([in] long PowerMode
  3168.     );
  3169.     HRESULT get_DevicePower([out] long *pPowerMode
  3170.     );
  3171.     
  3172.     // Some devices need to be reset in some way, i.e., rewinding a VCR
  3173.     // to the beginning of the tape and resetting the counter to zero.
  3174.     HRESULT Calibrate(
  3175.         [in] HEVENT hEvent,
  3176.         [in] long Mode,
  3177.         [out] long *pStatus        // OATRUE is active, OAFALSE is inactive
  3178.     );
  3179.  
  3180.     // Selects the device's communications port, i.e.,COM1, IEEE1394, etc.
  3181.     // See edevdefs.h for enums
  3182.     HRESULT put_DevicePort([in] long DevicePort
  3183.     );
  3184.     HRESULT get_DevicePort([out] long *pDevicePort
  3185.     );
  3186.     
  3187. }
  3188. typedef IAMExtDevice *PEXTDEVICE;
  3189.  
  3190.    //---------------------------------------------------------------------
  3191.    // Defines IAMExtTransport Interface
  3192.    //
  3193.    // Contains properties and methods that control behavior of an external
  3194.    // transport device such as a VTR
  3195.    //
  3196.    // Implement if: you control such a device.  Intended to be agregated
  3197.    // with IAMExtDevice.
  3198.    //
  3199.    // Use if: you want to control such a device
  3200.    //
  3201.    // See edevdefs.h for the parameter lists
  3202.    //---------------------------------------------------------------------
  3203. [
  3204.     object,
  3205.      uuid(A03CD5F0-3045-11cf-8C44-00AA006B6814),
  3206.      pointer_default(unique)
  3207.  ]
  3208. interface IAMExtTransport : IUnknown {
  3209.  
  3210.     // General transport capabilities property.  See edevdefs.h for enums
  3211.     HRESULT GetCapability(
  3212.          [in] long Capability,        // identify the property
  3213.         [out] long *pValue,            // return value
  3214.         [out] double *pdblValue        // return value
  3215.      );
  3216.  
  3217.     // For disc-based devices: spinning, or not spinning.
  3218.     // For tape-based device: threaded, unthreaded or ejected
  3219.     HRESULT put_MediaState([in] long State
  3220.     );
  3221.     HRESULT get_MediaState([out] long *pState    // see edevdefs.h
  3222.     );
  3223.         
  3224.     // Determines state of unit's front panel
  3225.     HRESULT put_LocalControl([in] long State
  3226.     );
  3227.     HRESULT get_LocalControl([out] long *pState    // OATRUE or OAFALSE
  3228.     );
  3229.     
  3230.     // Transport status such as Play, Stop, etc.  More extensive
  3231.     // than AM states.
  3232.     HRESULT GetStatus(
  3233.         [in] long StatusItem,    // see edevdefs.h
  3234.         [out] long *pValue
  3235.     );
  3236.  
  3237.     // Parameters such as recording speed, servo reference, ballistics, etc.
  3238.     HRESULT GetTransportBasicParameters(
  3239.         [in] long Param,
  3240.         [out] long *pValue,
  3241.         [out] LPOLESTR *ppszData
  3242.     );
  3243.  
  3244.     HRESULT SetTransportBasicParameters(
  3245.         [in] long Param,
  3246.         [in] long Value,
  3247.         [in] LPCOLESTR pszData
  3248.     );
  3249.     
  3250.     // Parameters such as video output mode
  3251.     HRESULT GetTransportVideoParameters(
  3252.         [in] long Param,
  3253.         [out] long *pValue
  3254.     );
  3255.  
  3256.     HRESULT SetTransportVideoParameters(
  3257.         [in] long Param,
  3258.         [in] long Value
  3259.     );
  3260.  
  3261.     // Parameters such as audio channel enable
  3262.     HRESULT GetTransportAudioParameters(
  3263.         [in] long Param,
  3264.         [out] long *pValue
  3265.     );
  3266.  
  3267.     HRESULT SetTransportAudioParameters(
  3268.         [in] long Param,
  3269.         [in] long Value
  3270.     );
  3271.     
  3272.     // Mode is  the movement of the transport, i.e., Play, Stop,
  3273.     // Record, Edit, etc.
  3274.     HRESULT put_Mode([in] long Mode
  3275.     );
  3276.     HRESULT get_Mode([out] long *pMode
  3277.     );
  3278.  
  3279.     // Rate is for variable speed control of the the device.  This
  3280.     // can be linked to IMediaControl::Rate() in the implementation
  3281.     // if desired.
  3282.     HRESULT put_Rate([in] double dblRate
  3283.     );
  3284.     HRESULT get_Rate([out] double *pdblRate
  3285.     );
  3286.  
  3287.     // This is a lengthy method, that is, it is in effect until canceled or complete and
  3288.     // requires housekeeping by the filter.  It puts transport in play mode and maintains
  3289.     // fixed relationship between master time reference and transport position.
  3290.     HRESULT GetChase(
  3291.         [out] long *pEnabled,    // OATRUE | OAFALSE
  3292.         [out] long *pOffset,    // offset in current time format
  3293.         [out] HEVENT *phEvent    // completion notification
  3294.     );
  3295.     HRESULT SetChase(
  3296.         [in] long Enable,        // OATRUE | OAFALSE
  3297.         [in] long Offset,        // offset in current time format
  3298.         [in] HEVENT hEvent        // completion notification
  3299.     );
  3300.  
  3301.     // Also a lengthy method: temporarily change transport speed (for synchronizing).
  3302.     HRESULT GetBump(
  3303.         [out] long *pSpeed,
  3304.         [out] long *pDuration    // in current time format
  3305.     );
  3306.     HRESULT SetBump(
  3307.         [in] long Speed,
  3308.         [in] long Duration    // in current time format
  3309.     );
  3310.     
  3311.     // Enable/Disable transport anti-headclog control.
  3312.     HRESULT get_AntiClogControl([out] long *pEnabled    // OATRUE | OAFALSE
  3313.     );
  3314.     HRESULT put_AntiClogControl([in] long Enable    // OATRUE | OAFALSE
  3315.     );
  3316.     
  3317.     // The following group of properties describes edit events.  An edit event can be a
  3318.     // standard insert or assemble edit or a memorized position called a bookmark.
  3319.     // A NOTE ABOUT EVENTS: as with all lengthy commands, event objects must be created to
  3320.     // signal completion or error.
  3321.  
  3322.     // Intended usage: an edit event is prepared for use by:
  3323.     // 1. Registering an edit property set and getting an EditID
  3324.     // 2. Setting the necessary edit properties
  3325.     // 3. Setting the edit property set active
  3326.  
  3327.     // Please see edevdefs.h for properties and values
  3328.  
  3329.     // The reference clock's advance is the mechanism that puts an edit in motion (see
  3330.     // ED_EDIT_REC_INPOINT).
  3331.     
  3332.     // Property set methods
  3333.     HRESULT GetEditPropertySet(
  3334.         [in] long EditID,
  3335.         [out] long *pState    // ED_SET_ACTIVE | ED_SET_INACTIVE | ED_SET_INVALID
  3336.                             // | ED_SET_EXECUTING
  3337.     );
  3338.  
  3339.     HRESULT SetEditPropertySet(
  3340.         [in, out] long *pEditID,
  3341.         [in] long State        // ED_SET_REGISTER | ED_SET_DELETE | ED_SET_ACTIVE |
  3342.     );                        // ED_SET_INACTIVE
  3343.  
  3344.     // the following properties define an edit event such as a bookmark, seek point, or
  3345.     //  actual edit
  3346.     HRESULT GetEditProperty(
  3347.         [in] long EditID,
  3348.         [in] long Param,
  3349.         [out] long *pValue
  3350.     );
  3351.     HRESULT SetEditProperty(
  3352.         [in] long EditID,
  3353.         [in] long Param,
  3354.         [in] long Value
  3355.     );
  3356.     
  3357.     // Activates a capable transport's edit control (typically used for "on the fly" editing).
  3358.     HRESULT get_EditStart([out] long *pValue    // OATRUE or OAFALSE
  3359.     );
  3360.     HRESULT put_EditStart([in] long Value            // OATRUE or OAFALSE
  3361.     );
  3362. }
  3363. typedef IAMExtTransport *PIAMEXTTRANSPORT;
  3364.  
  3365.    //---------------------------------------------------------------------
  3366.    // Defines IAMTimecodeReader Interface
  3367.    //
  3368.    // Contains properties and methods that define behavior of a
  3369.    // SMPTE/MIDI Timecode Reader.  It is expected that this interface
  3370.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3371.    // VCR.
  3372.    //
  3373.    // Implement if: you control such a device
  3374.    //
  3375.    // Use if: you want to control such a device
  3376.    //
  3377.    // See edevdefs.h for the parameter lists
  3378.    //=====================================================================
  3379.  
  3380.  
  3381. // timecode structures
  3382. cpp_quote("#if 0")
  3383. cpp_quote("/* the following is what MIDL knows how to remote */")
  3384. typedef struct tagTIMECODE {
  3385.         WORD    wFrameRate;    // will be replaced by AM defs, but see ED_FORMAT_SMPTE for now
  3386.         WORD    wFrameFract;    // fractional frame.  full scale is always 0x1000
  3387.         DWORD    dwFrames;
  3388. }TIMECODE;
  3389. cpp_quote("#else /* 0 */")
  3390. cpp_quote("#ifndef TIMECODE_DEFINED")
  3391. cpp_quote("#define TIMECODE_DEFINED")
  3392. cpp_quote("typedef union _timecode {")
  3393. cpp_quote("   struct {")
  3394. cpp_quote("     WORD   wFrameRate;")
  3395. cpp_quote("     WORD   wFrameFract;")
  3396. cpp_quote("     DWORD  dwFrames;")
  3397. cpp_quote("     };")
  3398. cpp_quote("   DWORDLONG  qw;")
  3399. cpp_quote("   } TIMECODE;")
  3400. cpp_quote("")
  3401. cpp_quote("#endif /* TIMECODE_DEFINED */")
  3402. cpp_quote("#endif /* 0 */")
  3403.  
  3404. typedef TIMECODE *PTIMECODE;
  3405.  
  3406. typedef struct tagTIMECODE_SAMPLE {
  3407.     LONGLONG    qwTick;        // ActiveMovie 100ns timestamp
  3408.     TIMECODE    timecode;    // timecode
  3409.     DWORD        dwUser;        // timecode user data (aka user bits)
  3410.     DWORD        dwFlags;       // timecode flags - see below
  3411. } TIMECODE_SAMPLE;
  3412. typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE;
  3413.  
  3414.  
  3415. [
  3416.     object,
  3417.      uuid(9B496CE1-811B-11cf-8C77-00AA006B6814),
  3418.      pointer_default(unique)
  3419. ]
  3420. interface IAMTimecodeReader : IUnknown
  3421. {
  3422.     // Timecode Reader Mode - gets/sets the following properties
  3423.     // ED_TCR_SOURCE - timecode gen (readback), LTC, VITC, or Control Track
  3424.     HRESULT GetTCRMode(
  3425.         [in] long Param,
  3426.         [out] long *pValue);
  3427.     HRESULT SetTCRMode(
  3428.         [in] long Param,
  3429.         [in] long Value);
  3430.     
  3431.     // Select which line of the vertical interval timecode will be read from (if VITC).
  3432.     // To read VITC on specific multiple lines, the caller would make successive calls to
  3433.     // put_VITCLine(), once for each line desired.
  3434.     HRESULT put_VITCLine(
  3435.         [in] long Line );    // valid lines are 11-20, 0 means autoselect,
  3436.                             // hi bit set means add to list of lines (for
  3437.                             // readers that test across multiple lines)
  3438.     HRESULT get_VITCLine(
  3439.         [out] long *pLine ); // hi bit set means multiple lines are used,
  3440.                             // and successive calls will cycle through the
  3441.                             // line numbers (like an enumerator, only simpler)
  3442.  
  3443.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3444.     // stream. The client can use this to monitor the timecode, parse duplicates and
  3445.     // discontinuities. The source filter supplying the timecode or possibly a down stream
  3446.     // filter might want to parse for discontinuities or errors since you have to look at
  3447.     // every sample to do this properly.
  3448.     //
  3449.  
  3450.     HRESULT GetTimecode(
  3451.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3452.  
  3453. }
  3454. typedef IAMTimecodeReader *PIAMTIMECODEREADER;
  3455.  
  3456.    //---------------------------------------------------------------------
  3457.    //=====================================================================
  3458.    // Defines IAMTimecodeGenerator Interface
  3459.    //
  3460.    // Contains properties and methods that define behavior of an external
  3461.    // SMPTE/MIDI Timecode Generator.  It is expected that this interface
  3462.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3463.    // VCR.
  3464.    //
  3465.    // Implement if: you control such a device
  3466.    //
  3467.    // Use if: you want to control such a device
  3468.    //
  3469.    // See edevdefs.h for the parameter lists
  3470.     //---------------------------------------------------------------------
  3471. [
  3472.     object,
  3473.      uuid(9B496CE0-811B-11cf-8C77-00AA006B6814),
  3474.      pointer_default(unique)
  3475.  ]
  3476. interface IAMTimecodeGenerator : IUnknown {
  3477.  
  3478.     // Timecode Generator Mode - gets/sets the following properties (see
  3479.     // vcrdefss.h for detailed values):
  3480.     // ED_TCG_TIMECODE_TYPE - LTC, VITC, or MIDI
  3481.     // ED_TCG_FRAMERATE - 24, 25, 30 drop or 30 nondrop
  3482.     // ED_TCG_SYNC_SOURCE - what is driving the bitclock
  3483.     // ED_TCG_REFERENCE_SOURCE - what is driving the count value
  3484.     HRESULT GetTCGMode(
  3485.         [in] long Param,
  3486.         [out] long *pValue);
  3487.  
  3488.     HRESULT SetTCGMode(
  3489.         [in] long Param,
  3490.         [in] long Value);
  3491.  
  3492.     // Select into which line(s) of the vertical interval timecode will be inserted (if VITC).
  3493.     // Hi bit set means add this line to any previously set lines.
  3494.     // To generate VITC on specific multiple lines, the caller would make successive calls to
  3495.     // put_VITCLine(), once for each line desired.
  3496.     HRESULT put_VITCLine(
  3497.         [in] long Line        // valid lines are 11-20, 0 means autoselect(this setting
  3498.     );                        // is for TC readers that decode from multiple lines)
  3499.     HRESULT get_VITCLine(
  3500.         [out] long *pLine
  3501.     );
  3502.  
  3503.     // Sets timecode and/or userbit value.  If generator is running, takes effect
  3504.     // immediately.  If caller wants to set only timecode, set userbit value to -1L (and
  3505.     // same for setting userbits only)
  3506.     //
  3507.  
  3508.     HRESULT SetTimecode(
  3509.       [in] PTIMECODE_SAMPLE pTimecodeSample) ;
  3510.  
  3511.  
  3512.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3513.     // stream. The client can use this to monitor the timecode and verify the generator is
  3514.     // working properly
  3515.     //
  3516.  
  3517.     HRESULT GetTimecode(
  3518.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3519.  
  3520. }
  3521. typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR;
  3522.  
  3523.     //---------------------------------------------------------------------
  3524.    // Defines IAMTimecodeDisplay Interface
  3525.    //
  3526.    // Contains properties and methods that define behavior of an external
  3527.    // SMPTE/MIDI Timecode Display device (aka "character generator" for
  3528.    // making "burn-ins" or "window dubs"). It is expected that this interface
  3529.    // will be combined (aggregated) with IAMExtTransport and the timecode
  3530.    // interfaces to "build" a pro VCR.
  3531.    //
  3532.    // Implement if: you control such a device
  3533.    //
  3534.    // Use if: you want to control such a device
  3535.    //
  3536.    // See edevdefs.h for the parameter lists
  3537.     //---------------------------------------------------------------------
  3538. [
  3539.     object,
  3540.      uuid(9B496CE2-811B-11cf-8C77-00AA006B6814),
  3541.      pointer_default(unique)
  3542.  ]
  3543. interface IAMTimecodeDisplay : IUnknown
  3544. {
  3545.     // Enable/disable external device's timecode reader's character generator output.  Some
  3546.     // readers have this feature - this is not intended for rendering inside the PC!
  3547.     HRESULT GetTCDisplayEnable(
  3548.         [out] long *pState);    // OATRUE | OAFALSE
  3549.     HRESULT SetTCDisplayEnable(
  3550.         [in] long State);        // OATRUE | OAFALSE
  3551.                                 // Timecode reader's character generator output
  3552.                                 //  characteristics (size, position, intensity, etc.).
  3553.     HRESULT GetTCDisplay(
  3554.         [in] long Param,
  3555.         [out] long *pValue);
  3556.     HRESULT SetTCDisplay(
  3557.         [in] long Param,
  3558.         [in] long Value);
  3559.  
  3560.     /* Allowable params and values (see edevdefs.h for details):
  3561.         ED_TCD_SOURCE
  3562.             ED_TCR | ED_TCG
  3563.         ED_TCD_SIZE
  3564.             ED_SMALL | ED_MED | ED_LARGE
  3565.         ED_TCD_POSITION
  3566.             ED_TOP | ED_MIDDLE | ED_BOTTOM or'd  with
  3567.             ED_LEFT | ED_CENTER | ED_RIGHT
  3568.         ED_TCD_INTENSITY
  3569.             ED_HIGH | ED_LOW
  3570.         ED_TCD_TRANSPARENCY    // set from 0 to 4, 0 being completely opaque
  3571.         ED_TCD_INVERT        // white on black or black on white
  3572.             OATRUE | OAFALSE
  3573.         ED_TCD_BORDER        // white border for black chars, black border for white letters
  3574.             OATRUE | OAFALSE
  3575.     */
  3576. }
  3577. typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY;
  3578.  
  3579.  
  3580. [
  3581.     object,
  3582.     uuid(c6545bf0-e76b-11d0-bd52-00a0c911ce86),
  3583.     pointer_default(unique)
  3584. ]
  3585. interface IAMDevMemoryAllocator : IUnknown
  3586. {
  3587.     HRESULT GetInfo(
  3588.         [out] DWORD *pdwcbTotalFree,
  3589.         [out] DWORD *pdwcbLargestFree,
  3590.         [out] DWORD *pdwcbTotalMemory,
  3591.         [out] DWORD *pdwcbMinimumChunk);
  3592.  
  3593.     HRESULT CheckMemory(
  3594.         [in] const BYTE *pBuffer);
  3595.  
  3596.     HRESULT Alloc(
  3597.         [out] BYTE **ppBuffer,
  3598.         [in, out] DWORD *pdwcbBuffer);
  3599.  
  3600.     HRESULT Free(
  3601.         [in] BYTE *pBuffer);
  3602.  
  3603.     HRESULT GetDevMemoryObject(
  3604.         [out] IUnknown **ppUnkInnner,
  3605.         [in] IUnknown *pUnkOuter);
  3606. }
  3607. typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR;
  3608.  
  3609.  
  3610. [
  3611.     object,
  3612.     uuid(c6545bf1-e76b-11d0-bd52-00a0c911ce86),
  3613.     pointer_default(unique)
  3614. ]
  3615. interface IAMDevMemoryControl : IUnknown
  3616. {
  3617.     HRESULT QueryWriteSync();
  3618.  
  3619.     HRESULT WriteSync();
  3620.  
  3621.     HRESULT GetDevId(
  3622.         [out] DWORD *pdwDevId);
  3623.  
  3624. }
  3625. typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL;
  3626.  
  3627. //  Flags for IAMStreamSelection::Info
  3628. enum _AMSTREAMSELECTINFOFLAGS {
  3629.     AMSTREAMSELECTINFO_ENABLED   = 0x01,  // Enable - off for disable
  3630.     AMSTREAMSELECTINFO_EXCLUSIVE = 0x02   // Turns off the others in the group
  3631.                                           // when enabling this one
  3632. };
  3633. //  Flags for IAMStreamSelection::Enable
  3634. enum _AMSTREAMSELECTENABLEFLAGS {
  3635.     //  Currently valid values are :
  3636.     //  0 - disable all streams in the group containing this stream
  3637.     //  ..._ENABLE - enable only this stream with in the given group
  3638.     //               and disable all others
  3639.     //  ..._ENABLEALL - send out all streams
  3640.     AMSTREAMSELECTENABLE_ENABLE    = 0x01,  // Enable
  3641.     AMSTREAMSELECTENABLE_ENABLEALL = 0x02   // Enable all streams in the group
  3642.                                             // containing this stream
  3643. };
  3644.  
  3645. //  Control which logical streams are played and find out information about
  3646. //  them
  3647. //  Normally supported by a filter
  3648. [
  3649.     object,
  3650.     uuid(c1960960-17f5-11d1-abe1-00a0c905f375),
  3651.     pointer_default(unique)
  3652. ]
  3653. interface IAMStreamSelect : IUnknown
  3654. {
  3655.     //  Returns total count of streams
  3656.     HRESULT Count(
  3657.         [out] DWORD *pcStreams);      // Count of logical streams
  3658.  
  3659.     //  Return info for a given stream - S_FALSE if iIndex out of range
  3660.     //  The first steam in each group is the default
  3661.     HRESULT Info(
  3662.         [in] long lIndex,              // 0-based index
  3663.         [out] AM_MEDIA_TYPE **ppmt,   // Media type - optional
  3664.                                       // Use DeleteMediaType to free
  3665.         [out] DWORD *pdwFlags,        // flags - optional
  3666.         [out] LCID  *plcid,           // LCID (returns 0 if none) - optional
  3667.         [out] DWORD *pdwGroup,        // Logical group - optional
  3668.         [out] WCHAR **ppszName,       // Name - optional - free with CoTaskMemFree
  3669.                                       // optional
  3670.         [out] IUnknown **ppObject,    // Associated object - optional
  3671.                                       // Object may change if Enable is
  3672.                                       // called on this interface
  3673.                                       // - returns NULL if no associated object
  3674.                                       // Returns pin or filter for DShow
  3675.         [out] IUnknown **ppUnk);      // Stream specific interface
  3676.  
  3677.     //  Enable or disable a given stream
  3678.     HRESULT Enable(
  3679.         [in]  long lIndex,
  3680.         [in]  DWORD dwFlags);
  3681. }
  3682. typedef IAMStreamSelect *PAMSTREAMSELECT;
  3683.  
  3684.  
  3685.