Axextend.Idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:160k
- //------------------------------------------------------------------------------
- // File: AXExtend.idl
- //
- // Desc: Extended streaming interface definitions for the ActiveMovie
- // streaming and synchronization architecture. Core streaming
- // interfaces are in AXCore.idl, and control interfaces for the
- // type library are in Control.odl.
- //
- // Copyright (c) 1992 - 2000, Microsoft Corporation. All rights reserved.
- //------------------------------------------------------------------------------
- // include after unknwn.idl, objidl.idl and axcore.idl
- // forward declarations - these are the interfaces declared in this file
- interface IEnumRegFilters;
- interface IFileSourceFilter;
- interface IFileSinkFilter;
- interface IFileSinkFilter2;
- interface IGraphBuilder;
- interface ICaptureGraphBuilder;
- interface ICaptureGraphBuilder2;
- interface IAMCopyCaptureFileProgress;
- interface IFilterMapper;
- interface IFilterMapper2;
- interface IMediaEventSink;
- interface IOverlay;
- interface IOverlayNotify;
- interface IOverlayNotify2;
- interface IQualityControl;
- interface ISeekingPassThru;
- interface IAMStreamConfig;
- interface IAMDevMemoryAllocator;
- interface IAMDevMemoryControl;
- interface IConfigInterleaving;
- interface IConfigAviMux;
- interface IAMVideoCompression;
- interface IAMVfwCaptureDialogs;
- interface IAMVfwCompressDialogs;
- interface IAMDroppedFrames;
- interface IAMAudioInputMixer;
- interface IAMBufferNegotiation;
- interface IAMAnalogVideoDecoder;
- interface IAMVideoProcAmp;
- interface IAMAnalogVideoEncoder;
- interface IAMCameraControl;
- interface IAMCrossbar;
- interface IAMTVTuner;
- interface IKsPropertySet;
- interface IAMPhysicalPinInfo;
- interface IAMExtDevice;
- interface IAMExtTransport;
- interface IAMTimecodeReader;
- interface IAMTimecodeGenerator;
- interface IAMTimecodeDisplay;
- interface IDrawVideoImage;
- interface IDecimateVideoImage;
- interface IAMVideoDecimationProperties;
- interface IAMPushSource;
- interface IAMAudioRendererStats;
- interface IAMLatency;
- interface IAMGraphStreams;
- interface IAMOverlayFX;
- interface IAMOpenProgress;
- interface IMpeg2Demultiplexer ;
- interface IMPEG2StreamIdMap ;
- interface IEnumStreamIdMap ;
- //==========================================================================
- //==========================================================================
- // IEnumRegFilters interface -- enumerates registered filters.
- // enumerator interface returned from IFilterMapper::EnumMatchingFilters().
- // based on IEnum pseudo-template
- //==========================================================================
- //==========================================================================
- typedef struct {
- CLSID Clsid; // class id of the filter
- LPWSTR Name; // name of filter
- } REGFILTER;
- [
- object,
- uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- // The point of the mapper is to avoid loading filters. By looking in the
- // registry we can reduce the number of filters which must be loaded and tried.
- // This enumerator returns descriptors of filters (including the GUIDs that
- // CoCreateInstance can instantiate). The filters themselves are not loaded.
- interface IEnumRegFilters : IUnknown {
- import "unknwn.idl";
- // The caller must use CoTaskMemFree to free each REGFILTER* returned
- // in the array.
- HRESULT Next
- ( [in] ULONG cFilters, // place this many filters...
- [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER*
- [out] ULONG * pcFetched // actual count passed returned here
- );
- // I can't think why anyone would want to skip, so it's not implemented.
- // (anyone who thinks they know what they would be skipping over is probably
- // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL.
- HRESULT Skip(
- [in] ULONG cFilters
- );
- HRESULT Reset(void);
- // No cloning either - also ALWAYS returns E_NOTIMPL.
- HRESULT Clone(
- [out] IEnumRegFilters **ppEnum
- );
- }
- typedef IEnumRegFilters *PENUMREGFILTERS;
- //========================================================================
- //========================================================================
- // abstraction representing the registered information about filters.
- // This allows properties of filters to be looked up without loading them.
- //========================================================================
- //========================================================================
- [
- object,
- uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IFilterMapper : IUnknown {
- import "unknwn.idl";
- //==========================================================================
- // Registration functions.
- // A filter should be registered before any other use.
- // The registration can be NON_VOLATILE (i.e. permanent, do once ever)
- // or VOLATILE (once per boot of the system).
- // UnregisterFilter (obviously) removes the registration.
- // The action of any of the other calls on unregistered filters is undefined.
- // it will either work or you'll get an error, but I'm not saying which.
- //==========================================================================
- // Four predefined values controling the order in which filters are tried
- // for intelligent graph building. Intermediate values are legal.
- // Any value <=MERIT_DO_NOT_USE will mean that the filter will never
- // be tried by the filtergrah to automatically complete a connection.
- enum { MERIT_PREFERRED = 0x800000,
- MERIT_NORMAL = 0x600000,
- MERIT_UNLIKELY = 0x400000,
- MERIT_DO_NOT_USE = 0x200000,
- MERIT_SW_COMPRESSOR = 0x100000,
- MERIT_HW_COMPRESSOR = 0x100050
- };
- // Register a filter
- HRESULT RegisterFilter
- ( [in] CLSID clsid, // GUID of the filter
- [in] LPCWSTR Name, // Descriptive name for the filter
- [in] DWORD dwMerit // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED.
- );
- // Register an identifiable instance of a filter. This deals with cases
- // such as two similar sound cards which are driven by the same driver,
- // but we want to choose which oif these cards the sound will come out of.
- // This is not needed if there is only one instance of the filter
- // (e.g. there is only one sound card in the machine) or if all instances
- // of the filter are equivalent.
- // The filter itself must have already been registered // ??? Is that true?
- HRESULT RegisterFilterInstance
- ( [in] CLSID clsid, // GUID of the filter
- [in] LPCWSTR Name, // Descriptive name of instance.
- [out] CLSID *MRId // Returned Media Resource Id. A
- // locally unique id for this instance
- // of this filter
- );
- HRESULT RegisterPin
- ( [in] CLSID Filter, // GUID of filter
- [in] LPCWSTR Name, // Name of the pin
- [in] BOOL bRendered, // The filter renders this input
- [in] BOOL bOutput, // TRUE if this is an Output pin
- [in] BOOL bZero, // TRUE if OK for zero instances of pin
- // In this case you will have to Create
- // a pin to have even one instance
- [in] BOOL bMany, // TRUE if OK for many instances of pin
- [in] CLSID ConnectsToFilter, // Filter it connects to if it has
- // subterranean connection, else NULL
- [in] LPCWSTR ConnectsToPin // Name of pin it connects to
- // NULL for output pins
- );
- HRESULT RegisterPinType
- ( [in] CLSID clsFilter, // GUID of filter
- [in] LPCWSTR strName, // Descriptive name of the pin
- [in] CLSID clsMajorType, // Major type of the data stream
- [in] CLSID clsSubType // Sub type of the data stream
- );
- HRESULT UnregisterFilter
- ( [in] CLSID Filter // GUID of filter
- );
- HRESULT UnregisterFilterInstance
- ( [in] CLSID MRId // Media Resource Id of this instance
- );
- HRESULT UnregisterPin
- ( [in] CLSID Filter, // GUID of filter
- [in] LPCWSTR Name // Name of the pin
- );
- // Set *ppEnum to be an enumerator for filters matching the requirements.
- HRESULT EnumMatchingFilters
- ( [out] IEnumRegFilters **ppEnum // enumerator returned
- , [in] DWORD dwMerit // at least this merit needed
- , [in] BOOL bInputNeeded // need at least one input pin
- , [in] CLSID clsInMaj // input major type
- , [in] CLSID clsInSub // input sub type
- , [in] BOOL bRender // must the input be rendered?
- , [in] BOOL bOututNeeded // need at least one output pin
- , [in] CLSID clsOutMaj // output major type
- , [in] CLSID clsOutSub // output sub type
- );
- }
- // structure used to identify media types a pin handles. Used for
- // registration through IFilterMapper and IFilterMapper2
- //
- typedef struct
- {
- const CLSID * clsMajorType;
- const CLSID * clsMinorType;
- } REGPINTYPES;
- // describes pin for filter registration. Used for registration
- // through IFilterMapper and IFilterMapper2
- //
- typedef struct
- {
- LPWSTR strName;
- // The filter renders this input
- BOOL bRendered;
- // This is an Output pin
- BOOL bOutput;
- // OK to have zero instances of pin In this case you will have to
- // Create a pin to have even one instance
- BOOL bZero;
- // OK to create many instance of pin
- BOOL bMany;
- const CLSID * clsConnectsToFilter;
- const WCHAR * strConnectsToPin;
- UINT nMediaTypes;
- const REGPINTYPES * lpMediaType;
- } REGFILTERPINS;
- // mediums (as defined in the Windows NT DDK) for registration with
- // IFilterMapper2
- //
- typedef struct
- {
- CLSID clsMedium;
- DWORD dw1;
- DWORD dw2;
- } REGPINMEDIUM;
- // flags for dwFlags in REFILTERPINS2
- enum
- {
- // OK to have zero instances of pin In this case you will have to
- // Create a pin to have even one instance
- REG_PINFLAG_B_ZERO = 0x1,
- // The filter renders this input
- REG_PINFLAG_B_RENDERER = 0x2,
- // OK to create many instance of pin
- REG_PINFLAG_B_MANY = 0x4,
- // This is an Output pin
- REG_PINFLAG_B_OUTPUT = 0x8
- };
- // describes pin for filter registration through IFilterMapper2
- typedef struct
- {
- // combination of REG_PINFLAG flags
- DWORD dwFlags;
- // number of instances of the pin if known
- UINT cInstances;
- UINT nMediaTypes;
- [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType;
- UINT nMediums;
- [size_is(nMediums)] const REGPINMEDIUM *lpMedium;
- // pin category (for Kernel Streaming pins) as defined in the
- // Windows NT DDK
- const CLSID *clsPinCategory;
- } REGFILTERPINS2;
- // describes filter for registration through IFilterMapper2
- typedef struct
- {
- DWORD dwVersion; // 1 or 2
- DWORD dwMerit;
- /* unnamed union */
- [switch_is(dwVersion)] [switch_type(DWORD)] union
- {
- [case(1)]
- struct
- {
- ULONG cPins;
- [size_is(cPins)] const REGFILTERPINS *rgPins;
- };
- [case(2)]
- struct
- {
- ULONG cPins2;
- [size_is(cPins2)] const REGFILTERPINS2 *rgPins2;
- };
- [default]
- ;
- } ;
- } REGFILTER2;
- [
- object,
- uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375),
- pointer_default(unique)
- ]
- interface IFilterMapper2 : IUnknown {
- import "unknwn.idl";
- // create or rename ActiveMovie category
- HRESULT CreateCategory
- ( [in] REFCLSID clsidCategory,
- [in] DWORD dwCategoryMerit,
- [in] LPCWSTR Description
- );
- HRESULT UnregisterFilter
- ( [in] const CLSID *pclsidCategory,
- [in] const OLECHAR *szInstance,
- [in] REFCLSID Filter // GUID of filter
- );
- // Register a filter, pins, and media types under a category.
- HRESULT RegisterFilter
- ( [in] REFCLSID clsidFilter, // GUID of the filter
- [in] LPCWSTR Name, // Descriptive name for the filter
- // ppMoniker can be null. or *ppMoniker can contain the
- // moniker where this filter data will be written;
- // *ppMoniker will be set to null on return. or *ppMoniker
- // can be null in which case the moniker will be returned
- // with refcount.
- [in, out] IMoniker **ppMoniker,
- // can be null
- [in] const CLSID *pclsidCategory,
- // cannot be null
- [in] const OLECHAR *szInstance,
- // rest of filter and pin registration
- [in] const REGFILTER2 *prf2
- );
- // Set *ppEnum to be an enumerator for filters matching the
- // requirements.
- HRESULT EnumMatchingFilters
- ( [out] IEnumMoniker **ppEnum // enumerator returned
- , [in] DWORD dwFlags // 0
- , [in] BOOL bExactMatch // don't match wildcards
- , [in] DWORD dwMerit // at least this merit needed
- , [in] BOOL bInputNeeded // need at least one input pin
- , [in] DWORD cInputTypes // Number of input types to match
- // Any match is OK
- , [size_is(cInputTypes*2)] const GUID *pInputTypes // input major+subtype pair array
- , [in] const REGPINMEDIUM *pMedIn // input medium
- , [in] const CLSID *pPinCategoryIn // input pin category
- , [in] BOOL bRender // must the input be rendered?
- , [in] BOOL bOutputNeeded // need at least one output pin
- , [in] DWORD cOutputTypes // Number of output types to match
- // Any match is OK
- , [size_is(cOutputTypes*2)] const GUID *pOutputTypes // output major+subtype pair array
- , [in] const REGPINMEDIUM *pMedOut // output medium
- , [in] const CLSID *pPinCategoryOut // output pin category
- );
- }
- [
- object,
- uuid(b79bb0b1-33c1-11d1-abe1-00a0c905f375),
- pointer_default(unique)
- ]
- interface IFilterMapper3 : IFilterMapper2 {
- // new interface to allow creating filters using the mapper's devenum instance
- // primarily needed for out-of-proc access to a graph
- HRESULT GetICreateDevEnum( [out] ICreateDevEnum **ppEnum );
- }
- //========================================================================
- //========================================================================
- // Defines IQualityControl interface
- //
- // Defines quality messages and allows a quality manager to install itself
- // as the sink for quality messages.
- //========================================================================
- //========================================================================
- typedef enum tagQualityMessageType {
- Famine,
- Flood
- } QualityMessageType;
- typedef struct tagQuality {
- QualityMessageType Type;
- long Proportion; // milli-units. 1000 = no change
- // for Flood:
- // What proportion of the media samples currently
- // coming through are required in the future.
- // 800 means please drop another 20%
- // For Famine:
- // How much to "keep in" e.g. 800 means send me
- // 20% less e.g. by dropping 20% of the samples.
- // 1100 would mean "I'm coping, send me more".
- REFERENCE_TIME Late;
- // How much you need to catch up by
- REFERENCE_TIME TimeStamp;
- // The stream time when this was generated (probably
- // corresponds to the start time on some sample).
- } Quality;
- typedef IQualityControl *PQUALITYCONTROL;
- [
- object,
- uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IQualityControl : IUnknown {
- // Notify the recipient that a quality change is requested.
- // pSelf is the IBaseFilter* of the sender.
- // this is sent from a filter
- // to (the quality manager or) an upstream peer.
- HRESULT Notify
- ( [in] IBaseFilter * pSelf,
- [in] Quality q
- );
- // Notify the recipient that future quality messages are to be sent
- // to iqc. If piqc is NULL then quality messages are to default back to
- // the upstream peer.
- // This is sent from the quality manager to a filter.
- // The recipient should hold piqc as a WEAK reference,
- // i.e. do not AddRef it, do not Release it.
- HRESULT SetSink
- ( [in] IQualityControl * piqc
- );
- }
- //=====================================================================
- //=====================================================================
- // Definitions required for overlay transport
- //=====================================================================
- //=====================================================================
- // Used to communicate the colour that the IOverlay client wants the window
- // painted in so that it can draw directly to the correct clipping region
- // A colour key can be described in two alternate ways, the first is by a
- // range of one or more (system) palette indices. The second is by defining
- // a colour cube with two RGB values, any of which would be acceptable.
- //
- // The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros
- enum { CK_NOCOLORKEY = 0x0, // No color key is required
- CK_INDEX = 0x1, // Index into the current system palette
- CK_RGB = 0x2 }; // Color key is an RGB value (or range)
- typedef struct tagCOLORKEY {
- DWORD KeyType; // Explains meaning of the structure
- DWORD PaletteIndex; // Palette index if available
- COLORREF LowColorValue; // Low colour space RGB value
- COLORREF HighColorValue; // Defines the high RGB value
- } COLORKEY;
- // When a filter sets up an advise link it can ask that only certain types
- // of notifications be sent, for example just palette changes. While this
- // doesn't mean that the other notification call backs won't ever be called
- // the IOverlay implementation may use this as an efficiency optimisation
- enum { ADVISE_NONE = 0x0, // No notifications required
- ADVISE_CLIPPING = 0x1, // Synchronous clip information
- ADVISE_PALETTE = 0x2, // Palette change notifications
- ADVISE_COLORKEY = 0x4, // Called when colour key changes
- ADVISE_POSITION = 0x8, // Likewise when window moves etc
- ADVISE_DISPLAY_CHANGE = 0x10 // Called on WM_DISPLAYCHANGE
- };
- const DWORD ADVISE_ALL = ADVISE_CLIPPING |
- ADVISE_PALETTE |
- ADVISE_COLORKEY |
- ADVISE_POSITION;
- const DWORD ADVISE_ALL2 = ADVISE_ALL |
- ADVISE_DISPLAY_CHANGE;
- // This isn't defined when you run IDL
- cpp_quote("#ifndef _WINGDI_")
- typedef struct _RGNDATAHEADER {
- DWORD dwSize;
- DWORD iType;
- DWORD nCount;
- DWORD nRgnSize;
- RECT rcBound;
- } RGNDATAHEADER;
- typedef struct _RGNDATA {
- RGNDATAHEADER rdh;
- char Buffer[1];
- } RGNDATA;
- cpp_quote("#endif")
- //=====================================================================
- //=====================================================================
- // Defines IOverlayNotify interface
- //
- // This interface gives asynchronous notifications of changes to the
- // rendering window - such as changes to the exposed window area
- //=====================================================================
- //=====================================================================
- [
- object,
- local,
- uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IOverlayNotify : IUnknown {
- // IOverlayNotify methods
- // This notifies the filter of palette changes, the filter should copy
- // the array of RGBQUADs if it needs to use them after returning. This
- // is not called when the palette is actually changed in the display
- // but at a short time after (in sync with WM_PALETTECHANGED messages)
- HRESULT OnPaletteChange(
- [in] DWORD dwColors, // Number of colours present
- [in] const PALETTEENTRY *pPalette); // Array of palette colours
- // This provides synchronous clip changes so that the client is called
- // before the window is moved to freeze the video, and then when the
- // window has stabilised it is called again to start playback again.
- // If the window rect is all zero then the window is invisible, the
- // filter must take a copy of the information if it wants to keep it
- HRESULT OnClipChange(
- [in] const RECT *pSourceRect, // Region of video to use
- [in] const RECT *pDestinationRect, // Where video goes
- [in] const RGNDATA *pRgnData); // Defines clipping information
- HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey);
- // The calls to OnClipChange happen in sync with the window. So it is
- // called with an empty clip list before the window moves to freeze
- // the video, and then when the window has stabilised it is called
- // again with the new clip list. The OnPositionChange callback is for
- // overlay cards that don't want the expense of synchronous clipping
- // updates and just want to know when the source or destination video
- // positions change. They will NOT be called in sync with the window
- // but at some point after the window has changed (basicly in time
- // with WM_SIZE etc messages received). This is therefore suitable
- // for overlay cards that don't inlay their data to the frame buffer
- // NOTE the destination is NOT clipped to the visible display area
- HRESULT OnPositionChange([in] const RECT *pSourceRect,
- [in] const RECT *pDestinationRect);
- }
- typedef IOverlayNotify *POVERLAYNOTIFY;
- //=====================================================================
- //=====================================================================
- // Defines IOverlayNotify2 interface
- //
- // This interface gives asynchronous notifications of changes to the
- // rendering window - such as changes to the exposed window area
- // This is optionally supported by the advise sink for the purposes
- // of accepting OnDisplayChange notification.
- //=====================================================================
- //=====================================================================
- cpp_quote("#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)")
- cpp_quote("#define HMONITOR_DECLARED")
- cpp_quote("#if 0")
- typedef HANDLE HMONITOR;
- cpp_quote("#endif")
- cpp_quote("DECLARE_HANDLE(HMONITOR);")
- cpp_quote("#endif")
- [
- object,
- local,
- uuid(680EFA10-D535-11D1-87C8-00A0C9223196),
- pointer_default(unique)
- ]
- interface IOverlayNotify2 : IOverlayNotify {
- // IOverlayNotify2 methods
- HRESULT OnDisplayChange( // ADVISE_DISPLAY_CHANGE
- HMONITOR hMonitor);
- }
- typedef IOverlayNotify2 *POVERLAYNOTIFY2;
- //=====================================================================
- //=====================================================================
- // Defines IOverlay interface
- //
- // This interface provides information so that a filter can write direct to
- // the frame buffer while placing the video in the correct window position
- //=====================================================================
- //=====================================================================
- [
- object,
- local,
- uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IOverlay : IUnknown {
- // IOverlay methods
- HRESULT GetPalette(
- [out] DWORD *pdwColors, // Number of colours present
- [out] PALETTEENTRY **ppPalette); // Where to put palette data
- HRESULT SetPalette(
- [in] DWORD dwColors, // Number of colours present
- [in] PALETTEENTRY *pPalette); // Colours to use for palette
- // If you change the colour key through SetColorKey then all the advise
- // links will receive an OnColorKeyChange callback with the new colour
- HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey);
- HRESULT GetColorKey([out] COLORKEY *pColorKey);
- HRESULT SetColorKey([in,out] COLORKEY *pColorKey);
- HRESULT GetWindowHandle([out] HWND *pHwnd);
- // The IOverlay implementation allocates the memory for the clipping
- // rectangles as it can be variable in length. The filter calling
- // this method should free the memory when it is finished with it
- HRESULT GetClipList([out] RECT *pSourceRect,
- [out] RECT *pDestinationRect,
- [out] RGNDATA **ppRgnData);
- // Returns the current video source and destination
- HRESULT GetVideoPosition([out] RECT *pSourceRect,
- [out] RECT *pDestinationRect);
- HRESULT Advise(
- [in] IOverlayNotify *pOverlayNotify, // Notification interface
- [in] DWORD dwInterests); // Callbacks interested in
- HRESULT Unadvise(); // Stop the callbacks now
- }
- typedef IOverlay *POVERLAY;
- //=====================================================================
- //=====================================================================
- // control related interfaces (others are defined in control.odl)
- //=====================================================================
- //=====================================================================
- //=====================================================================
- //=====================================================================
- // Defines IMediaEventSink interface
- //
- // Exposed by filtergraph. Called by filters to notify events. Will be
- // passed on to application by the IMediaControl event methods.
- //=====================================================================
- //=====================================================================
- [
- object,
- uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IMediaEventSink : IUnknown {
- // notify an event. will be queued, but not delivered to
- // the application on this thread.
- HRESULT Notify(
- [in] long EventCode,
- [in] LONG_PTR EventParam1,
- [in] LONG_PTR EventParam2
- );
- }
- typedef IMediaEventSink *PMEDIAEVENTSINK;
- //=====================================================================
- //=====================================================================
- // Defines IFileSourceFilter interface
- //
- // Exposed by source filters to set the file name and media type.
- //=====================================================================
- //=====================================================================
- [
- object,
- uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IFileSourceFilter : IUnknown {
- // Load a file and assign it the given media type
- HRESULT Load(
- [in] LPCOLESTR pszFileName, // Pointer to absolute path of file to open
- [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL
- );
- // Get the currently loaded file name
- HRESULT GetCurFile(
- [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file
- [out] AM_MEDIA_TYPE *pmt // Pointer to the media type
- );
- }
- typedef IFileSourceFilter *PFILTERFILESOURCE;
- //=====================================================================
- //=====================================================================
- // Defines IFileSinkFilter interface
- //
- // Exposed by renderers to set the output file name.
- //=====================================================================
- //=====================================================================
- [
- object,
- uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6),
- pointer_default(unique)
- ]
- interface IFileSinkFilter : IUnknown {
- // Output to this file. default is to open the existing file
- HRESULT SetFileName(
- [in] LPCOLESTR pszFileName, // Pointer to absolute path of output file
- [in, unique] const AM_MEDIA_TYPE *pmt // Media type of file - can be NULL
- );
- // Get the current file name
- HRESULT GetCurFile(
- [out] LPOLESTR *ppszFileName, // Pointer to the path for the current file
- [out] AM_MEDIA_TYPE *pmt // Pointer to the media type
- );
- }
- typedef IFileSinkFilter *PFILTERFILESINK;
- [
- object,
- uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86),
- pointer_default(unique)
- ]
- interface IFileSinkFilter2 : IFileSinkFilter {
- HRESULT SetMode(
- [in] DWORD dwFlags // AM_FILESINK_FLAGS
- );
- HRESULT GetMode(
- [out] DWORD *pdwFlags // AM_FILESINK_FLAGS
- );
- }
- typedef IFileSinkFilter2 *PFILESINKFILTER2;
- typedef enum {
- // create a new file
- AM_FILE_OVERWRITE = 0x00000001,
- } AM_FILESINK_FLAGS;
- //
- // Intelligent connectivity for filters - an interface supported by
- // filter graphs (since it is an extension to IFilterGraph) that supports
- // building of graphs by automatic selection and connection of appropriate
- // filters
- [
- object,
- uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IGraphBuilder : IFilterGraph {
- // Connect these two pins directly or indirectly, using transform filters
- // if necessary.
- HRESULT Connect
- ( [in] IPin * ppinOut, // the output pin
- [in] IPin * ppinIn // the input pin
- );
- // Connect this output pin directly or indirectly, using transform filters
- // if necessary to something that will render it.
- HRESULT Render
- ( [in] IPin * ppinOut // the output pin
- );
- // Build a filter graph that will render this file using this play list.
- // If lpwstrPlayList is NULL then it will use the default play list
- // which will typically render the whole file.
- HRESULT RenderFile
- ( [in] LPCWSTR lpcwstrFile,
- [in, unique] LPCWSTR lpcwstrPlayList
- );
- // Add to the filter graph a source filter for this file. This would
- // be the same source filter that would be added by calling Render.
- // This call gives you more control over building
- // the rest of the graph, e.g. AddFilter(<a renderer of your choice>)
- // and then Connect the two.
- // The IBaseFilter* interface exposed by the source filter is returned
- // in ppFilter, addrefed already for you
- // The filter will be known by the name lpcwstrFIlterName
- // nn this filter graph,
- HRESULT AddSourceFilter
- ( [in] LPCWSTR lpcwstrFileName,
- [in, unique] LPCWSTR lpcwstrFilterName,
- [out] IBaseFilter* *ppFilter
- );
- // If this call is made then trace information will be written to the
- // file showing the actions taken in attempting to perform an operation.
- HRESULT SetLogFile
- ( [in] DWORD_PTR hFile // open file handle e.g. from CreateFile
- );
- // Request that the graph builder should return as soon as possible from
- // its current task.
- // Note that it is possible fot the following to occur in the following
- // sequence:
- // Operation begins; Abort is requested; Operation completes normally.
- // This would be normal whenever the quickest way to finish an operation
- // was to simply continue to the end.
- HRESULT Abort();
- // Return S_OK if the curent operation is to continue,
- // return S_FALSE if the current operation is to be aborted.
- // This method can be called as a callback from a filter which is doing
- // some operation at the request of the graph.
- HRESULT ShouldOperationContinue();
- }
- //
- // New capture graph builder
- [
- object,
- uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5),
- pointer_default(unique)
- ]
- interface ICaptureGraphBuilder : IUnknown {
- // Use this filtergraph
- HRESULT SetFiltergraph(
- [in] IGraphBuilder *pfg);
- // what filtergraph are you using?
- // *ppfg->Release() when you're done with it
- HRESULT GetFiltergraph(
- [out] IGraphBuilder **ppfg);
- // creates a rendering section in the filtergraph consisting of a MUX
- // of some filetype, and a file writer (and connects them together)
- // *ppf->Release() when you're done with it
- // *ppSink->Release() when you're done with it
- HRESULT SetOutputFileName(
- [in] const GUID *pType, // type of file to write, eg. MEDIASUBTYPE_Avi
- [in] LPCOLESTR lpstrFile, // filename given to file writer
- [out] IBaseFilter **ppf, // returns pointer to the MUX
- [out] IFileSinkFilter **ppSink);// queried from file writer
- // Looks for an interface on the filter and on the output pin of the given
- // category. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
- // NULL for "don't care".
- // It will also look upstream and downstream of
- // the pin for the interface, to find interfaces on renderers, MUXES, TV
- // Tuners, etc.
- // Call *ppint->Release() when you're done with it
- [local] HRESULT FindInterface(
- [in, unique] const GUID *pCategory, // can be NULL for all pins
- [in] IBaseFilter *pf,
- [in] REFIID riid,
- [out] void **ppint);
- [call_as(FindInterface)] HRESULT RemoteFindInterface(
- [in, unique] const GUID *pCategory, // can be NULL for all pins
- [in] IBaseFilter *pf,
- [in] REFIID riid,
- [out] IUnknown **ppint);
- // Connects the pin of the given category of the source filter to the
- // rendering filter, optionally through another filter (compressor?)
- // For a non-NULL category, it will instantiate and connect additional
- // required filters upstream too, like TV Tuners and Crossbars.
- // If there is only one output pin on the source, use a NULL
- // category. You can also have pSource be a pin
- HRESULT RenderStream(
- [in] const GUID *pCategory, // can be NULL if only one output pin
- [in] IUnknown *pSource, // filter or pin
- [in] IBaseFilter *pfCompressor,
- [in] IBaseFilter *pfRenderer); // can be NULL
- // Sends IAMStreamControl messages to the pin of the desired category, eg.
- // "capture" or "preview"
- // REFERENCE_TIME=NULL means NOW
- // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
- // NULL controls all capture filters in the graph - you will get one
- // notification for each filter with a pin of that category found
- // returns S_FALSE if stop will be signalled before last sample is
- // rendered.
- // return a FAILURE code if the filter does not support IAMStreamControl
- HRESULT ControlStream(
- [in] const GUID *pCategory,
- [in] IBaseFilter *pFilter,
- [in] REFERENCE_TIME *pstart,
- [in] REFERENCE_TIME *pstop,
- [in] WORD wStartCookie, // high word reserved
- [in] WORD wStopCookie); // high word reserved
- // creates a pre-allocated file of a given size in bytes
- HRESULT AllocCapFile(
- [in] LPCOLESTR lpstr,
- [in] DWORDLONG dwlSize);
- // Copies the valid file data out of the old, possibly huge old capture
- // file into a shorter new file.
- // Return S_FALSE from your progress function to abort capture, S_OK to
- // continue
- HRESULT CopyCaptureFile(
- [in] LPOLESTR lpwstrOld,
- [in] LPOLESTR lpwstrNew,
- [in] int fAllowEscAbort, // pressing ESC will abort?
- [in] IAMCopyCaptureFileProgress *pCallback); // implement this to
- // get progress
- }
- //
- // Capture graph builder "CopyCapturedFile" progress callback
- [
- object,
- uuid(670d1d20-a068-11d0-b3f0-00aa003761c5),
- pointer_default(unique)
- ]
- interface IAMCopyCaptureFileProgress : IUnknown {
- // If you support this interface somewhere, this function will be called
- // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing
- // to let you know the progress
- //
- // Return S_OK from this function to continue. Return S_FALSE to abort the
- // copy
- HRESULT Progress(
- [in] int iProgress); // a number between 0 and 100 (%)
- }
- //
- // Capture graph builder that can deal with a single filter having more than
- // one pin of each category... some new devices can capture both audio and
- // video, for example
- //
- [
- object,
- uuid(93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D),
- pointer_default(unique)
- ]
- interface ICaptureGraphBuilder2 : IUnknown {
- // Use this filtergraph
- HRESULT SetFiltergraph(
- [in] IGraphBuilder *pfg);
- // what filtergraph are you using?
- // *ppfg->Release() when you're done with it
- HRESULT GetFiltergraph(
- [out] IGraphBuilder **ppfg);
- // creates a rendering section in the filtergraph consisting of a MUX
- // of some filetype, and a file writer (and connects them together)
- // *ppf->Release() when you're done with it
- // *ppSink->Release() when you're done with it
- HRESULT SetOutputFileName(
- [in] const GUID *pType, // GUID of MUX filter to use
- [in] LPCOLESTR lpstrFile, // filename given to file writer
- [out] IBaseFilter **ppf, // returns pointer to the MUX
- [out] IFileSinkFilter **ppSink);// queried from file writer
- // Looks for an interface on the filter and on the output pin of the given
- // category and type. (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
- // NULL for "don't care". Type: MAJORTYPE_Video/Audio etc or NULL)
- // !!! Will some filters have >1 capture pin? ie RGB and MPEG?
- // It will also look upstream and downstream of
- // the pin for the interface, to find interfaces on renderers, MUXES, TV
- // Tuners, etc.
- // Call *ppint->Release() when you're done with it
- [local] HRESULT FindInterface(
- [in] const GUID *pCategory, // can be NULL for all pins
- [in] const GUID *pType, // Audio/Video/??? or NULL (don't care)
- [in] IBaseFilter *pf,
- [in] REFIID riid,
- [out] void **ppint);
- [call_as(FindInterface)] HRESULT RemoteFindInterface(
- [in] const GUID *pCategory, // can be NULL for all pins
- [in] const GUID *pType, // Audio/Video/??? or NULL (don't care)
- [in] IBaseFilter *pf,
- [in] REFIID riid,
- [out] IUnknown **ppint);
- // Connects the pin of the given category and type of the source filter to
- // the rendering filter, optionally through another filter (compressor?)
- // (Type is a Majortype, like Video or Audio)
- // For a non-NULL category, it will instantiate and connect additional
- // required filters upstream too, like TV Tuners and Crossbars.
- // If there is only one output pin on the source, use a NULL category
- // and type. You can also have pSource be a pin
- HRESULT RenderStream(
- [in] const GUID *pCategory, // can be NULL if only one output pin
- [in] const GUID *pType, // Major type (Video/Audio/etc)
- [in] IUnknown *pSource, // filter or pin
- [in] IBaseFilter *pfCompressor,
- [in] IBaseFilter *pfRenderer); // can be NULL
- // Sends IAMStreamControl messages to the pin of the desired category,
- // (eg. "capture" or "preview") and of the desired type (eg. VIDEO or AUDIO)
- // A category MUST be given. If a filter is given, a type must be too.
- // REFERENCE_TIME=NULL means NOW
- // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
- // NULL controls all capture filters in the graph - you will get one
- // notification for each filter with a pin of that category found
- // returns S_FALSE if stop will be signalled before last sample is
- // rendered.
- // return a FAILURE code if the filter does not support IAMStreamControl
- HRESULT ControlStream(
- [in] const GUID *pCategory,
- [in] const GUID *pType, // Major type (Video/Audio/etc)
- [in] IBaseFilter *pFilter,
- [in] REFERENCE_TIME *pstart,
- [in] REFERENCE_TIME *pstop,
- [in] WORD wStartCookie, // high word reserved
- [in] WORD wStopCookie); // high word reserved
- // creates a pre-allocated file of a given size in bytes
- HRESULT AllocCapFile(
- [in] LPCOLESTR lpstr,
- [in] DWORDLONG dwlSize);
- // Copies the valid file data out of the old, possibly huge old capture
- // file into a shorter new file.
- // Return S_FALSE from your progress function to abort capture, S_OK to
- // continue
- HRESULT CopyCaptureFile(
- [in] LPOLESTR lpwstrOld,
- [in] LPOLESTR lpwstrNew,
- [in] int fAllowEscAbort, // pressing ESC will abort?
- [in] IAMCopyCaptureFileProgress *pCallback); // implement this to
- // get progress
- // Helper fn to find a certain pin on a filter.
- HRESULT FindPin(
- [in] IUnknown *pSource,
- [in] PIN_DIRECTION pindir, // input or output?
- [in] const GUID *pCategory, // what category? (or NULL)
- [in] const GUID *pType, // what Major type (or NULL)
- [in] BOOL fUnconnected, // must it be unconnected?
- [in] int num, // which pin matching this? (0 based)
- [out] IPin **ppPin);
- }
- enum _AM_RENSDEREXFLAGS {
- AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers
- };
- //
- // IFilterGraph2
- //
- // New methods on for IFilterGraph and IGraphBuilder will have to go here.
- //
- [
- object,
- uuid(36b73882-c2c8-11cf-8b46-00805f6cef60),
- pointer_default(unique)
- ]
- interface IFilterGraph2: IGraphBuilder {
- // Add a Moniker source moniker
- HRESULT AddSourceFilterForMoniker(
- [in] IMoniker *pMoniker,
- [in] IBindCtx *pCtx,
- [in, unique] LPCWSTR lpcwstrFilterName,
- [out] IBaseFilter **ppFilter
- );
- // Specify the type for a reconnect
- // This is better than Reconnect as sometime the parties to a
- // reconnection can't remember what type they'd agreed (!)
- HRESULT ReconnectEx
- ( [in] IPin * ppin, // the pin to disconnect and reconnect
- [in, unique] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL
- );
- // Render a pin without adding any new renderers
- HRESULT RenderEx( [in] IPin *pPinOut, // Pin to render
- [in] DWORD dwFlags, // flags
- [in, out] DWORD *pvContext // Unused - set to NULL
- );
- #if 0
- // Method looks for a filter which supports the specified interface. If such
- // a filter exists, an AddRef()'ed pointer to the requested interface is placed
- // in *ppInterface.
- //
- // *ppInterface will be NULL on return if such a filter could not be found, and
- // the method will return E_NOINTERFACE.
- //
- // pdwIndex is an internal index that is used for obtaining subsequent interfaces.
- // *pdwIndex should be initialized to zero. It is set on return to a value that
- // allows the implementation of FindFilterInterface to search for further interfaces
- // if called again. If no more such interfaces exist, the method will return E_NOINTERFACE.
- //
- // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just
- // a single filter in the graph that supports the interface. Otherwise it returns
- // E_NOINTERFACE.
- //
- HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex );
- // Tries to obtain the interface from the filter graph itself. If this fails,
- // it attempts to find the unique filter that supports the interface.
- // On failure the method will return E_NOINTERFACE. On success, it returns
- // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface.
- //
- HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface );
- #endif
- }
- //
- // StreamBuilder
- // aka Graph building with constraints
- // aka convergent graphs
- // aka Closed captioning
- [
- object,
- local,
- uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IStreamBuilder : IUnknown {
- // Connect this output pin directly or indirectly, using transform filters
- // if necessary to thing(s) that will render it, within this graph
- // Move from Initial state to Rendered state.
- HRESULT Render
- ( [in] IPin * ppinOut, // the output pin
- [in] IGraphBuilder * pGraph // the graph
- );
- // Undo what you did in Render. Return to Initial state.
- HRESULT Backout
- ( [in] IPin * ppinOut, // the output pin
- [in] IGraphBuilder * pGraph // the graph
- );
- }
- // async reader interface - supported by file source filters. Allows
- // multiple overlapped reads from different positions
- [
- object,
- uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IAsyncReader : IUnknown
- {
- // pass in your preferred allocator and your preferred properties.
- // method returns the actual allocator to be used. Call GetProperties
- // on returned allocator to learn alignment and prefix etc chosen.
- // this allocator will be not be committed and decommitted by
- // the async reader, only by the consumer.
- // Must call this before calling Request.
- HRESULT RequestAllocator(
- [in] IMemAllocator* pPreferred,
- [in] ALLOCATOR_PROPERTIES* pProps,
- [out] IMemAllocator ** ppActual);
- // queue a request for data.
- // media sample start and stop times contain the requested absolute
- // byte position (start inclusive, stop exclusive).
- // may fail if sample not obtained from agreed allocator.
- // may fail if start/stop position does not match agreed alignment.
- // samples allocated from source pin's allocator may fail
- // GetPointer until after returning from WaitForNext.
- // Stop position must be aligned - this means it may exceed duration.
- // on completion, stop position will be corrected to unaligned
- // actual data.
- HRESULT Request(
- [in] IMediaSample* pSample,
- [in] DWORD_PTR dwUser); // user context
- // block until the next sample is completed or the timeout occurs.
- // timeout (millisecs) may be 0 or INFINITE. Samples may not
- // be delivered in order. If there is a read error of any sort, a
- // notification will already have been sent by the source filter,
- // and HRESULT will be an error.
- // If ppSample is not null, then a Request completed with the result
- // code returned.
- HRESULT WaitForNext(
- [in] DWORD dwTimeout,
- [out] IMediaSample** ppSample, // completed sample
- [out] DWORD_PTR * pdwUser); // user context
- // sync read of data. Sample passed in must have been acquired from
- // the agreed allocator. Start and stop position must be aligned.
- // equivalent to a Request/WaitForNext pair, but may avoid the
- // need for a thread on the source filter.
- HRESULT SyncReadAligned(
- [in] IMediaSample* pSample);
- // sync read. works in stopped state as well as run state.
- // need not be aligned. Will fail if read is beyond actual total
- // length.
- HRESULT SyncRead(
- [in] LONGLONG llPosition, // absolute file position
- [in] LONG lLength, // nr bytes required
- [out, size_is(lLength)]
- BYTE* pBuffer); // write data here
- // return total length of stream, and currently available length.
- // reads for beyond the available length but within the total length will
- // normally succeed but may block for a long period.
- HRESULT Length(
- [out] LONGLONG* pTotal,
- [out] LONGLONG* pAvailable);
- // cause all outstanding reads to return, possibly with a failure code
- //(VFW_E_TIMEOUT) indicating they were cancelled.
- // Between BeginFlush and EndFlush calls, Request calls will fail and
- // WaitForNext calls will always complete immediately.
- HRESULT BeginFlush(void);
- HRESULT EndFlush(void);
- }
- // interface provided by the filtergraph itself to let other objects
- // (especially plug-in distributors, but also apps like graphedt) know
- // when the graph has changed.
- [
- object,
- uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IGraphVersion : IUnknown
- {
- // returns the current graph version number
- // this is incremented every time there is a change in the
- // set of filters in the graph or in their connections
- //
- // if this is changed since your last enumeration, then re-enumerate
- // the graph
- HRESULT QueryVersion(LONG* pVersion);
- }
- //
- // interface describing an object that uses resources.
- //
- // implement if: you request resources using IResourceManager. You will
- // need to pass your implementation of this pointer as an in param.
- //
- // use if: you are a resource manager who implements IResourceManager
- [
- object,
- uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IResourceConsumer : IUnknown
- {
- // you may acquire the resource specified.
- // return values:
- // S_OK -- I have successfully acquired it
- // S_FALSE -- I will acquire it and call NotifyAcquire afterwards
- // VFW_S_NOT_NEEDED: I no longer need the resource
- // FAILED(hr)-I tried to acquire it and failed.
- HRESULT
- AcquireResource(
- [in] LONG idResource);
- // Please release the resource.
- // return values:
- // S_OK -- I have released it (and want it again when available)
- // S_FALSE -- I will call NotifyRelease when I have released it
- // other something went wrong.
- HRESULT
- ReleaseResource(
- [in] LONG idResource);
- }
- // interface describing a resource manager that will resolve contention for
- // named resources.
- //
- // implement if: you are a resource manager. The filtergraph will be a resource
- // manager, internally delegating to the system wide resource manager
- // (when there is one)
- //
- // use if: you need resources that are limited. Use the resource manager to
- // resolve contention by registering the resource with this interface,
- // and requesting it from this interface whenever needed.
- //
- // or use if: you detect focus changes which should affect resource usage.
- // Notifying change of focus to the resource manager will cause the resource
- // manager to switch contended resources to the objects that have the user's
- // focus
- [
- object,
- uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IResourceManager : IUnknown
- {
- // tell the manager how many there are of a resource.
- // ok if already registered. will take new count. if new count
- // is lower, will de-allocate resources to new count.
- //
- // You get back a token that will be used in further calls.
- //
- // Passing a count of 0 will eliminate this resource. There is currently
- // no defined way to find the id without knowing the count.
- //
- HRESULT
- Register(
- [in] LPCWSTR pName, // this named resource
- [in] LONG cResource, // has this many instances
- [out] LONG* plToken // token placed here on return
- );
- HRESULT
- RegisterGroup(
- [in] LPCWSTR pName, // this named resource group
- [in] LONG cResource, // has this many resources
- [in, size_is(cResource)]
- LONG* palTokens, // these are the contained resources
- [out] LONG* plToken // group resource id put here on return
- );
- // request the use of a given, registered resource.
- // possible return values:
- // S_OK == yes you can use it now
- // S_FALSE == you will be called back when the resource is available
- // other - there is an error.
- //
- // The priority of this request should be affected by the associated
- // focus object -- that is, when SetFocus is called for that focus
- // object (or a 'related' object) then my request should be put through.
- //
- // A filter should pass the filter's IUnknown here. The filtergraph
- // will match filters to the filtergraph, and will attempt to trace
- // filters to common source filters when checking focus objects.
- // The Focus object must be valid for the entire lifetime of the request
- // -- until you call CancelRequest or NotifyRelease(id, p, FALSE)
- HRESULT
- RequestResource(
- [in] LONG idResource,
- [in] IUnknown* pFocusObject,
- [in] IResourceConsumer* pConsumer
- );
- // notify the resource manager that an acquisition attempt completed.
- // Call this method after an AcquireResource method returned
- // S_FALSE to indicate asynchronous acquisition.
- // HR should be S_OK if the resource was successfully acquired, or a
- // failure code if the resource could not be acquired.
- HRESULT
- NotifyAcquire(
- [in] LONG idResource,
- [in] IResourceConsumer* pConsumer,
- [in] HRESULT hr);
- // Notify the resource manager that you have released a resource. Call
- // this in response to a ReleaseResource method, or when you have finished
- // with the resource. bStillWant should be TRUE if you still want the
- // resource when it is next available, or FALSE if you no longer want
- // the resource.
- HRESULT
- NotifyRelease(
- [in] LONG idResource,
- [in] IResourceConsumer* pConsumer,
- [in] BOOL bStillWant);
- // I don't currently have the resource, and I no longer need it.
- HRESULT
- CancelRequest(
- [in] LONG idResource,
- [in] IResourceConsumer* pConsumer);
- // Notify the resource manager that a given object has been given the
- // user's focus. In ActiveMovie, this will normally be a video renderer
- // whose window has received the focus. The filter graph will switch
- // contended resources to (in order):
- // requests made with this same focus object
- // requests whose focus object shares a common source with this
- // requests whose focus object shares a common filter graph
- // After calling this, you *must* call ReleaseFocus before the IUnknown
- // becomes invalid, unless you can guarantee that another SetFocus
- // of a different object is done in the meantime. No addref is held.
- //
- // The resource manager will hold this pointer until replaced or cancelled,
- // and will use it to resolve resource contention. It will call
- // QueryInterface for IBaseFilter at least and if found will call methods on
- // that interface.
- HRESULT
- SetFocus(
- [in] IUnknown* pFocusObject);
- // Sets the focus to NULL if the current focus object is still
- // pFocusObject. Call this when
- // the focus object is about to be destroyed to ensure that no-one is
- // still referencing the object.
- HRESULT
- ReleaseFocus(
- [in] IUnknown* pFocusObject);
- // !!! still need
- // -- app override (some form of SetPriority)
- // -- enumeration and description of resources
- }
- //
- // Interface representing an object that can be notified about state
- // and other changes within a filter graph. The filtergraph will call plug-in
- // distributors that expose this optional interface so that they can
- // respond to appropriate changes.
- //
- // Implement if: you are a plug-in distributor (your class id is found
- // under HKCRInterface<IID>Distributor= for some interface).
- //
- // Use if: you are the filtergraph.
- [
- object,
- uuid(56a868af-0ad4-11ce-b03a-0020af0ba770),
- pointer_default(unique)
- ]
- interface IDistributorNotify : IUnknown
- {
- // called when graph is entering stop state. Called before
- // filters are stopped.
- HRESULT Stop(void);
- // called when graph is entering paused state, before filters are
- // notified
- HRESULT Pause(void);
- // called when graph is entering running state, before filters are
- // notified. tStart is the stream-time offset parameter that will be
- // given to each filter's IBaseFilter::Run method.
- HRESULT Run(REFERENCE_TIME tStart);
- // called when the graph's clock is changing, with the new clock. Addref
- // the clock if you hold it beyond this method. Called before
- // the filters are notified.
- HRESULT SetSyncSource(
- [in] IReferenceClock * pClock);
- // called when the set of filters or their connections has changed.
- // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything
- // that will lead to one of these).
- // You don't need to rebuild your list of interesting filters at this point
- // but you should release any refcounts you hold on any filters that
- // have been removed.
- HRESULT NotifyGraphChange(void);
- }
- typedef enum {
- AM_STREAM_INFO_START_DEFINED = 0x00000001,
- AM_STREAM_INFO_STOP_DEFINED = 0x00000002,
- AM_STREAM_INFO_DISCARDING = 0x00000004,
- AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010
- } AM_STREAM_INFO_FLAGS;
- // Stream information
- typedef struct {
- REFERENCE_TIME tStart;
- REFERENCE_TIME tStop;
- DWORD dwStartCookie;
- DWORD dwStopCookie;
- DWORD dwFlags;
- } AM_STREAM_INFO;
- //
- // IAMStreamControl
- //
- [
- object,
- uuid(36b73881-c2c8-11cf-8b46-00805f6cef60),
- pointer_default(unique)
- ]
- interface IAMStreamControl : IUnknown
- {
- // The REFERENCE_TIME pointers may be null, which
- // indicates immediately. If the pointer is non-NULL
- // and dwCookie is non-zero, then pins should send
- // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED
- // with an IPin pointer and the cookie, thus allowing
- // apps to tie the events back to their requests.
- // If either dwCookies is zero, or the pointer is null,
- // then no event is sent.
- // If you have a capture pin hooked up to a MUX input pin and they
- // both support IAMStreamControl, you'll want the MUX to signal the
- // stop so you know the last frame was written out. In order for the
- // MUX to know it's finished, the capture pin will have to send one
- // extra sample after it was supposed to stop, so the MUX can trigger
- // off that. So you would set bSendExtra to TRUE for the capture pin
- // Leave it FALSE in all other cases.
- HRESULT StartAt( [in] const REFERENCE_TIME * ptStart,
- [in] DWORD dwCookie );
- HRESULT StopAt( [in] const REFERENCE_TIME * ptStop,
- [in] BOOL bSendExtra,
- [in] DWORD dwCookie );
- HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo);
- }
- //
- // ISeekingPassThru
- //
- [
- object,
- uuid(36b73883-c2c8-11cf-8b46-00805f6cef60),
- pointer_default(unique)
- ]
- interface ISeekingPassThru : IUnknown
- {
- HRESULT Init( [in] BOOL bSupportRendering,
- [in] IPin *pPin);
- }
- //
- // IAMStreamConfig - pin interface
- //
- // A capture filter or compression filter's output pin
- // supports this interface - no matter what data type you produce.
- // This interface can be used to set the output format of a pin (as an
- // alternative to connecting the pin using a specific media type).
- // After setting an output format, the pin will use that format
- // the next time it connects to somebody, so you can just Render that
- // pin and get a desired format without using Connect(CMediaType)
- // Your pin should do that by ONLY OFFERING the media type set in SetFormat
- // in its enumeration of media types, and no others. This will ensure that
- // that format is indeed used for connection (or at least offer it first).
- // An application interested in enumerating accepted mediatypes may have to
- // do so BEFORE calling SetFormat.
- // But this interface's GetStreamCaps function can get more information
- // about accepted media types than the traditional way of enumerating a pin's
- // media types, so it should typically be used instead.
- // GetStreamCaps gets information about the kinds of formats allowed... how
- // it can stretch and crop, and the frame rate and data rates allowed (for
- // video)
- // VIDEO EXAMPLE
- //
- // GetStreamCaps returns a whole array of {MediaType, Capabilities}.
- // Let's say your capture card supports JPEG anywhere between 160x120 and
- // 320x240, and also the size 640x480. Also, say it supports RGB24 at
- // resolutions between 160x120 and 320x240 but only multiples of 8. You would
- // expose these properties by offering a media type of 320 x 240 JPEG
- // (if that is your default or preferred size) coupled with
- // capabilities saying minimum 160x120 and maximum 320x240 with granularity of
- // 1. The next pair you expose is a media type of 640x480 JPEG coupled with
- // capabilities of min 640x480 max 640x480. The third pair is media type
- // 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8.
- // In this way you can expose almost every quirk your card might have.
- // An application interested in knowing what compression formats you provide
- // can get all the pairs and make a list of all the unique sub types of the
- // media types.
- //
- // If a filter's output pin is connected with a media type that has rcSource
- // and rcTarget not empty, it means the filter is being asked to stretch the
- // rcSource sub-rectangle of its InputSize (the format of the input pin for
- // a compressor, and the largest bitmap a capture filter can generate with
- // every pixel unique) into the rcTarget sub-rectangle of its output format.
- // For instance, if a video compressor has as input 160x120 RGB, and as output
- // 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100)
- // this means the compressor is being asked to take a 10x10 piece of the 160x120
- // RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap,
- // leaving the rest of the 320x240 bitmap untouched.
- // A filter does not have to support this and can fail to connect with a
- // media type where rcSource and rcTarget are not empty.
- //
- // Your output pin is connected to the next filter with a certain media
- // type (either directly or using the media type passed by SetFormat),
- // and you need to look at the AvgBytesPerSecond field of the format
- // of that mediatype to see what data rate you are being asked to compress
- // the video to, and use that data rate. Using the number of frames per
- // second in AvgTimePerFrame, you can figure out how many bytes each frame
- // is supposed to be. You can make it smaller, but NEVER EVER make a bigger
- // data rate. For a video compressor, your input pin's media type tells you
- // the frame rate (use that AvgTimePerFrame). For a capture filter, the
- // output media type tells you, so use that AvgTimePerFrame.
- //
- // The cropping rectangle described below is the same as the rcSrc of the
- // output pin's media type.
- //
- // The output rectangle described below is the same of the width and height
- // of the BITMAPINFOHEADER of the media type of the output pin's media type
- // AUDIO EXAMPLE
- //
- // This API can return an array of pairs of (media type, capabilities).
- // This can be used to expose all kinds of wierd capabilities. Let's say you
- // do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or
- // stereo, and you also do 48,000 16bit stereo as a special combination.
- // You would expose 3 pairs. The first pair would have Min Freq of 11025 and
- // Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the
- // capabilites structure, and a media type of anything you like, maybe
- // 22kHz, 8bit stereo as a default.
- // The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in
- // the capabilities structure and the media type could be something like
- // 44kHz, 16bit stereo as a default (the media type in the pair should always
- // be something legal as described by the capabilities structure... the
- // structure tells you how you can change the media type to produce other
- // legal media types... for instance changing 44kHz to 29010Hz would be legal,
- // but changing bits from 16 to 14 would not be.)
- // The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2
- // MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo.
- // You can also use the Granularity elements of the structure (like the example
- // for video) if you support values that multiples of n, eg. you could say
- // minimum bits per sample 8, max 16, and granularity 8 to describe doing
- // either 8 or 16 bit all in one structure
- //
- // If you support non-PCM formats, the media type returned in GetStreamCaps
- // can show which non-PCM formats you support (with a default sample rate,
- // bit rate and channels) and the capabilities structure going with that
- // media type can describe which other sample rates, bit rates and channels
- // you support.
- [
- object,
- uuid(C6E13340-30AC-11d0-A18C-00A0C9118956),
- pointer_default(unique)
- ]
- interface IAMStreamConfig : IUnknown
- {
- // this is the structure returned by a VIDEO filter
- //
- typedef struct _VIDEO_STREAM_CONFIG_CAPS {
- GUID guid; // will be MEDIATYPE_Video
- // the logical or of all the AnalogVideoStandard's supported
- // typically zero if not supported
- ULONG VideoStandard;
- // the inherent size of the incoming signal... taken from the input
- // pin for a compressor, or the largest size a capture filter can
- // digitize the signal with every pixel still unique
- SIZE InputSize;
- // The input of a compressor filter may have to be connected for these
- // to be known
- // smallest rcSrc cropping rect allowed
- SIZE MinCroppingSize;
- // largest rcSrc cropping rect allowed
- SIZE MaxCroppingSize;
- // granularity of cropping size - eg only widths a multiple of 4 allowed
- int CropGranularityX;
- int CropGranularityY;
- // alignment of cropping rect - eg rect must start on multiple of 4
- int CropAlignX;
- int CropAlignY;
- // The input of a compressor filter may have to be connected for these
- // to be known
- // smallest bitmap this pin can produce
- SIZE MinOutputSize;
- // largest bitmap this pin can produce
- SIZE MaxOutputSize;
- // granularity of output bitmap size
- int OutputGranularityX;
- int OutputGranularityY;
- // !!! what about alignment of rcTarget inside BIH if different?
- // how well can you stretch in the x direction? 0==not at all
- // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
- // etc.
- int StretchTapsX;
- int StretchTapsY;
- // how well can you shrink in the x direction? 0==not at all
- // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
- // etc.
- int ShrinkTapsX;
- int ShrinkTapsY;
- // CAPTURE filter only - what frame rates are allowed?
- LONGLONG MinFrameInterval;
- LONGLONG MaxFrameInterval;
- // what data rates can this pin produce?
- LONG MinBitsPerSecond;
- LONG MaxBitsPerSecond;
- } VIDEO_STREAM_CONFIG_CAPS;
- // this is the structure returned by an AUDIO filter
- //
- typedef struct _AUDIO_STREAM_CONFIG_CAPS {
- GUID guid; // will be MEDIATYPE_Audio
- ULONG MinimumChannels;
- ULONG MaximumChannels;
- ULONG ChannelsGranularity;
- ULONG MinimumBitsPerSample;
- ULONG MaximumBitsPerSample;
- ULONG BitsPerSampleGranularity;
- ULONG MinimumSampleFrequency;
- ULONG MaximumSampleFrequency;
- ULONG SampleFrequencyGranularity;
- } AUDIO_STREAM_CONFIG_CAPS;
- // - only allowed when pin is not streaming, else the call will FAIL
- // - If your output pin is not yet connected, and you can
- // connect your output pin with this media type, you should
- // succeed the call, and start offering it first (enumerate as format#0)
- // from GetMediaType so that this format will be used to connect with
- // when you do connect to somebody
- // - if your output pin is already connected, and you can provide this
- // type, reconnect your pin. If the other pin can't accept it, FAIL
- // this call and leave your connection alone.
- HRESULT SetFormat(
- [in] AM_MEDIA_TYPE *pmt);
- // the format it's connected with, or will connect with
- // the application is responsible for calling DeleteMediaType(*ppmt);
- HRESULT GetFormat(
- [out] AM_MEDIA_TYPE **ppmt);
- // how many different Stream Caps structures are there?
- // also, how big is the stream caps structure?
- HRESULT GetNumberOfCapabilities(
- [out] int *piCount,
- [out] int *piSize); // pSCC of GetStreamCaps needs to be this big
- // - gets one of the pairs of {Mediatype, Caps}
- // - return S_FALSE if iIndex is too high
- // - the application is responsible for calling DeleteMediaType(*ppmt);
- // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video
- // or MEDIATYPE_Audio, so you can tell if you have a pointer to a
- // VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure
- // There could potentially be many more possibilities other than video
- // or audio.
- HRESULT GetStreamCaps(
- [in] int iIndex, // 0 to #caps-1
- [out] AM_MEDIA_TYPE **ppmt,
- [out] BYTE *pSCC);
- }
- // Interface to control interleaving of different streams in one file
- [
- object,
- uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86),
- pointer_default(unique)
- ]
- interface IConfigInterleaving : IUnknown
- {
- import "unknwn.idl";
- typedef enum
- {
- // uninterleaved - samples written out in the order they
- // arrive
- INTERLEAVE_NONE,
- // approximate interleaving with less overhead for video
- // capture
- INTERLEAVE_CAPTURE,
- // full, precise interleaving. slower.
- INTERLEAVE_FULL
- } InterleavingMode;
- HRESULT put_Mode(
- [in] InterleavingMode mode
- );
- HRESULT get_Mode(
- [out] InterleavingMode *pMode
- );
- HRESULT put_Interleaving(
- [in] const REFERENCE_TIME *prtInterleave,
- [in] const REFERENCE_TIME *prtPreroll
- );
- HRESULT get_Interleaving(
- [out] REFERENCE_TIME *prtInterleave,
- [out] REFERENCE_TIME *prtPreroll
- );
- }
- // Interface to control the AVI mux
- [
- object,
- uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6),
- pointer_default(unique)
- ]
- interface IConfigAviMux : IUnknown
- {
- import "unknwn.idl";
- // control whether the AVI mux adjusts the frame rate or audio
- // sampling rate for drift when the file is closed. -1 to disables
- // this behavior.
- HRESULT SetMasterStream([in] LONG iStream);
- HRESULT GetMasterStream([out] LONG *pStream);
- // control whether the AVI mux writes out an idx1 index chunk for
- // compatibility with older AVI players.
- HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex);
- HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex);
- }
- //---------------------------------------------------------------------
- // CompressionCaps enum
- //---------------------------------------------------------------------
- // This tells you which features of IAMVideoCompression are supported
- // CanCrunch means that it can compress video to a specified data rate
- // If so, then the output pin's media type will contain that data rate
- // in the format's AvgBytesPerSecond field, and that should be used.
- typedef enum
- {
- CompressionCaps_CanQuality = 0x01,
- CompressionCaps_CanCrunch = 0x02,
- CompressionCaps_CanKeyFrame = 0x04,
- CompressionCaps_CanBFrame = 0x08,
- CompressionCaps_CanWindow = 0x10
- } CompressionCaps;
- //---------------------------------------------------------------------
- // IAMVideoCompression interface
- //
- // Control compression parameters - pin interface
- //---------------------------------------------------------------------
- // This interface is implemented by the output pin of a video capture
- // filter or video compressor that provides video data
- // You use this interface to control how video is compressed... how
- // many keyframes, etc., and to find information like capabilities and
- // the description of this compressor
- [
- object,
- uuid(C6E13343-30AC-11d0-A18C-00A0C9118956),
- pointer_default(unique)
- ]
- interface IAMVideoCompression : IUnknown
- {
- // - Only valid if GetInfo's pCapabilities sets
- // CompressionCaps_CanKeyFrame
- // - KeyFrameRate < 0 means use the compressor default
- // - KeyFrames == 0 means only the first frame is a key
- HRESULT put_KeyFrameRate (
- [in] long KeyFrameRate);
- HRESULT get_KeyFrameRate (
- [out] long * pKeyFrameRate);
- // - Only valid if GetInfo's pCapabilities sets
- // CompressionCaps_CanBFrame
- // - If keyframes are every 10, and there are 3 P Frames per key,
- // they will be spaced evenly between the key frames and the other
- // 6 frames will be B frames
- // - PFramesPerKeyFrame < 0 means use the compressor default
- HRESULT put_PFramesPerKeyFrame (
- [in] long PFramesPerKeyFrame);
- HRESULT get_PFramesPerKeyFrame (
- [out] long * pPFramesPerKeyFrame);
- // - Only valid if GetInfo's pCapabilities sets
- // CompressionCaps_CanQuality
- // - Controls image quality
- // - If you are compressing to a fixed data rate, a high quality
- // means try and use all of the data rate, and a low quality means
- // feel free to use much lower than the data rate if you want to.
- // - Quality < 0 means use the compressor default
- HRESULT put_Quality (
- [in] double Quality);
- HRESULT get_Quality (
- [out] double * pQuality);
- // If you have set a data rate of 100K/sec on a 10fps movie, that
- // will normally mean each frame must be <=10K. But a window size
- // means every consecutive n frames must average to the data rate,
- // but an individual frame (if n > 1) is allowed to exceed the
- // frame size suggested by the data rate
- HRESULT put_WindowSize (
- [in] DWORDLONG WindowSize);
- HRESULT get_WindowSize (
- [out] DWORDLONG * pWindowSize);
- // - pszVersion might be "Version 2.1.0"
- // - pszDescription might be "Danny's awesome video compressor"
- // - pcbVersion and pcbDescription will be filled in with the
- // required length if they are too short
- // - *pCapabilities is a logical OR of some CompressionCaps flags
- HRESULT GetInfo(
- [out, size_is(*pcbVersion)] WCHAR * pszVersion,
- [in,out] int *pcbVersion,
- [out, size_is(*pcbDescription)] LPWSTR pszDescription,
- [in,out] int *pcbDescription,
- [out] long *pDefaultKeyFrameRate,
- [out] long *pDefaultPFramesPerKey,
- [out] double *pDefaultQuality,
- [out] long *pCapabilities //CompressionCaps
- );
- // - this means when this frame number comes along after the graph
- // is running, make it a keyframe even if you weren't going to
- HRESULT OverrideKeyFrame(
- [in] long FrameNumber
- );
- // - Only valid if GetInfo's pCapabilities sets
- // CompressionCaps_CanCrunch
- // - this means when this frame number comes along after the graph
- // is running, make it this many bytes big instead of whatever size
- // you were going to make it.
- HRESULT OverrideFrameSize(
- [in] long FrameNumber,
- [in] long Size
- );
- }
- //---------------------------------------------------------------------
- // VfwCaptureDialogs enum
- //---------------------------------------------------------------------
- typedef enum
- {
- VfwCaptureDialog_Source = 0x01,
- VfwCaptureDialog_Format = 0x02,
- VfwCaptureDialog_Display = 0x04
- } VfwCaptureDialogs;
- //---------------------------------------------------------------------
- // VfwCompressDialogs enum
- //---------------------------------------------------------------------
- typedef enum
- {
- VfwCompressDialog_Config = 0x01,
- VfwCompressDialog_About = 0x02,
- // returns S_OK if the dialog exists and can be shown, else S_FALSE
- VfwCompressDialog_QueryConfig = 0x04,
- VfwCompressDialog_QueryAbout = 0x08
- } VfwCompressDialogs;
- //---------------------------------------------------------------------
- // IAMVfwCaptureDialogs - filter interface
- //
- // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY
- //---------------------------------------------------------------------
- // This interface is supported only by Microsoft's Video For Windows
- // capture driver Capture Filter. It allows an application to bring up
- // one of the 3 driver dialogs that VfW capture drivers have.
- [
- object,
- local,
- uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5),
- pointer_default(unique)
- ]
- interface IAMVfwCaptureDialogs : IUnknown
- {
- HRESULT HasDialog(
- [in] int iDialog // VfwCaptureDialogs enum
- );
- HRESULT ShowDialog(
- [in] int iDialog, // VfwCaptureDialogs enum
- [in] HWND hwnd
- );
- HRESULT SendDriverMessage(
- [in] int iDialog, // VfwCaptureDialogs enum
- [in] int uMsg,
- [in] long dw1,
- [in] long dw2
- );
- // - iDialog can be one of the VfwCaptureDialogs enums
- // - HasDialog returns S_OK if it has the dialog, else S_FALSE
- // - ShowDialog can only be called when not streaming or when another
- // dialog is not already up
- // - SendDriverMessage can send a secret message to the capture driver.
- // USE IT AT YOUR OWN RISK!
- }
- //---------------------------------------------------------------------
- // IAMVfwCompressDialogs - filter interface
- //
- // Show a VfW codec driver dialog - CONFIG or ABOUT
- //---------------------------------------------------------------------
- // This interface is supported only by Microsoft's ICM Compressor filter
- // (Co). It allows an application to bring up either the Configure or
- // About dialogs for the ICM codec that it is currently using.
- [
- object,
- local,
- uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5),
- pointer_default(unique)
- ]
- interface IAMVfwCompressDialogs : IUnknown
- {
- // Bring up a dialog for this codec
- HRESULT ShowDialog(
- [in] int iDialog, // VfwCompressDialogs enum
- [in] HWND hwnd
- );
- // Calls ICGetState and gives you the result
- HRESULT GetState(
- [out, size_is(*pcbState)] LPVOID pState,
- [in, out] int *pcbState
- );
- // Calls ICSetState
- HRESULT SetState(
- [in, size_is(cbState)] LPVOID pState,
- [in] int cbState
- );
- // Send a codec specific message
- HRESULT SendDriverMessage(
- [in] int uMsg,
- [in] long dw1,
- [in] long dw2
- );
- // - iDialog can be one of the VfwCaptureDialogs enums
- // - ShowDialog can only be called when not streaming or when no other
- // dialog is up already
- // - an application can call GetState after ShowDialog(CONFIG) to
- // see how the compressor was configured and next time the graph
- // is used, it can call SetState with the data it saved to return
- // the codec to the state configured by the dialog box from last time
- // - GetState with a NULL pointer returns the size needed
- // - SendDriverMessage can send a secret message to the codec.
- // USE IT AT YOUR OWN RISK!
- }
- //---------------------------------------------------------------------
- // IAMDroppedFrames interface
- //
- // Report status of capture - pin interface
- //---------------------------------------------------------------------
- // A capture filter's video output pin supports this. It reports
- // how many frames were not sent (dropped), etc.
- // Every time your filter goes from STOPPED-->PAUSED, you reset all your
- // counts to zero.
- // An app may call this all the time while you are capturing to see how
- // capturing is going. MAKE SURE you always return as current information
- // as possible while you are running.
- // When your capture filter starts running, it starts by sending frame 0,
- // then 1, 2, 3, etc. The time stamp of each frame sent should correspond
- // to the graph clock's time when the image was digitized. The end time
- // is the start time plus the duration of the video frame.
- // You should also set the MediaTime of each sample (SetMediaTime) as well.
- // This should be the frame number ie (0,1) (1,2) (2,3).
- // If a frame is dropped, a downstream filter will be able to tell easily
- // not by looking for gaps in the regular time stamps, but by noticing a
- // frame number is missing (eg. (1,2) (2,3) (4,5) (5,6) means frame 3
- // was dropped.
- // Using the info provided by this interface, an application can figure out
- // the number of frames dropped, the frame rate achieved (the length of
- // time the graph was running divided by the number of frames not dropped),
- // and the data rate acheived (the length of time the graph was running
- // divided by the average frame size).
- // If your filter is running, then paused, and then run again, you need
- // to continue to deliver frames as if it was never paused. The first
- // frame after the second RUN cannot be time stamped earlier than the last
- // frame sent before the pause.
- // Your filter must always increment the MediaTime of each sample sent.
- // Never send the same frame # twice, and never go back in time. The
- // regular time stamp of a sample can also never go back in time.
- [
- object,
- uuid(C6E13344-30AC-11d0-A18C-00A0C9118956),
- pointer_default(unique)
- ]
- interface IAMDroppedFrames : IUnknown
- {
- // Get the number of dropped frames
- HRESULT GetNumDropped(
- [out] long * plDropped
- );
- //Get the number of non-dropped frames
- HRESULT GetNumNotDropped(
- [out] long * plNotDropped
- );
- // - plArray points to an array of lSize longs. The filter will
- // fill it with the frame number of the first lSize frames dropped.
- // A filter may not have bothered to remember as many as you asked
- // for, so it will set *plNumCopied to the number of frames it filled
- // in.
- HRESULT GetDroppedInfo(
- [in] long lSize,
- [out] long * plArray,
- [out] long * plNumCopied
- );
- // - This is the average size of the frames it didn't drop (in bytes)
- HRESULT GetAverageFrameSize(
- [out] long * plAverageSize
- );
- }
- cpp_quote("#define AMF_AUTOMATICGAIN -1.0")
- //---------------------------------------------------------------------
- // IAMAudioInputMixer interface
- //
- // Sets the recording levels, pan and EQ for the audio card inputs
- //---------------------------------------------------------------------
- // This interface is implemented by each input pin of an audio capture
- // filter, to tell it what level, panning, and EQ to use for each input.
- // The name of each pin will reflect the type of input, eg. "Line input 1"
- // or "Mic". An application uses the pin names to decide how it wants to
- // set the recording levels
- // This interface can also be supported by the audio capture filter itself
- // to control to overall record level and panning after the mix
- [
- object,
- uuid(54C39221-8380-11d0-B3F0-00AA003761C5),
- pointer_default(unique)
- ]
- interface IAMAudioInputMixer : IUnknown
- {
- // This interface is only supported by the input pins, not the filter
- // If disabled, this channel will not be mixed in as part of the
- // recorded signal.
- HRESULT put_Enable (
- [in] BOOL fEnable); // TRUE=enable FALSE=disable
- //Is this channel enabled?
- HRESULT get_Enable (
- [out] BOOL *pfEnable);
- // When set to mono mode, making a stereo recording of this channel
- // will have both channels contain the same data... a mixture of the
- // left and right signals
- HRESULT put_Mono (
- [in] BOOL fMono); // TRUE=mono FALSE=multi channel
- //all channels combined into a mono signal?
- HRESULT get_Mono (
- [out] BOOL *pfMono);
- // !!! WILL CARDS BE ABLE TO BOOST THE GAIN?
- //Set the record level for this channel
- HRESULT put_MixLevel (
- [in] double Level); // 0 = off, 1 = full (unity?) volume
- // AMF_AUTOMATICGAIN, if supported,
- // means automatic
- //Get the record level for this channel
- HRESULT get_MixLevel (
- [out] double *pLevel);
- // For instance, when panned full left, and you make a stereo recording
- // of this channel, you will record a silent right channel.
- HRESULT put_Pan (
- [in] double Pan); // -1 = full left, 0 = centre, 1 = right