📄 axextend.idl
字号:
[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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -