audio: move struct audio_config definition to audio.h
struct audio_config definition moved from hardware/audio.h to
system/audio.h for use inside the framework and not only at the HAL.
Added frame_count field to struct audio_config.
Bug: 14815883.
Change-Id: Ib0e99a60234b8e5302eb882b89e5a021a94ec2cb
diff --git a/include/system/audio.h b/include/system/audio.h
index 5db2127..13c8ae5 100644
--- a/include/system/audio.h
+++ b/include/system/audio.h
@@ -740,6 +740,38 @@
is_streaming: false
};
+/* common audio stream configuration parameters
+ * You should memset() the entire structure to zero before use to
+ * ensure forward compatibility
+ */
+struct audio_config {
+ uint32_t sample_rate;
+ audio_channel_mask_t channel_mask;
+ audio_format_t format;
+ audio_offload_info_t offload_info;
+ size_t frame_count;
+};
+typedef struct audio_config audio_config_t;
+
+static const audio_config_t AUDIO_CONFIG_INITIALIZER = {
+ sample_rate: 0,
+ channel_mask: AUDIO_CHANNEL_NONE,
+ format: AUDIO_FORMAT_DEFAULT,
+ offload_info: {
+ version: AUDIO_OFFLOAD_INFO_VERSION_CURRENT,
+ size: sizeof(audio_offload_info_t),
+ sample_rate: 0,
+ channel_mask: 0,
+ format: AUDIO_FORMAT_DEFAULT,
+ stream_type: AUDIO_STREAM_VOICE_CALL,
+ bit_rate: 0,
+ duration_us: 0,
+ has_video: false,
+ is_streaming: false
+ },
+ frame_count: 0,
+};
+
/* audio hw module handle functions or structures referencing a module */
typedef int audio_module_handle_t;