b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 15 | typedef enum { |
| 16 | AUDIO_PLAY_STATE_STOP, |
| 17 | AUDIO_PLAY_STATE_RUNNING, |
| 18 | AUDIO_PLAY_STATE_PAUSE |
| 19 | } audio_play_state_enum; |
| 20 | |
| 21 | typedef enum { |
| 22 | AUDIO_RECORDER_STATE_STOP, |
| 23 | AUDIO_RECORDER_STATE_RUNNING, |
| 24 | AUDIO_RECORDER_STATE_PAUSE |
| 25 | } audio_recorder_state_enum; |
| 26 | |
| 27 | typedef 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 | |
| 33 | typedef 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 | |
| 42 | typedef 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.liu | f191eb7 | 2024-12-12 10:45:23 +0800 | [diff] [blame] | 49 | |
| 50 | audio_play_info_t play; |
| 51 | audio_recorder_info_t recorder; |
b.liu | 1c1c721 | 2023-12-22 16:35:27 +0800 | [diff] [blame] | 52 | } audio_inter_info_t; |
| 53 | |
| 54 | #endif /* _MBTK_AUDIO_INTERNAL_H */ |