liboboe: initial checkin of core and legacy files.

Oboe C++ files that calls AudioTrack and AudioRecord.
Main C API implemented by src/core/OboeAudio.cpp

Test: gunit tests for the Legacy mode and handle tracker in tests folder
Bug: 33347409
Change-Id: I50f9fd99377efbd8de6fef1601e9af4c22c6ab46
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/media/liboboe/include/oboe/OboeDefinitions.h b/media/liboboe/include/oboe/OboeDefinitions.h
index 79fef3a..d80c958 100644
--- a/media/liboboe/include/oboe/OboeDefinitions.h
+++ b/media/liboboe/include/oboe/OboeDefinitions.h
@@ -28,7 +28,10 @@
 typedef int32_t  oboe_sample_rate_t;
 /** This is used for small quantities such as the number of frames in a buffer. */
 typedef int32_t  oboe_size_frames_t;
-/** This is used for large quantities, such as the number of frames that have
+/** This is used for small quantities such as the number of bytes in a frame. */
+typedef int32_t  oboe_size_bytes_t;
+/**
+ * This is used for large quantities, such as the number of frames that have
  * been played since a stream was started.
  * At 48000 Hz, a 32-bit integer would wrap around in just over 12 hours.
  */
@@ -85,7 +88,8 @@
 
 /**
  * Fields packed into oboe_audio_format_t, from most to least significant bits.
- *   Reserved:8
+ *   Invalid:1
+ *   Reserved:7
  *   Wrapper:8
  *   Content:8
  *   Data Type:8
@@ -97,7 +101,7 @@
                 OBOE_AUDIO_FORMAT(dataType, content, OBOE_AUDIO_WRAPPER_NONE)
 
 #define OBOE_AUDIO_FORMAT_DATA_TYPE(format) \
-    (format & 0x0FF)
+    ((oboe_datatype_t)(format & 0x0FF))
 
 // Define some common formats.
 #define OBOE_AUDIO_FORMAT_PCM16  \
@@ -106,6 +110,9 @@
                 OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_FLOAT32, OBOE_AUDIO_CONTENT_PCM)
 #define OBOE_AUDIO_FORMAT_PCM824 \
                 OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_INT824, OBOE_AUDIO_CONTENT_PCM)
+#define OBOE_AUDIO_FORMAT_PCM32 \
+                OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_INT32, OBOE_AUDIO_CONTENT_PCM)
+#define OBOE_AUDIO_FORMAT_INVALID ((oboe_audio_format_t)-1)
 
 enum {
     OBOE_OK,
@@ -126,7 +133,8 @@
     OBOE_ERROR_NULL,
     OBOE_ERROR_TIMEOUT,
     OBOE_ERROR_WOULD_BLOCK,
-    OBOE_ERROR_INVALID_ORDER
+    OBOE_ERROR_INVALID_ORDER,
+    OBOE_ERROR_OUT_OF_RANGE
 };
 
 typedef enum {