The Addon Interfaces Library provides a framework for developing standard interfaces. Interfaces are used to build extendibility into an application without rewriting and redeploying it. For example, the multimedia renderer utility (mm-renderer) implements standard addon interfaces. This means that you can use this utility to write a video playback application that handles new video formats as they become available, simply by adding a new filter or set of filters for the new format.
The library uses two structures to manage interfaces: AOInterface_t, which represents an interface, and AOICtrl_t, which represents an addon interface (AOI) control for one or more interfaces. Typically, addon code (including the interface(s) and control) is contained in a DLL and is dynamically loaded by an application.
Each time an application requires an interface, it should hold the addon control containing the interface to prevent the addon from being unloaded while still in use. At this point, the addon control is loaded into memory and its hold count is incremented. An addon control may be unloaded when there are no more holds on it.
AOI Structures
Structure | Description |
---|---|
AOICtrl_t | A structure that defines an interface control. |
AOInterface_t | A structure that defines an interface. |
AOI Functions
Function | Description |
---|---|
AoAdd() | Add the interfaces contained in a DLL to the global list of interfaces. |
AoAddStatic() | Add a static list of interfaces to the global list of interfaces. |
AoAddDirectory() | Add the interfaces contained in all DLLs in a directory to the global list of interfaces. |
AoRemove() | Remove a control from the global list of interfaces. |
AoHold() | Hold a control; ensure it's loaded if necessary. |
AoRelease() | Release a control; unload it if necessary. |
AoGetInterface() | Get a specific interface for a control. |
AoIterate() | Iterate through the global list of controls and return the one that meets some criteria. |
AoIterateHoldGet() | Iterate through the global list of controls to find a control that meets some criteria, hold, and then return the control. |
AoAddUnloadSignal() | Add a signal handler to an application to unload an addon on. |
Additional interface-specific functions:
Element | Description |
---|---|
AoFindExt() | Find a control with a AOExtInspector interface, and which is best suited for a specific file extension. |
AoFindFormats() | Find a control with the best rating for a specific media format. |
AoFindMime() | Find a control with the best rating for a mimetype. |
AoFindName() | Find a control by its Name interface. |
AoFindStreams() | Find a control with the best rating for a specific stream. |
AoOpenFileSpec() | Find the first control that can open a filespec in a given mode. |