Leaked source code of windows server 2003
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.

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