
The Metadata is design-time information of the audio objects use to describe their features and attributes. Metadata is stored in the audio object code. This information can be used to convey memory usage or to check compatibility between the audio objects.
It also provides the tool with constraints on parameters, and information describing controls and audio channels.
There are three types of metadata:
The Static Metadata represents data that will not change based on configuration. It is provided as is.
There are two API methods related to this feature.
virtual void createStaticMetadata(); staticMetadata getStaticMetadata() { return m_StaticMetadata; }
This method is intended to be overwritten by each instance of AudioObject. The goal is to populate the protected member m_StaticMetadata. There is an example of how to do this in AudioObject.cpp. The basic audio objects included within xAF also implement this method appropriately.
This method should be overridden by any object updating to the new API. Here are the relevant details:
This method simply returns a copy of m_StaticMetadata. It is not virtual.
This will be deprecated here and moved to dynamic metadata, to support a target/core specific implementation. The static member will be kept for backward compatibility reasons only and will be deprecated after some time.
Do not use this struct member in future implementations!
Dynamic metadata creation is similiar to static, but accepts arguments for the creation process, hence the dynamic. The object receives all configuration data being considered (in most cases this would be by GTT) and writes relevant information to the member m_DynamicMetadata in response.
virtual void createDynamicMetadata(ioObjectConfigInput& configIn, ioObjectConfigOutput& configOut); dynamicMetadata getDynamicMetadata() { return m_DynamicMetadata; }
createDynamicMetadata is called after a successful call to getObjectIo. It can further restrict values in the ioObjectConfigOutput struct. All required information is passed in with configIn.
This method simply returns a copy of m_DynamicMetadata. Note that it is not virtual.
These structures are used by the tool during signal design. The input configuration struct holds all *attempted* parameters, the output struct is used to constrain audio inputs and outputs and report the correct number of control inputs and outputs.
This feature allows Audio Objects to give the GTT the ability to operate in in-place computation mode. In this mode, the audio object uses the same buffers for input and output. This option has been moved from static metadata to dynamic metadata to support a kernel-based decision. This allows the AO developer to decide, based on the target architecture, whether or not it is beneficial to run the calc function in-place.
GTT analyses the signal flow and calculates the amount of buffers required for the given signal flow. If isInplaceComputationSupported is set by the audio object developer, GTT tells the framework to allocate only input buffers only.
The isInplaceComputationSupported flag can be checked in the the audio object’s dynamic metadata.
For example, Gain configured for 6 channels :
In-place computation feature has the following benefits:
Current Limitation or Additional conditions
An Audio Object Marked is considered for in-place has to satisfy following three conditions: