1 /*
2 * Copyright 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 /*
18 * Generated mock file from original source file
19 * Functions generated:67
20 */
21
22 #include <base/logging.h>
23 #include <inttypes.h>
24
25 #include <map>
26 #include <string>
27
28 #include "a2dp_aac.h"
29 #include "a2dp_codec_api.h"
30 #include "a2dp_sbc.h"
31 #include "a2dp_vendor.h"
32 #include "bta/av/bta_av_int.h"
33 #include "osi/include/log.h"
34 #include "osi/include/properties.h"
35 #include "stack/include/bt_hdr.h"
36 #include "test/common/mock_functions.h"
37
38 #ifndef UNUSED_ATTR
39 #define UNUSED_ATTR
40 #endif
41
createCodec(btav_a2dp_codec_index_t codec_index,btav_a2dp_codec_priority_t codec_priority)42 A2dpCodecConfig* A2dpCodecConfig::createCodec(
43 btav_a2dp_codec_index_t codec_index,
44 btav_a2dp_codec_priority_t codec_priority) {
45 inc_func_call_count(__func__);
46 return nullptr;
47 }
findSinkCodecConfig(const uint8_t * p_codec_info)48 A2dpCodecConfig* A2dpCodecs::findSinkCodecConfig(const uint8_t* p_codec_info) {
49 inc_func_call_count(__func__);
50 return nullptr;
51 }
findSourceCodecConfig(const uint8_t * p_codec_info)52 A2dpCodecConfig* A2dpCodecs::findSourceCodecConfig(
53 const uint8_t* p_codec_info) {
54 inc_func_call_count(__func__);
55 return nullptr;
56 }
A2dpCodecConfig(btav_a2dp_codec_index_t codec_index,const std::string & name,btav_a2dp_codec_priority_t codec_priority)57 A2dpCodecConfig::A2dpCodecConfig(btav_a2dp_codec_index_t codec_index,
58 const std::string& name,
59 btav_a2dp_codec_priority_t codec_priority)
60 : codec_index_(codec_index),
61 name_(name),
62 default_codec_priority_(codec_priority) {
63 inc_func_call_count(__func__);
64 }
~A2dpCodecConfig()65 A2dpCodecConfig::~A2dpCodecConfig() { inc_func_call_count(__func__); }
A2dpCodecs(const std::vector<btav_a2dp_codec_config_t> & codec_priorities)66 A2dpCodecs::A2dpCodecs(
67 const std::vector<btav_a2dp_codec_config_t>& codec_priorities)
68 : current_codec_config_(nullptr) {
69 inc_func_call_count(__func__);
70 }
~A2dpCodecs()71 A2dpCodecs::~A2dpCodecs() { inc_func_call_count(__func__); }
A2DP_AdjustCodec(uint8_t * p_codec_info)72 bool A2DP_AdjustCodec(uint8_t* p_codec_info) {
73 inc_func_call_count(__func__);
74 return false;
75 }
A2DP_BuildCodecHeader(const uint8_t * p_codec_info,BT_HDR * p_buf,uint16_t frames_per_packet)76 bool A2DP_BuildCodecHeader(const uint8_t* p_codec_info, BT_HDR* p_buf,
77 uint16_t frames_per_packet) {
78 inc_func_call_count(__func__);
79 return false;
80 }
A2DP_CodecEquals(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)81 bool A2DP_CodecEquals(const uint8_t* p_codec_info_a,
82 const uint8_t* p_codec_info_b) {
83 inc_func_call_count(__func__);
84 return false;
85 }
A2DP_CodecTypeEquals(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)86 bool A2DP_CodecTypeEquals(const uint8_t* p_codec_info_a,
87 const uint8_t* p_codec_info_b) {
88 inc_func_call_count(__func__);
89 return false;
90 }
A2DP_GetPacketTimestamp(const uint8_t * p_codec_info,const uint8_t * p_data,uint32_t * p_timestamp)91 bool A2DP_GetPacketTimestamp(const uint8_t* p_codec_info, const uint8_t* p_data,
92 uint32_t* p_timestamp) {
93 inc_func_call_count(__func__);
94 return false;
95 }
A2DP_InitCodecConfig(btav_a2dp_codec_index_t codec_index,AvdtpSepConfig * p_cfg)96 bool A2DP_InitCodecConfig(btav_a2dp_codec_index_t codec_index,
97 AvdtpSepConfig* p_cfg) {
98 inc_func_call_count(__func__);
99 return false;
100 }
A2DP_GetEecoderEffectiveFrameSize(const uint8_t * p_codec_info)101 int A2DP_GetEecoderEffectiveFrameSize(const uint8_t* p_codec_info) {
102 inc_func_call_count(__func__);
103 return 0;
104 }
A2DP_IsPeerSinkCodecValid(const uint8_t * p_codec_info)105 bool A2DP_IsPeerSinkCodecValid(const uint8_t* p_codec_info) {
106 inc_func_call_count(__func__);
107 return false;
108 }
A2DP_IsPeerSourceCodecSupported(const uint8_t * p_codec_info)109 bool A2DP_IsPeerSourceCodecSupported(const uint8_t* p_codec_info) {
110 inc_func_call_count(__func__);
111 return false;
112 }
A2DP_IsPeerSourceCodecValid(const uint8_t * p_codec_info)113 bool A2DP_IsPeerSourceCodecValid(const uint8_t* p_codec_info) {
114 inc_func_call_count(__func__);
115 return false;
116 }
A2DP_IsSinkCodecSupported(const uint8_t * p_codec_info)117 bool A2DP_IsSinkCodecSupported(const uint8_t* p_codec_info) {
118 inc_func_call_count(__func__);
119 return false;
120 }
A2DP_IsSinkCodecValid(const uint8_t * p_codec_info)121 bool A2DP_IsSinkCodecValid(const uint8_t* p_codec_info) {
122 inc_func_call_count(__func__);
123 return false;
124 }
A2DP_IsSourceCodecValid(const uint8_t * p_codec_info)125 bool A2DP_IsSourceCodecValid(const uint8_t* p_codec_info) {
126 inc_func_call_count(__func__);
127 return false;
128 }
A2DP_UsesRtpHeader(bool content_protection_enabled,const uint8_t * p_codec_info)129 bool A2DP_UsesRtpHeader(bool content_protection_enabled,
130 const uint8_t* p_codec_info) {
131 inc_func_call_count(__func__);
132 return false;
133 }
codecConfigIsValid(const btav_a2dp_codec_config_t & codec_config)134 bool A2dpCodecConfig::codecConfigIsValid(
135 const btav_a2dp_codec_config_t& codec_config) {
136 inc_func_call_count(__func__);
137 return false;
138 }
copyOutOtaCodecConfig(uint8_t * p_codec_info)139 bool A2dpCodecConfig::copyOutOtaCodecConfig(uint8_t* p_codec_info) {
140 inc_func_call_count(__func__);
141 return false;
142 }
getCodecSpecificConfig(tBT_A2DP_OFFLOAD * p_a2dp_offload)143 bool A2dpCodecConfig::getCodecSpecificConfig(tBT_A2DP_OFFLOAD* p_a2dp_offload) {
144 inc_func_call_count(__func__);
145 return false;
146 }
isCodecConfigEmpty(const btav_a2dp_codec_config_t & codec_config)147 bool A2dpCodecConfig::isCodecConfigEmpty(
148 const btav_a2dp_codec_config_t& codec_config) {
149 inc_func_call_count(__func__);
150 return false;
151 }
isValid() const152 bool A2dpCodecConfig::isValid() const {
153 inc_func_call_count(__func__);
154 return false;
155 }
setCodecUserConfig(const btav_a2dp_codec_config_t & codec_user_config,const btav_a2dp_codec_config_t & codec_audio_config,const tA2DP_ENCODER_INIT_PEER_PARAMS * p_peer_params,const uint8_t * p_peer_codec_info,bool is_capability,uint8_t * p_result_codec_config,bool * p_restart_input,bool * p_restart_output,bool * p_config_updated)156 bool A2dpCodecConfig::setCodecUserConfig(
157 const btav_a2dp_codec_config_t& codec_user_config,
158 const btav_a2dp_codec_config_t& codec_audio_config,
159 const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
160 const uint8_t* p_peer_codec_info, bool is_capability,
161 uint8_t* p_result_codec_config, bool* p_restart_input,
162 bool* p_restart_output, bool* p_config_updated) {
163 inc_func_call_count(__func__);
164 return false;
165 }
getCodecConfigAndCapabilities(btav_a2dp_codec_config_t * p_codec_config,std::vector<btav_a2dp_codec_config_t> * p_codecs_local_capabilities,std::vector<btav_a2dp_codec_config_t> * p_codecs_selectable_capabilities)166 bool A2dpCodecs::getCodecConfigAndCapabilities(
167 btav_a2dp_codec_config_t* p_codec_config,
168 std::vector<btav_a2dp_codec_config_t>* p_codecs_local_capabilities,
169 std::vector<btav_a2dp_codec_config_t>* p_codecs_selectable_capabilities) {
170 inc_func_call_count(__func__);
171 return false;
172 }
init()173 bool A2dpCodecs::init() {
174 inc_func_call_count(__func__);
175 return false;
176 }
isSupportedCodec(btav_a2dp_codec_index_t codec_index)177 bool A2dpCodecs::isSupportedCodec(btav_a2dp_codec_index_t codec_index) {
178 inc_func_call_count(__func__);
179 return false;
180 }
setCodecAudioConfig(const btav_a2dp_codec_config_t & codec_audio_config,const tA2DP_ENCODER_INIT_PEER_PARAMS * p_peer_params,const uint8_t * p_peer_sink_capabilities,uint8_t * p_result_codec_config,bool * p_restart_output,bool * p_config_updated)181 bool A2dpCodecs::setCodecAudioConfig(
182 const btav_a2dp_codec_config_t& codec_audio_config,
183 const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
184 const uint8_t* p_peer_sink_capabilities, uint8_t* p_result_codec_config,
185 bool* p_restart_output, bool* p_config_updated) {
186 inc_func_call_count(__func__);
187 return false;
188 }
setCodecConfig(const uint8_t * p_peer_codec_info,bool is_capability,uint8_t * p_result_codec_config,bool select_current_codec)189 bool A2dpCodecs::setCodecConfig(const uint8_t* p_peer_codec_info,
190 bool is_capability,
191 uint8_t* p_result_codec_config,
192 bool select_current_codec) {
193 inc_func_call_count(__func__);
194 return false;
195 }
setCodecOtaConfig(const uint8_t * p_ota_codec_config,const tA2DP_ENCODER_INIT_PEER_PARAMS * p_peer_params,uint8_t * p_result_codec_config,bool * p_restart_input,bool * p_restart_output,bool * p_config_updated)196 bool A2dpCodecs::setCodecOtaConfig(
197 const uint8_t* p_ota_codec_config,
198 const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
199 uint8_t* p_result_codec_config, bool* p_restart_input,
200 bool* p_restart_output, bool* p_config_updated) {
201 inc_func_call_count(__func__);
202 return false;
203 }
setCodecUserConfig(const btav_a2dp_codec_config_t & codec_user_config,const tA2DP_ENCODER_INIT_PEER_PARAMS * p_peer_params,const uint8_t * p_peer_sink_capabilities,uint8_t * p_result_codec_config,bool * p_restart_input,bool * p_restart_output,bool * p_config_updated)204 bool A2dpCodecs::setCodecUserConfig(
205 const btav_a2dp_codec_config_t& codec_user_config,
206 const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
207 const uint8_t* p_peer_sink_capabilities, uint8_t* p_result_codec_config,
208 bool* p_restart_input, bool* p_restart_output, bool* p_config_updated) {
209 inc_func_call_count(__func__);
210 return false;
211 }
setPeerSinkCodecCapabilities(const uint8_t * p_peer_codec_capabilities)212 bool A2dpCodecs::setPeerSinkCodecCapabilities(
213 const uint8_t* p_peer_codec_capabilities) {
214 inc_func_call_count(__func__);
215 return false;
216 }
setPeerSourceCodecCapabilities(const uint8_t * p_peer_codec_capabilities)217 bool A2dpCodecs::setPeerSourceCodecCapabilities(
218 const uint8_t* p_peer_codec_capabilities) {
219 inc_func_call_count(__func__);
220 return false;
221 }
setSinkCodecConfig(const uint8_t * p_peer_codec_info,bool is_capability,uint8_t * p_result_codec_config,bool select_current_codec)222 bool A2dpCodecs::setSinkCodecConfig(const uint8_t* p_peer_codec_info,
223 bool is_capability,
224 uint8_t* p_result_codec_config,
225 bool select_current_codec) {
226 inc_func_call_count(__func__);
227 return false;
228 }
getCodecAudioConfig()229 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecAudioConfig() {
230 inc_func_call_count(__func__);
231 btav_a2dp_codec_config_t config;
232 return config;
233 }
getCodecCapability()234 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecCapability() {
235 inc_func_call_count(__func__);
236 btav_a2dp_codec_config_t config;
237 return config;
238 }
getCodecConfig()239 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecConfig() {
240 inc_func_call_count(__func__);
241 btav_a2dp_codec_config_t config;
242 return config;
243 }
getCodecLocalCapability()244 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecLocalCapability() {
245 inc_func_call_count(__func__);
246 btav_a2dp_codec_config_t config;
247 return config;
248 }
getCodecSelectableCapability()249 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecSelectableCapability() {
250 inc_func_call_count(__func__);
251 btav_a2dp_codec_config_t config;
252 return config;
253 }
getCodecUserConfig()254 btav_a2dp_codec_config_t A2dpCodecConfig::getCodecUserConfig() {
255 inc_func_call_count(__func__);
256 btav_a2dp_codec_config_t config;
257 return config;
258 }
A2DP_SinkCodecIndex(const uint8_t * p_codec_info)259 btav_a2dp_codec_index_t A2DP_SinkCodecIndex(const uint8_t* p_codec_info) {
260 inc_func_call_count(__func__);
261 return BTAV_A2DP_CODEC_INDEX_MAX;
262 }
A2DP_SourceCodecIndex(const uint8_t * p_codec_info)263 btav_a2dp_codec_index_t A2DP_SourceCodecIndex(const uint8_t* p_codec_info) {
264 inc_func_call_count(__func__);
265 return BTAV_A2DP_CODEC_INDEX_MAX;
266 }
A2DP_CodecIndexStr(btav_a2dp_codec_index_t codec_index)267 const char* A2DP_CodecIndexStr(btav_a2dp_codec_index_t codec_index) {
268 inc_func_call_count(__func__);
269 return nullptr;
270 }
A2DP_CodecName(const uint8_t * p_codec_info)271 const char* A2DP_CodecName(const uint8_t* p_codec_info) {
272 inc_func_call_count(__func__);
273 return nullptr;
274 }
A2DP_GetDecoderInterface(const uint8_t * p_codec_info)275 const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterface(
276 const uint8_t* p_codec_info) {
277 inc_func_call_count(__func__);
278 return nullptr;
279 }
A2DP_GetEncoderInterface(const uint8_t * p_codec_info)280 const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterface(
281 const uint8_t* p_codec_info) {
282 inc_func_call_count(__func__);
283 return nullptr;
284 }
A2DP_GetSinkTrackChannelType(const uint8_t * p_codec_info)285 int A2DP_GetSinkTrackChannelType(const uint8_t* p_codec_info) {
286 inc_func_call_count(__func__);
287 return 0;
288 }
A2DP_GetTrackBitsPerSample(const uint8_t * p_codec_info)289 int A2DP_GetTrackBitsPerSample(const uint8_t* p_codec_info) {
290 inc_func_call_count(__func__);
291 return 0;
292 }
A2DP_GetTrackChannelCount(const uint8_t * p_codec_info)293 int A2DP_GetTrackChannelCount(const uint8_t* p_codec_info) {
294 inc_func_call_count(__func__);
295 return 0;
296 }
A2DP_GetTrackSampleRate(const uint8_t * p_codec_info)297 int A2DP_GetTrackSampleRate(const uint8_t* p_codec_info) {
298 inc_func_call_count(__func__);
299 return 0;
300 }
getTrackBitRate() const301 int A2dpCodecConfig::getTrackBitRate() const {
302 inc_func_call_count(__func__);
303 return 0;
304 }
A2DP_CodecInfoString(const uint8_t * p_codec_info)305 std::string A2DP_CodecInfoString(const uint8_t* p_codec_info) {
306 inc_func_call_count(__func__);
307 return 0;
308 }
codecBitsPerSample2Str(btav_a2dp_codec_bits_per_sample_t codec_bits_per_sample)309 std::string A2dpCodecConfig::codecBitsPerSample2Str(
310 btav_a2dp_codec_bits_per_sample_t codec_bits_per_sample) {
311 inc_func_call_count(__func__);
312 return 0;
313 }
codecChannelMode2Str(btav_a2dp_codec_channel_mode_t codec_channel_mode)314 std::string A2dpCodecConfig::codecChannelMode2Str(
315 btav_a2dp_codec_channel_mode_t codec_channel_mode) {
316 inc_func_call_count(__func__);
317 return 0;
318 }
codecConfig2Str(const btav_a2dp_codec_config_t & codec_config)319 std::string A2dpCodecConfig::codecConfig2Str(
320 const btav_a2dp_codec_config_t& codec_config) {
321 inc_func_call_count(__func__);
322 return 0;
323 }
codecSampleRate2Str(btav_a2dp_codec_sample_rate_t codec_sample_rate)324 std::string A2dpCodecConfig::codecSampleRate2Str(
325 btav_a2dp_codec_sample_rate_t codec_sample_rate) {
326 inc_func_call_count(__func__);
327 return 0;
328 }
A2DP_GetCodecType(const uint8_t * p_codec_info)329 tA2DP_CODEC_TYPE A2DP_GetCodecType(const uint8_t* p_codec_info) {
330 inc_func_call_count(__func__);
331 return 0;
332 }
A2DP_GetMediaType(const uint8_t * p_codec_info)333 uint8_t A2DP_GetMediaType(const uint8_t* p_codec_info) {
334 inc_func_call_count(__func__);
335 return 0;
336 }
getAudioBitsPerSample()337 uint8_t A2dpCodecConfig::getAudioBitsPerSample() {
338 inc_func_call_count(__func__);
339 return 0;
340 }
A2DP_InitDefaultCodec(uint8_t * p_codec_info)341 void A2DP_InitDefaultCodec(uint8_t* p_codec_info) {
342 inc_func_call_count(__func__);
343 }
debug_codec_dump(int fd)344 void A2dpCodecConfig::debug_codec_dump(int fd) {
345 inc_func_call_count(__func__);
346 }
A2DP_IotGetPeerSinkCodecType(const uint8_t * p_codec_info)347 int A2DP_IotGetPeerSinkCodecType(const uint8_t* p_codec_info) {
348 inc_func_call_count(__func__);
349 return 0;
350 }
setCodecPriority(btav_a2dp_codec_priority_t codec_priority)351 void A2dpCodecConfig::setCodecPriority(
352 btav_a2dp_codec_priority_t codec_priority) {
353 inc_func_call_count(__func__);
354 }
setDefaultCodecPriority()355 void A2dpCodecConfig::setDefaultCodecPriority() {
356 inc_func_call_count(__func__);
357 }
debug_codec_dump(int fd)358 void A2dpCodecs::debug_codec_dump(int fd) { inc_func_call_count(__func__); }
359