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