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