media/libcubeb/src/audiotrack_definitions.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /*
michael@0 2 * Copyright (C) 2008 The Android Open Source Project
michael@0 3 *
michael@0 4 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 5 * you may not use this file except in compliance with the License.
michael@0 6 * You may obtain a copy of the License at
michael@0 7 *
michael@0 8 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 9 *
michael@0 10 * Unless required by applicable law or agreed to in writing, software
michael@0 11 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 13 * See the License for the specific language governing permissions and
michael@0 14 * limitations under the License.
michael@0 15 */
michael@0 16
michael@0 17 #include <cubeb/cubeb-stdint.h>
michael@0 18
michael@0 19 /*
michael@0 20 * The following definitions are copied from the android sources. Only the
michael@0 21 * relevant enum member and values needed are copied.
michael@0 22 */
michael@0 23
michael@0 24 /*
michael@0 25 * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/utils/Errors.h
michael@0 26 */
michael@0 27 typedef int32_t status_t;
michael@0 28
michael@0 29 /*
michael@0 30 * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioTrack.h
michael@0 31 */
michael@0 32 struct Buffer {
michael@0 33 uint32_t flags;
michael@0 34 int channelCount;
michael@0 35 int format;
michael@0 36 size_t frameCount;
michael@0 37 size_t size;
michael@0 38 union {
michael@0 39 void* raw;
michael@0 40 short* i16;
michael@0 41 int8_t* i8;
michael@0 42 };
michael@0 43 };
michael@0 44
michael@0 45 enum event_type {
michael@0 46 EVENT_MORE_DATA = 0,
michael@0 47 EVENT_UNDERRUN = 1,
michael@0 48 EVENT_LOOP_END = 2,
michael@0 49 EVENT_MARKER = 3,
michael@0 50 EVENT_NEW_POS = 4,
michael@0 51 EVENT_BUFFER_END = 5
michael@0 52 };
michael@0 53
michael@0 54 /**
michael@0 55 * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioSystem.h
michael@0 56 * and
michael@0 57 * https://android.googlesource.com/platform/system/core/+/android-4.2.2_r1/include/system/audio.h
michael@0 58 */
michael@0 59
michael@0 60 #define AUDIO_STREAM_TYPE_MUSIC 3
michael@0 61
michael@0 62 enum {
michael@0 63 AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS = 0x1,
michael@0 64 AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS = 0x2,
michael@0 65 AUDIO_CHANNEL_OUT_MONO_ICS = AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS,
michael@0 66 AUDIO_CHANNEL_OUT_STEREO_ICS = (AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS | AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS)
michael@0 67 } AudioTrack_ChannelMapping_ICS;
michael@0 68
michael@0 69 enum {
michael@0 70 AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo = 0x4,
michael@0 71 AUDIO_CHANNEL_OUT_FRONT_RIGHT_Froyo = 0x8,
michael@0 72 AUDIO_CHANNEL_OUT_MONO_Froyo = AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo,
michael@0 73 AUDIO_CHANNEL_OUT_STEREO_Froyo = (AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo | AUDIO_CHANNEL_OUT_FRONT_RIGHT_Froyo)
michael@0 74 } AudioTrack_ChannelMapping_Froyo;
michael@0 75
michael@0 76 typedef enum {
michael@0 77 AUDIO_FORMAT_PCM = 0x00000000,
michael@0 78 AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1,
michael@0 79 AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | AUDIO_FORMAT_PCM_SUB_16_BIT),
michael@0 80 } AudioTrack_SampleType;
michael@0 81

mercurial