summaryrefslogtreecommitdiff
path: root/cras/src/tests/sbc_codec_stub.h
blob: b166b399ee901c30dc924ef072af70e26c89cf98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright 2019 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SBC_CODEC_STUB_H_
#define SBC_CODEC_STUB_H_

#include <stdint.h>
#include <stdlib.h>

void sbc_codec_stub_reset();
void set_sbc_codec_create_fail(int fail);
int get_sbc_codec_create_called();
int get_msbc_codec_create_called();
uint8_t get_sbc_codec_create_freq_val();
uint8_t get_sbc_codec_create_mode_val();
uint8_t get_sbc_codec_create_subbands_val();
uint8_t get_sbc_codec_create_alloc_val();
uint8_t get_sbc_codec_create_blocks_val();
uint8_t get_sbc_codec_create_bitpool_val();
int get_sbc_codec_destroy_called();
void set_sbc_codec_decoded_out(size_t ret);
void set_sbc_codec_decoded_fail(int fail);
void set_sbc_codec_encoded_out(size_t ret);
void set_sbc_codec_encoded_fail(int fail);

struct cras_audio_codec* cras_sbc_codec_create(uint8_t freq,
                                               uint8_t mode,
                                               uint8_t subbands,
                                               uint8_t alloc,
                                               uint8_t blocks,
                                               uint8_t bitpool);
struct cras_audio_codec* cras_msbc_codec_create();
void cras_sbc_codec_destroy(struct cras_audio_codec* codec);
int cras_sbc_get_codesize(struct cras_audio_codec* codec);
int cras_sbc_get_frame_length(struct cras_audio_codec* codec);

#endif  // SBC_CODEC_STUB_H_