Updated: October 28, 2024 |
Generate Addon Interface (AOI) configuration files
aoiconftool [ -c config_file | -d directory [-p pattern] ] [-e] [-H] [-R] [ -h addon ] [ -r addon ] [ -i interface ]* [ -o output_file ] [ -q[q...] | -v[v...] ] [ dllname1[ dllname2...] ]
QNX Neutrino
You must specify at least one of the -c or -d options or provide a list of DLL names (dllname1...) so the configuration has something to load.
If config_file doesn't start with a slash, it's treated as the base name for the file. For instance, a value of mmf makes the utility look for a file named mmf.conf in the configuration directory. If no matching file is found, the default file is loaded. If the value starts with a slash (/), it's treated as an absolute path and if the utility can't find that exact file, no default file is loaded. For more details, see Names and location of configuration files.
You must specify at least one of the -d or -c options or provide a list of DLL names (dllname1...) so the configuration has something to load.
If you set the -e option, you can create a configuration that has non-zero hold counts for DLLs that you suspect should stay in memory, but also ensure their cache summaries are saved. This is handy if you want to manually change some hold counts to zero in the configuration file to see how this affects performance.
If you don't provide this option, the configuration will be validated, with the results written to the system log, but not saved.
This option is considered only if -d is defined.
For information on how addons can define their own names, see the Name interface reference in the Addon Interfaces Library Reference. You can provide as many -r options as you like.
You must provide this list if you don't define either of the -c or -d options.
The aoiconftool utility generates Addon Interface (AOI) configuration files. These files tell the AOI library which DLLs to load and which configuration settings to apply to them. When an application wants to use certain addon features, it uses this library to load the appropriate configuration files. For more details, see the Addon Interfaces Library Reference.
You can run the utility without naming an output file, just to validate a possible configuration. In this case, aoiconftool attempts to load and configure the DLLs as indicated by the command line, and logs the outcome of these actions, allowing you to see if the configuration is valid for your system.
When loading a configuration through the AOI library, an application can provide the base name (i.e., a filename without a path or extension) of a configuration file to use, or use the default file. Typically, the base name reflects the functionality that the configuration is designed to support. For example, an application using the Metadata Provider library would request a base name of libmd. AOI configuration files end with the .conf extension, so in this case, the base name maps to a file named libmd.conf.
If the AOI library can't find the requested file, it loads the default file of default.conf. This design allows an application developer to define their own base name and the system integrator to decide whether to provide a customized file with that name or let the application use the default file. By default, the library looks for configuration files in /etc/system/config/aoi, but this path can be overriden with the AOI_CONFIG environment variable, which further increases flexibility for using custom files.
Note that applications can override any system setup by loading a configuration file at a specific path; for details, see the AoLoadConfig() entry in the Addon Interfaces Library Reference.
The AOI library maintains a global list of interfaces and updates this list when a configuration is loaded, based on the interfaces in the DLLs included by that configuration. Different application components can use different configurations but they all share the global list. The same DLL can be included in multiple configurations but its settings must be the same in each; otherwise, it's an error.
The library also keeps track of how many configurations have included a DLL and of the DLL's hold counter. When an application component unloads a configuration, the library decrements the hold counters and removes any interfaces from the list as necessary.
Tokens can be separated by whitespace and comments. For whitespace, spaces and newlines can be used. If a keyword follows an integer, they must be separated by whitespace or a comment. Apart from that, whitespace outside of strings is not significant. For comments, a number sign (#) starts a comment (unless the character is embedded in a string) and the next newline ends it.
Each configuration file section or subsection is essentially a field setting that affects the AOI library's global list of interfaces and loaded DLLs. Often, this setting is just one line of text. Files are parsed from beginning to end, so the order of the sections is significant.
GlobalHolds
globalholds = integer
This setting increments the global hold counter by the provided value. Because no application should decrement the counter without having incremented it first, defining a non-zero value in this section ensures that any DLLs subsequently loaded into memory will stay in memory forever, or at least until this configuration is unloaded.
Dir
dir = string
Setting this field adds the interfaces in the DLLs found in the specified directory to the global list of interfaces. The AOI library will scan the directory and try to load every DLL it finds there. If the DLL's interfaces aren't already in the list, the DLL gets loaded, a summary of its interfaces is extracted and added to the global list, and then it gets unloaded if the global hold counter is zero.
DLL
dll = string [subsection]...
Setting the dll field adds the interfaces in the specified DLL to the global list of interfaces. The dll section can have subsections. Depending on which subsections are present, the DLL may or may not get loaded into memory, and then either get unloaded or be kept in memory.
config = string [string ...]
This field setting defines the configuration strings for the addon DLL. At least one string must be present. Each string is treated as a configuration setting. If it contains an equal sign (=), then the part before the first such character is treated as the name of the setting, and the part after as the value. If there's no such character, the entire string is the name.
What names and values are valid and what they mean is specific to the DLL. The DLL can also declare the type of a setting, as a string, numeric (integer or floating point), or boolean. Numeric settings must contain the equal sign and a valid numeric value, acceptable to strtoll() or strtof(). Boolean settings must be set to 0 or 1 or have no value at all (e.g., "EnableX=0", "EnableX=1", or "EnableX"). String settings without an equal sign are interpreted as empty strings (e.g., "Name=" and "Name" are equivalent).
holds = integer
This field lets you increment the hold counter for the DLL by the provided value. When this counter is non-zero, this ensures that the DLL is kept in memory.
cache = string ...
This field contains strings that are generated by aoiconftool; they can't be written manually. The strings store information about the DLL's interfaces that's normally kept by the AOI library when the DLL is not in memory. For aoiconftool, reading the cache contents is much faster than loading DLLs just to extract information.
# aoiconftool -d $MM_INIT -R -o /etc/system/config/aoi/default.confThis is more efficient than loading all of the DLLs at startup and keeping them in memory because applications can query the AOI library to examine the available interfaces and load only those that they want to use (e.g., because they're the highest rated for specific media operations).
In the example above, the generated configuration is written to the default file at the default location (/etc/system/config/aoi/default.conf).
You can modify any generated configuration file with a text editor. For any addon that has configuration settings, you'll find these settings listed with their default values and short descriptions. You can modify the configuration values, and change the holds parameter from 0 to 1 for any DLL that you want kept in memory rather than loaded and unloaded on demand.
# aoiconftool -c default -o default.conf
The cache information from the old file is discarded, and new information is created based on the DLLs present on the target system. Any configuration settings are copied from the old to the new file, with unchanged values but updated descriptions. If a DLL's new version has configuration settings that the old version does not, these are added to the new file with default values. If some settings in the old file have become invalid in the new DLL version, the operation fails and you need to correct the settings manually.
In this last example, the aoiconftool utility reads the default configuration file and creates a new file named default.conf in the current directory. This is safer than asking the utility to overwrite the old file, because it could fail after destroying the old file but before creating a complete new one.