diff options
Diffstat (limited to 'audio')
| -rw-r--r-- | audio/4.0/IDevice.hal | 9 | ||||
| -rw-r--r-- | audio/4.0/IStreamIn.hal | 6 | ||||
| -rw-r--r-- | audio/4.0/IStreamOut.hal | 6 | ||||
| -rw-r--r-- | audio/4.0/types.hal | 33 | ||||
| -rw-r--r-- | audio/common/4.0/types.hal | 10 |
5 files changed, 62 insertions, 2 deletions
diff --git a/audio/4.0/IDevice.hal b/audio/4.0/IDevice.hal index 4bc2d4db0..591e56509 100644 --- a/audio/4.0/IDevice.hal +++ b/audio/4.0/IDevice.hal @@ -109,6 +109,8 @@ interface IDevice { * @param device device type and (if needed) address. * @param config stream configuration. * @param flags additional flags. + * @param sourceMetadata Description of the audio that will be played. + May be used by implementations to configure hardware effects. * @return retval operation completion status. * @return outStream created output stream. * @return suggestedConfig in case of invalid parameters, suggested config. @@ -117,7 +119,8 @@ interface IDevice { AudioIoHandle ioHandle, DeviceAddress device, AudioConfig config, - bitfield<AudioOutputFlag> flags) generates ( + bitfield<AudioOutputFlag> flags, + SourceMetadata sourceMetadata) generates ( Result retval, IStreamOut outStream, AudioConfig suggestedConfig); @@ -132,6 +135,8 @@ interface IDevice { * @param config stream configuration. * @param flags additional flags. * @param source source specification. + * @param sinkMetadata Description of the audio that is suggested by the client. + * May be used by implementations to configure hardware effects. * @return retval operation completion status. * @return inStream in case of success, created input stream. * @return suggestedConfig in case of invalid parameters, suggested config. @@ -141,7 +146,7 @@ interface IDevice { DeviceAddress device, AudioConfig config, bitfield<AudioInputFlag> flags, - AudioSource source) generates ( + SinkMetadata sinkMetadata) generates ( Result retval, IStreamIn inStream, AudioConfig suggestedConfig); diff --git a/audio/4.0/IStreamIn.hal b/audio/4.0/IStreamIn.hal index ea2826ea3..3b1fd40c5 100644 --- a/audio/4.0/IStreamIn.hal +++ b/audio/4.0/IStreamIn.hal @@ -84,6 +84,12 @@ interface IStreamIn extends IStream { }; /** + * Called when the metadata of the stream's sink has been changed. + * @param sinkMetadata Description of the audio that is suggested by the clients. + */ + updateSinkMetadata(SinkMetadata sinkMetadata); + + /** * Set up required transports for receiving audio buffers from the driver. * * The transport consists of three message queues: diff --git a/audio/4.0/IStreamOut.hal b/audio/4.0/IStreamOut.hal index 02f169730..585bffed6 100644 --- a/audio/4.0/IStreamOut.hal +++ b/audio/4.0/IStreamOut.hal @@ -78,6 +78,12 @@ interface IStreamOut extends IStream { }; /** + * Called when the metadata of the stream's source has been changed. + * @param sourceMetadata Description of the audio that is played by the clients. + */ + updateSourceMetadata(SourceMetadata sourceMetadata); + + /** * Set up required transports for passing audio buffers to the driver. * * The transport consists of three message queues: diff --git a/audio/4.0/types.hal b/audio/4.0/types.hal index 5c95e4be2..1563b36cf 100644 --- a/audio/4.0/types.hal +++ b/audio/4.0/types.hal @@ -117,3 +117,36 @@ enum MessageQueueFlagBits : uint32_t { NOT_EMPTY = 1 << 0, NOT_FULL = 1 << 1 }; + +/** Metadata of a playback track for a StreamOut. */ +struct PlaybackTrackMetadata { + AudioUsage usage; + AudioContentType contentType; + /** + * Positive linear gain applied to the track samples. 0 being muted and 1 is no attenuation, + * 2 means double amplification... + * Must not be negative. + */ + float gain; +}; + +/** Metadatas of the source of a StreamOut. */ +struct SourceMetadata { + vec<PlaybackTrackMetadata> tracks; +}; + +/** Metadata of a record track for a StreamIn. */ +struct RecordTrackMetadata { + AudioSource source; + /** + * Positive linear gain applied to the track samples. 0 being muted and 1 is no attenuation, + * 2 means double amplification... + * Must not be negative. + */ + float gain; +}; + +/** Metadatas of the source of a StreamIn. */ +struct SinkMetadata { + vec<RecordTrackMetadata> tracks; +}; diff --git a/audio/common/4.0/types.hal b/audio/common/4.0/types.hal index e9e717366..b1c15f321 100644 --- a/audio/common/4.0/types.hal +++ b/audio/common/4.0/types.hal @@ -671,6 +671,16 @@ enum AudioUsage : int32_t { ASSISTANT = 16, }; +/** Type of audio generated by an application. */ +@export(name="audio_content_type_t", value_prefix="AUDIO_CONTENT_TYPE_") +enum AudioContentType : uint32_t { + UNKNOWN = 0, + SPEECH = 1, + MUSIC = 2, + MOVIE = 3, + SONIFICATION = 4, +}; + /** * Additional information about the stream passed to hardware decoders. */ |
