devices.h revision 262059f71a68edc5e510427c63f5f1623d3672a8
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define DEVICE_ID_HEADSET 1
18#define DEVICE_ID_HANDSFREE 2
19
20extern const struct AudioInput_id_descriptor {
21    SLuint32 id;
22    const SLAudioInputDescriptor *descriptor;
23} AudioInput_id_descriptors[];
24
25extern const struct AudioOutput_id_descriptor {
26    SLuint32 id;
27    const SLAudioOutputDescriptor *descriptor;
28} AudioOutput_id_descriptors[];
29
30extern const struct LED_id_descriptor {
31    SLuint32 id;
32    const SLLEDDescriptor *descriptor;
33} LED_id_descriptors[];
34
35extern const struct Vibra_id_descriptor {
36    SLuint32 id;
37    const SLVibraDescriptor *descriptor;
38} Vibra_id_descriptors[];
39
40// These are not in 1.0.1 header file
41#define SL_AUDIOCODEC_NULL   0
42#define SL_AUDIOCODEC_VORBIS 9
43
44/** \brief Associates a codec ID with a corresponding codec descriptor */
45
46typedef struct {
47    SLuint32 mCodecID;  ///< The codec ID
48    const SLAudioCodecDescriptor *mDescriptor;  ///< The corresponding descriptor
49} CodecDescriptor;
50
51#define MAX_DECODERS 9 ///< (sizeof(Decoder_IDs) / sizeof(Decoder_IDs[0]))
52#define MAX_ENCODERS 9 ///< (sizeof(Encoder_IDs) / sizeof(Encoder_IDs[0]))
53
54// For now, but encoders might be different than decoders later
55extern const SLuint32 *Decoder_IDs, *Encoder_IDs;
56
57extern const CodecDescriptor DecoderDescriptors[], EncoderDescriptors[];
58
59extern SLresult GetCodecCapabilities(SLuint32 decoderId, SLuint32 *pIndex,
60    SLAudioCodecDescriptor *pDescriptor,
61    const CodecDescriptor *codecDescriptors);
62