Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4914 lines
162 KiB

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