blob: 0f020b7f1d25c3ef877f5a1cd7682a7584e1df55 [file] [log] [blame]
b.liu1c1c7212023-12-22 16:35:27 +08001/*
2* mbtk_audio_internal.h
3*
4* MBTK Audio internal header.
5*
6* Author : lb
7* Date : 2023/12/20 10:13:09
8*/
9#ifndef _MBTK_AUDIO_INTERNAL_H
10#define _MBTK_AUDIO_INTERNAL_H
11#include "mbtk_audio2.h"
12#include "audio_if_api.h"
13#include "audio_if_audio_hw_mrvl.h"
14
15typedef enum {
16 AUDIO_PLAY_STATE_STOP,
17 AUDIO_PLAY_STATE_RUNNING,
18 AUDIO_PLAY_STATE_PAUSE
19} audio_play_state_enum;
20
21typedef enum {
22 AUDIO_RECORDER_STATE_STOP,
23 AUDIO_RECORDER_STATE_RUNNING,
24 AUDIO_RECORDER_STATE_PAUSE
25} audio_recorder_state_enum;
26
27typedef struct {
28 struct audio_stream_out *stream_out;
29 char buff_remain[MBTK_PCM_WB_BUF_SIZE];
30 int buff_remain_len;
31} audio_play_info_t;
32
33typedef struct {
34 struct audio_stream_in *stream_in;
35 audio_recorder_state_enum state;
36 pthread_cond_t cond;
37 pthread_mutex_t mutex;
38
39 mbtk_recorder_callback_func recorder_cb;
40} audio_recorder_info_t;
41
42typedef struct {
43 mbtk_audio_sample_rate_enum sample_rate;
44 int channel;
45 unsigned int playback_size;
46 audio_hw_device_t *audio_ahw_dev_ubus;
47
48 mbtk_audio_direction_enum direction;
b.liuf191eb72024-12-12 10:45:23 +080049
50 audio_play_info_t play;
51 audio_recorder_info_t recorder;
b.liu1c1c7212023-12-22 16:35:27 +080052} audio_inter_info_t;
53
54#endif /* _MBTK_AUDIO_INTERNAL_H */