1 //
2 // Copyright (C) 2020 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 // clang-format off
18 #include "native_bridge_support/vdso/interceptable_functions.h"
19
20 DEFINE_INTERCEPTABLE_STUB_FUNCTION(slCreateEngine);
21 DEFINE_INTERCEPTABLE_STUB_FUNCTION(slQueryNumSupportedEngineInterfaces);
22 DEFINE_INTERCEPTABLE_STUB_FUNCTION(slQuerySupportedEngineInterfaces);
23 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DCOMMIT);
24 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DDOPPLER);
25 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DGROUPING);
26 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DLOCATION);
27 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DMACROSCOPIC);
28 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_3DSOURCE);
29 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDACOUSTICECHOCANCELLATION);
30 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDAUTOMATICGAINCONTROL);
31 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDBUFFERQUEUESOURCE);
32 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDCONFIGURATION);
33 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDEFFECT);
34 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDEFFECTCAPABILITIES);
35 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDEFFECTSEND);
36 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDNOISESUPPRESSION);
37 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ANDROIDSIMPLEBUFFERQUEUE);
38 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_AUDIODECODERCAPABILITIES);
39 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_AUDIOENCODER);
40 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_AUDIOENCODERCAPABILITIES);
41 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_AUDIOIODEVICECAPABILITIES);
42 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_BASSBOOST);
43 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_BUFFERQUEUE);
44 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_DEVICEVOLUME);
45 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_DYNAMICINTERFACEMANAGEMENT);
46 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_DYNAMICSOURCE);
47 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_EFFECTSEND);
48 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ENGINE);
49 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ENGINECAPABILITIES);
50 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_ENVIRONMENTALREVERB);
51 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_EQUALIZER);
52 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_LED);
53 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_METADATAEXTRACTION);
54 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_METADATATRAVERSAL);
55 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_MIDIMESSAGE);
56 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_MIDIMUTESOLO);
57 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_MIDITEMPO);
58 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_MIDITIME);
59 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_MUTESOLO);
60 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_NULL);
61 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_OBJECT);
62 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_OUTPUTMIX);
63 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_PITCH);
64 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_PLAY);
65 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_PLAYBACKRATE);
66 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_PREFETCHSTATUS);
67 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_PRESETREVERB);
68 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_RATEPITCH);
69 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_RECORD);
70 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_SEEK);
71 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_THREADSYNC);
72 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_VIBRA);
73 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_VIRTUALIZER);
74 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_VISUALIZATION);
75 DEFINE_INTERCEPTABLE_STUB_VARIABLE(SL_IID_VOLUME);
76
init_stub_library()77 static void __attribute__((constructor(0))) init_stub_library() {
78 INIT_INTERCEPTABLE_STUB_FUNCTION("libOpenSLES.so", slCreateEngine);
79 INIT_INTERCEPTABLE_STUB_FUNCTION("libOpenSLES.so", slQueryNumSupportedEngineInterfaces);
80 INIT_INTERCEPTABLE_STUB_FUNCTION("libOpenSLES.so", slQuerySupportedEngineInterfaces);
81 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DCOMMIT);
82 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DDOPPLER);
83 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DGROUPING);
84 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DLOCATION);
85 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DMACROSCOPIC);
86 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_3DSOURCE);
87 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDACOUSTICECHOCANCELLATION);
88 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDAUTOMATICGAINCONTROL);
89 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDBUFFERQUEUESOURCE);
90 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDCONFIGURATION);
91 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDEFFECT);
92 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDEFFECTCAPABILITIES);
93 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDEFFECTSEND);
94 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDNOISESUPPRESSION);
95 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ANDROIDSIMPLEBUFFERQUEUE);
96 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_AUDIODECODERCAPABILITIES);
97 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_AUDIOENCODER);
98 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_AUDIOENCODERCAPABILITIES);
99 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_AUDIOIODEVICECAPABILITIES);
100 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_BASSBOOST);
101 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_BUFFERQUEUE);
102 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_DEVICEVOLUME);
103 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_DYNAMICINTERFACEMANAGEMENT);
104 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_DYNAMICSOURCE);
105 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_EFFECTSEND);
106 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ENGINE);
107 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ENGINECAPABILITIES);
108 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_ENVIRONMENTALREVERB);
109 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_EQUALIZER);
110 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_LED);
111 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_METADATAEXTRACTION);
112 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_METADATATRAVERSAL);
113 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_MIDIMESSAGE);
114 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_MIDIMUTESOLO);
115 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_MIDITEMPO);
116 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_MIDITIME);
117 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_MUTESOLO);
118 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_NULL);
119 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_OBJECT);
120 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_OUTPUTMIX);
121 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_PITCH);
122 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_PLAY);
123 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_PLAYBACKRATE);
124 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_PREFETCHSTATUS);
125 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_PRESETREVERB);
126 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_RATEPITCH);
127 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_RECORD);
128 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_SEEK);
129 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_THREADSYNC);
130 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_VIBRA);
131 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_VIRTUALIZER);
132 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_VISUALIZATION);
133 INIT_INTERCEPTABLE_STUB_VARIABLE("libOpenSLES.so", SL_IID_VOLUME);
134 }
135 // clang-format on
136