OSDN Git Service

Add const value for querying microphones information.
authorjiabin <jiabin@google.com>
Tue, 20 Mar 2018 01:24:11 +0000 (18:24 -0700)
committerjiabin <jiabin@google.com>
Thu, 22 Mar 2018 22:46:33 +0000 (15:46 -0700)
Add const value when microphones information is not available.

Bug: 64038649
Test: Manual Testing and Cts test
Change-Id: Ib46d9e2b976df607e87f6ae69f0aa25f159a2003

audio/include/system/audio.h

index 713214c..314bb43 100644 (file)
@@ -1058,10 +1058,33 @@ typedef enum {
     AUDIO_MICROPHONE_CHANNEL_MAPPING_PROCESSED = 2,
 } audio_microphone_channel_mapping_t;
 
+typedef enum {
+    AUDIO_MICROPHONE_CHARACTERISTIC_NONE = 0u, // 0x0
+    AUDIO_MICROPHONE_CHARACTERISTIC_SENSITIVITY = 1u, // 0x1
+    AUDIO_MICROPHONE_CHARACTERISTIC_MAX_SPL = 2u, // 0x2
+    AUDIO_MICROPHONE_CHARACTERISTIC_MIN_SPL = 4u, // 0x4
+    AUDIO_MICROPHONE_CHARACTERISTIC_ORIENTATION = 8u, // 0x8
+    AUDIO_MICROPHONE_CHARACTERISTIC_GEOMETRIC_LOCATION = 16u, // 0x10
+    AUDIO_MICROPHONE_CHARACTERISTIC_ALL = 31u, /* ((((SENSITIVITY | MAX_SPL) | MIN_SPL)
+                                                  | ORIENTATION) | GEOMETRIC_LOCATION) */
+} audio_microphone_characteristic_fields_t;
+
 /* the maximum length for the microphone id */
 #define AUDIO_MICROPHONE_ID_MAX_LEN 32
 /* max number of frequency responses in a frequency response table */
 #define AUDIO_MICROPHONE_MAX_FREQUENCY_RESPONSES 32
+/* max number of microphone */
+#define AUDIO_MICROPHONE_MAX_COUNT 32
+/* the value of unknown spl */
+#define AUDIO_MICROPHONE_SPL_UNKNOWN -FLT_MAX
+/* the value of unknown sensitivity */
+#define AUDIO_MICROPHONE_SENSITIVITY_UNKNOWN -FLT_MAX
+/* the value of unknown coordinate */
+#define AUDIO_MICROPHONE_COORDINATE_UNKNOWN -FLT_MAX
+/* the value used as address when the address of bottom microphone is empty */
+#define AUDIO_BOTTOM_MICROPHONE_ADDRESS "bottom"
+/* the value used as address when the address of back microphone is empty */
+#define AUDIO_BACK_MICROPHONE_ADDRESS "back"
 
 struct audio_microphone_characteristic_t {
     char                               device_id[AUDIO_MICROPHONE_ID_MAX_LEN];
@@ -1080,6 +1103,7 @@ struct audio_microphone_characteristic_t {
     float frequency_responses[2][AUDIO_MICROPHONE_MAX_FREQUENCY_RESPONSES];
     struct audio_microphone_coordinate geometric_location;
     struct audio_microphone_coordinate orientation;
+    audio_microphone_characteristic_fields_t valid_mask;
 };
 
 __END_DECLS