Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 907c814e authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "liboboe: initial checkin of core and legacy files."

parents ec98fd46 e1ce491a
Loading
Loading
Loading
Loading
+27 −0
Original line number Original line Diff line number Diff line
// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

ndk_headers {
    name: "libOboe_headers",
    from: "include",
    to: "",
    srcs: ["include/oboe/*.h"],
    license: "include/oboe/NOTICE",
}

ndk_library {
    name: "liboboe.ndk",
    symbol_file: "liboboe.map.txt",
    first_version: "26",
}
+1 −0
Original line number Original line Diff line number Diff line
include $(call all-subdir-makefiles)
+13 −0
Original line number Original line Diff line number Diff line
Copyright (C) 2016 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+69 −56

File changed.

Preview size limit exceeded, changes collapsed.

+12 −4
Original line number Original line Diff line number Diff line
@@ -28,7 +28,10 @@ typedef int32_t oboe_result_t;
typedef int32_t  oboe_sample_rate_t;
typedef int32_t  oboe_sample_rate_t;
/** This is used for small quantities such as the number of frames in a buffer. */
/** This is used for small quantities such as the number of frames in a buffer. */
typedef int32_t  oboe_size_frames_t;
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.
 * been played since a stream was started.
 * At 48000 Hz, a 32-bit integer would wrap around in just over 12 hours.
 * At 48000 Hz, a 32-bit integer would wrap around in just over 12 hours.
 */
 */
@@ -85,7 +88,8 @@ enum oboe_wrapper_t {


/**
/**
 * Fields packed into oboe_audio_format_t, from most to least significant bits.
 * Fields packed into oboe_audio_format_t, from most to least significant bits.
 *   Reserved:8
 *   Invalid:1
 *   Reserved:7
 *   Wrapper:8
 *   Wrapper:8
 *   Content:8
 *   Content:8
 *   Data Type:8
 *   Data Type:8
@@ -97,7 +101,7 @@ enum oboe_wrapper_t {
                OBOE_AUDIO_FORMAT(dataType, content, OBOE_AUDIO_WRAPPER_NONE)
                OBOE_AUDIO_FORMAT(dataType, content, OBOE_AUDIO_WRAPPER_NONE)


#define OBOE_AUDIO_FORMAT_DATA_TYPE(format) \
#define OBOE_AUDIO_FORMAT_DATA_TYPE(format) \
    (format & 0x0FF)
    ((oboe_datatype_t)(format & 0x0FF))


// Define some common formats.
// Define some common formats.
#define OBOE_AUDIO_FORMAT_PCM16  \
#define OBOE_AUDIO_FORMAT_PCM16  \
@@ -106,6 +110,9 @@ enum oboe_wrapper_t {
                OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_FLOAT32, OBOE_AUDIO_CONTENT_PCM)
                OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_FLOAT32, OBOE_AUDIO_CONTENT_PCM)
#define OBOE_AUDIO_FORMAT_PCM824 \
#define OBOE_AUDIO_FORMAT_PCM824 \
                OBOE_AUDIO_FORMAT_RAW(OBOE_AUDIO_DATATYPE_INT824, OBOE_AUDIO_CONTENT_PCM)
                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 {
enum {
    OBOE_OK,
    OBOE_OK,
@@ -126,7 +133,8 @@ enum {
    OBOE_ERROR_NULL,
    OBOE_ERROR_NULL,
    OBOE_ERROR_TIMEOUT,
    OBOE_ERROR_TIMEOUT,
    OBOE_ERROR_WOULD_BLOCK,
    OBOE_ERROR_WOULD_BLOCK,
    OBOE_ERROR_INVALID_ORDER
    OBOE_ERROR_INVALID_ORDER,
    OBOE_ERROR_OUT_OF_RANGE
};
};


typedef enum {
typedef enum {
Loading