/[cvs]/api/include/DShowIDL/axextend.idl
ViewVC logotype

Annotation of /api/include/DShowIDL/axextend.idl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun Jul 1 20:47:59 2001 UTC (22 years, 11 months ago) by bearsoft
Branch point for: lazy, MAIN
Initial revision

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

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26