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