1 /*
2  * Copyright (C) 2021 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 #ifndef ANDROID_EFFECT_SPATIALIZER_CORE_H_
18 #define ANDROID_EFFECT_SPATIALIZER_CORE_H_
19 
20 #include <system/audio_effect.h>
21 
22 #if __cplusplus
23 extern "C" {
24 #endif
25 
26 #define FX_IID_SPATIALIZER__ \
27         { 0xccd4cf09, 0xa79d, 0x46c2, 0x9aae, { 0x06, 0xa1, 0x69, 0x8d, 0x6c, 0x8f } }
28 static const effect_uuid_t FX_IID_SPATIALIZER_ = FX_IID_SPATIALIZER__;
29 const effect_uuid_t * const FX_IID_SPATIALIZER = &FX_IID_SPATIALIZER_;
30 
31 typedef enum
32 {
33     SPATIALIZER_PARAM_SUPPORTED_LEVELS,             // See SpatializationLevel.aidl
34     SPATIALIZER_PARAM_LEVEL,                        // See SpatializationLevel.aidl
35     SPATIALIZER_PARAM_HEADTRACKING_SUPPORTED,
36     SPATIALIZER_PARAM_HEADTRACKING_MODE,            // See SpatializerHeadTrackingMode.aidl
37     // list of supported input channel masks:
38     //  first unit32_t is the number of channel masks followed by the corresponding
39     // number of audio_channel_mask_t.
40     SPATIALIZER_PARAM_SUPPORTED_CHANNEL_MASKS,
41     // list of supported spatialization modes:
42     //  first unit32_t is the number of modes followed by the corresponding
43     // number of spatialization_mode_t.
44     SPATIALIZER_PARAM_SUPPORTED_SPATIALIZATION_MODES,
45     // Vector of 6 floats representing the head to stage pose:
46     // first three are a translation vector and the last three are a rotation vector.
47     SPATIALIZER_PARAM_HEAD_TO_STAGE,
48     // foldable device hinge angle as a float value in rad
49     SPATIALIZER_PARAM_HINGE_ANGLE,
50     // Display orientation as a float value in rad
51     SPATIALIZER_PARAM_DISPLAY_ORIENTATION,
52 } t_virtualizer_stage_params;
53 
54 // See SpatializationLevel.aidl
55 typedef enum {
56     SPATIALIZATION_LEVEL_NONE = 0,
57     SPATIALIZATION_LEVEL_MULTICHANNEL = 1,
58     SPATIALIZATION_LEVEL_MCHAN_BED_PLUS_OBJECTS = 2,
59 } spatializer_level_t;
60 
61 typedef enum {
62     SPATIALIZATION_MODE_BINAURAL = 0,
63     SPATIALIZATION_MODE_TRANSAURAL = 1,
64 } spatialization_mode_t;
65 
66 #if __cplusplus
67 }  // extern "C"
68 #endif
69 
70 
71 #endif /*ANDROID_EFFECT_SPATIALIZER_CORE_H_*/
72