libaaudio: changes for API council
Removed typedefs like aaudio_sample_rate_t
Removed use of handles. Just pass back opaque pointers.
Simplified gettersi in Stream.
Removed getters from Builder.
Update libaaudio.map.txt
Test: CTS test_aaudio.cpp
Change-Id: I63eaec3e5a8ecc516cfc1f950f4b4f54df1bd518
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/media/libaaudio/include/aaudio/AAudioDefinitions.h b/media/libaaudio/include/aaudio/AAudioDefinitions.h
index 5b72b94..5b7b819 100644
--- a/media/libaaudio/include/aaudio/AAudioDefinitions.h
+++ b/media/libaaudio/include/aaudio/AAudioDefinitions.h
@@ -23,25 +23,7 @@
extern "C" {
#endif
-typedef int32_t aaudio_handle_t; // negative handles are error codes
typedef int32_t aaudio_result_t;
-/**
- * A platform specific identifier for a device.
- */
-typedef int32_t aaudio_device_id_t;
-typedef int32_t aaudio_sample_rate_t;
-/** This is used for small quantities such as the number of frames in a buffer. */
-typedef int32_t aaudio_size_frames_t;
-/** This is used for small quantities such as the number of bytes in a frame. */
-typedef int32_t aaudio_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.
- */
-typedef int64_t aaudio_position_frames_t;
-
-typedef int64_t aaudio_nanoseconds_t;
/**
* This is used to represent a value that has not been specified.
@@ -50,18 +32,11 @@
* and would accept whatever it was given.
*/
#define AAUDIO_UNSPECIFIED 0
-#define AAUDIO_DEVICE_UNSPECIFIED ((aaudio_device_id_t) -1)
-#define AAUDIO_NANOS_PER_MICROSECOND ((int64_t)1000)
-#define AAUDIO_NANOS_PER_MILLISECOND (AAUDIO_NANOS_PER_MICROSECOND * 1000)
-#define AAUDIO_MILLIS_PER_SECOND 1000
-#define AAUDIO_NANOS_PER_SECOND (AAUDIO_NANOS_PER_MILLISECOND * AAUDIO_MILLIS_PER_SECOND)
-
-#define AAUDIO_HANDLE_INVALID ((aaudio_handle_t)-1)
+#define AAUDIO_DEVICE_UNSPECIFIED ((int32_t) -1)
enum aaudio_direction_t {
AAUDIO_DIRECTION_OUTPUT,
- AAUDIO_DIRECTION_INPUT,
- AAUDIO_DIRECTION_COUNT // This should always be last.
+ AAUDIO_DIRECTION_INPUT
};
enum aaudio_audio_format_t {
@@ -73,11 +48,6 @@
AAUDIO_FORMAT_PCM_I32
};
-// TODO These are deprecated. Remove these aliases once all references are replaced.
-#define AAUDIO_FORMAT_PCM16 AAUDIO_FORMAT_PCM_I16
-#define AAUDIO_FORMAT_PCM824 AAUDIO_FORMAT_PCM_I8_24
-#define AAUDIO_FORMAT_PCM32 AAUDIO_FORMAT_PCM_I32
-
enum {
AAUDIO_OK,
AAUDIO_ERROR_BASE = -900, // TODO review
@@ -102,15 +72,10 @@
AAUDIO_ERROR_NO_SERVICE
};
-typedef enum {
- AAUDIO_CLOCK_MONOTONIC, // Clock since booted, pauses when CPU is sleeping.
- AAUDIO_CLOCK_BOOTTIME, // Clock since booted, runs all the time.
- AAUDIO_CLOCK_COUNT // This should always be last.
-} aaudio_clockid_t;
-
typedef enum
{
AAUDIO_STREAM_STATE_UNINITIALIZED = 0,
+ AAUDIO_STREAM_STATE_UNKNOWN,
AAUDIO_STREAM_STATE_OPEN,
AAUDIO_STREAM_STATE_STARTING,
AAUDIO_STREAM_STATE_STARTED,
@@ -135,9 +100,7 @@
* Multiple applications will be mixed by the AAudio Server.
* This will have higher latency than the EXCLUSIVE mode.
*/
- AAUDIO_SHARING_MODE_SHARED,
-
- AAUDIO_SHARING_MODE_COUNT // This should always be last.
+ AAUDIO_SHARING_MODE_SHARED
} aaudio_sharing_mode_t;
#ifdef __cplusplus