1 /* Copyright 2019 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #ifndef SBC_CODEC_STUB_H_
7 #define SBC_CODEC_STUB_H_
8 
9 #include <stdint.h>
10 #include <stdlib.h>
11 
12 void sbc_codec_stub_reset();
13 void set_sbc_codec_create_fail(int fail);
14 int get_sbc_codec_create_called();
15 int get_msbc_codec_create_called();
16 uint8_t get_sbc_codec_create_freq_val();
17 uint8_t get_sbc_codec_create_mode_val();
18 uint8_t get_sbc_codec_create_subbands_val();
19 uint8_t get_sbc_codec_create_alloc_val();
20 uint8_t get_sbc_codec_create_blocks_val();
21 uint8_t get_sbc_codec_create_bitpool_val();
22 int get_sbc_codec_destroy_called();
23 void set_sbc_codec_decoded_out(size_t ret);
24 void set_sbc_codec_decoded_fail(int fail);
25 void set_sbc_codec_encoded_out(size_t ret);
26 void set_sbc_codec_encoded_fail(int fail);
27 
28 struct cras_audio_codec* cras_sbc_codec_create(uint8_t freq,
29                                                uint8_t mode,
30                                                uint8_t subbands,
31                                                uint8_t alloc,
32                                                uint8_t blocks,
33                                                uint8_t bitpool);
34 struct cras_audio_codec* cras_msbc_codec_create();
35 void cras_sbc_codec_destroy(struct cras_audio_codec* codec);
36 int cras_sbc_get_codesize(struct cras_audio_codec* codec);
37 int cras_sbc_get_frame_length(struct cras_audio_codec* codec);
38 
39 #endif  // SBC_CODEC_STUB_H_
40