35 #ifndef __BT_CODEC_H__ 36 #define __BT_CODEC_H__ 206 #define BT_CODEC_MEDIA_EVENT_START (120) bt_codec_aac_t aac
AAC codec.
Definition: bt_codec.h:360
bt_codec_media_status_t bt_codec_hfp_unregister_customer_enhancement_function_callback(void)
Unregister customer enhancement callback function.
bt_codec_media_status_t bt_codec_hfp_unregister_mix_stream_out_data_callback(void)
This function unregisters the callback function for mix stream out data.
uint8_t channel_mode
b0: joint stereo, b1: stereo, b2: dual channel, b3: mono.
Definition: bt_codec.h:341
void(* bt_codec_a2dp_callback_t)(bt_media_handle_t *handle, bt_codec_media_event_t event_id)
This defines the A2DP codec callback function prototype.
Definition: bt_codec.h:406
The stream out and stream in path of HFP is to/from internal ABB.
Definition: bt_codec.h:266
bt_codec_media_status_t bt_codec_hfp_set_customer_enhanced_stream_in_data(void *buffer, uint32_t sample_count)
set enhanced stream in data stream in.
bt_codec_media_status_t bt_codec_a2dp_close(bt_media_handle_t *handle)
This function closes the A2DP audio codec.
uint8_t bt_a2dp_role_t
The type of A2DP role.
Definition: bt_a2dp.h:229
void * param
Extended parameter or information.
Definition: bt_codec.h:286
bt_codec_media_status_t bt_codec_hfp_register_mix_stream_out_data_callback(bt_codec_hfp_mix_stream_out_data_callback_t callback, void *user_data)
This function registers a callback function for mixing stream out data.
uint8_t * buffer
Buffer pointer.
Definition: bt_codec.h:397
bt_codec_media_status_t bt_codec_hfp_get_stream_out_sample_count(uint32_t *sample_count)
Query the sample_count of stream in buffer.
uint8_t subband_num
b0: 8, b1: 4.
Definition: bt_codec.h:338
int32_t(* bt_codec_get_data)(volatile uint16_t *buf, uint32_t len)
A2DP direct access to DSP buffer function type.
Definition: bt_codec.h:290
bt_codec_media_status_t bt_codec_hfp_get_mix_stream_out_sample_count(uint32_t *sample_count)
This function queries the sample_count of mix stream out buffer.
uint8_t bt_hfp_audio_codec_type_t
This structure defines the HFP codec type.
Definition: bt_hfp.h:257
int32_t buffer_size
Size of the ring buffer.
Definition: bt_codec.h:283
uint8_t channels
b0: 2, b1: 1.
Definition: bt_codec.h:350
uint8_t max_bit_pool
The maximum bit pool.
Definition: bt_codec.h:336
bt_codec_media_status_t bt_codec_hfp_read_stream_out(void *buffer, uint32_t sample_count)
Recieve data from stream in.
The A2DP audio codec bitstream information structure.
Definition: bt_codec.h:390
bt_codec_media_status_t bt_codec_hfp_unregister_get_stream_in_data_callback(void)
This function unregisters the callback function that receives streamed in data.
bt_media_handle_t * bt_codec_hfp_open(bt_codec_hfp_callback_t callback, const bt_codec_hfp_audio_t *param)
This function opens the HFP audio codec.
bt_hfp_audio_codec_type_t type
1: CVSD, 2: mSBC.
Definition: bt_codec.h:380
bt_codec_hfp_device_path_t
Bluetooth codec HFP device path.
Definition: bt_codec.h:265
bt_codec_media_status_t bt_codec_a2dp_aws_set_flag(bt_media_handle_t *handle, bool flag)
This function sets the advanced wireless stereo flag.
bool vbr
Indicates if VBR is supported or not.
Definition: bt_codec.h:348
bt_codec_media_status_t bt_codec_hfp_get_stream_in_sample_count(uint32_t *sample_count)
This function queries the sample_count of the streamed in buffer.
bt_codec_media_status_t bt_codec_a2dp_aws_fill_silence_frame(bt_media_handle_t *handle, bt_codec_a2dp_buffer_t *data, uint32_t frame_count)
This function fills the advanced wireless stereo silence frames to target data buffer.
bt_codec_sbc_t sbc
SBC codec.
Definition: bt_codec.h:359
bt_codec_media_status_t bt_codec_a2dp_aws_set_clock_skew(bool flag)
This function sets the clock skew flag.
uint8_t sample_rate
b0: 48000, b1: 44100, b2: 32000, b3: 16000.
Definition: bt_codec.h:340
bt_codec_capability_t codec_cap
The capabilities of Bluetooth codec.
Definition: bt_codec.h:374
This structure defines the A2DP codec capability.
Definition: bt_codec.h:366
bt_codec_media_status_t bt_codec_hfp_unregister_get_stream_out_data_callback(void)
Unregister the callback function for getting stream out data.
bt_codec_media_status_t bt_codec_hfp_register_get_stream_out_data_callback(bt_codec_hfp_get_stream_out_data_callback_t callback, void *user_data)
Register the callback function for get stream out data.
uint8_t min_bit_pool
The minimum bit pool.
Definition: bt_codec.h:335
bt_a2dp_codec_type_t type
Codec type.
Definition: bt_codec.h:367
uint32_t sample_count
One pair of L / R counts as one sample.
Definition: bt_codec.h:385
This structure defines the AAC codec details.
Definition: bt_codec.h:347
int32_t write
Index of the ring buffer to write the data.
Definition: bt_codec.h:284
void(* bt_codec_hfp_customer_enhancement_function_callback_t)(void *user_data)
This defines the HFP codec hfp customer enhancement callback function prototype.
Definition: bt_codec.h:438
bt_codec_media_status_t bt_codec_hfp_register_customer_enhancement_function_callback(bt_codec_hfp_customer_enhancement_function_callback_t callback, void *user_data)
Register customer enhancement function.
uint8_t bt_a2dp_codec_type_t
The type of A2DP codec.
Definition: bt_a2dp.h:219
This structure defines the A2DP codec.
Definition: bt_codec.h:373
uint32_t sampling_rate
Sampling rate, unit: Hz.
Definition: bt_codec.h:386
uint32_t bit_rate
Constant/peak bits per second in 23 bit UiMsbf.
Definition: bt_codec.h:352
void(* bt_codec_hfp_get_stream_out_data_callback_t)(bt_codec_media_event_t event, void *user_data)
This defines the HFP codec hfp mix stream out callback function prototype.
Definition: bt_codec.h:431
uint8_t alloc_method
b0: loudness, b1: SNR.
Definition: bt_codec.h:339
uint8_t object_type
b4: M4-scalable, b5: M4-LTP, b6: M4-LC, b7: M2-LC.
Definition: bt_codec.h:349
bt_codec_t codec
Codec information.
Definition: bt_codec.h:368
bt_a2dp_role_t role
The Bluetooth codec roles.
Definition: bt_codec.h:375
int32_t(* bt_codec_get_data_count)(void)
A2DP get data count function type.
Definition: bt_codec.h:293
The stream out and stream in path of HFP is from MASTER I2S, note stream out also can be to internal ...
Definition: bt_codec.h:267
bt_codec_media_status_t bt_codec_hfp_mix_stream_out(bt_codec_media_hfp_mix_stream_out_method_t mix_method, void *buffer, uint32_t sample_count)
This function mixes a tone to the stream out tone.
Not supported.
Definition: bt_codec.h:268
struct _bt_media_handle_t bt_media_handle_t
A2DP audio handle structure type.
bt_codec_media_status_t bt_codec_a2dp_set_sw_aac_flag(bool flag)
This function sets the software AAC DECODER for Bluetooth A2DP.
void(* bt_codec_hfp_get_stream_in_data_callback_t)(bt_codec_media_event_t event, void *user_data)
This defines the HFP codec HFP mix stream in callback function prototype.
Definition: bt_codec.h:424
void(* bt_codec_hfp_mix_stream_out_data_callback_t)(bt_codec_media_event_t event, void *user_data)
This defines the HFP codec HFP mix stream out callback function prototype.
Definition: bt_codec.h:415
bt_codec_media_status_t bt_codec_a2dp_aws_get_silence_frame_information(bt_media_handle_t *handle, bt_codec_a2dp_bitstream_t *information)
This function gets the advanced wireless stereo silence frame information for one silence frame...
bt_codec_media_status_t bt_codec_a2dp_aws_set_clock_skew_compensation_value(bt_media_handle_t *handle, int32_t sample_count)
This function sets the advanced wireless stereo clock skew compensation value.
int32_t read
Index of the ring buffer to read the data.
Definition: bt_codec.h:285
bt_codec_media_status_t bt_codec_a2dp_aws_get_consumed_data_count(bt_media_handle_t *handle, bt_codec_a2dp_data_count_t *information)
This function gets the advanced wireless stereo consumed data count.
bt_codec_media_status_t bt_codec_hfp_set_device_path(bt_codec_hfp_device_path_t device_path)
This function sets the HFP device path.
bool bt_codec_a2dp_get_sw_aac_flag(void)
This function gets the software AAC DECODER for Bluetooth A2DP.
This union defines the A2DP codec.
Definition: bt_codec.h:358
uint8_t * buffer_base
Pointer to the ring buffer.
Definition: bt_codec.h:282
bt_codec_media_status_t bt_codec_hfp_close(bt_media_handle_t *handle)
This function closes the HFP codec.
This structure defines the SBC codec details.
Definition: bt_codec.h:334
bt_codec_media_status_t bt_codec_a2dp_aws_parse_data_information(bt_media_handle_t *handle, bt_codec_a2dp_buffer_t *data, bt_codec_a2dp_bitstream_t *information)
This function parses the advanced wireless stereo packet data information.
bt_codec_media_status_t bt_codec_hfp_register_get_stream_in_data_callback(bt_codec_hfp_get_stream_in_data_callback_t callback, void *user_data)
This function registers the callback function that receives streamed in data.
The A2DP audio codec buffer information structure.
Definition: bt_codec.h:396
bt_codec_media_status_t bt_codec_hfp_get_customer_enhanced_stream_in_sample_count(uint32_t *sample_count)
Query the sample count of enhanced stream in buffer that customer need feedback.
This structure defines the HFP codec.
Definition: bt_codec.h:379
bt_media_handle_t * bt_codec_a2dp_open(bt_codec_a2dp_callback_t callback, const bt_codec_a2dp_audio_t *param)
This function opens the A2DP audio codec.
uint32_t sample_count
One pair of L / R counts as one sample.
Definition: bt_codec.h:391
uint16_t sample_rate
b0~b11: 96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000.
Definition: bt_codec.h:351
uint32_t byte_count
Byte count.
Definition: bt_codec.h:392
uint8_t block_length
b0: 16, b1: 12, b2: 8, b3: 4.
Definition: bt_codec.h:337
void(* bt_codec_hfp_callback_t)(bt_media_handle_t *handle, bt_codec_media_event_t event_id)
This defines the HFP codec callback function prototype.
Definition: bt_codec.h:445
bt_codec_media_status_t bt_codec_a2dp_aws_set_initial_sync(bt_media_handle_t *handle)
This function sets the advanced wireless stereo initial synchronization.
This structure defines the shared buffer structure.
Definition: bt_codec.h:281
uint32_t byte_count
Buffer byte count.
Definition: bt_codec.h:398
bt_codec_media_status_t bt_codec_hfp_read_stream_in(void *buffer, uint32_t sample_count)
This function receives the streamed in data.
The A2DP audio codec data count structure.
Definition: bt_codec.h:384
bt_codec_media_status_t bt_codec_a2dp_aws_get_clock_skew_status(bt_media_handle_t *handle, bt_codec_aws_clock_skew_status_t *status)
This function gets the advanced wireless stereo clock skew status.
bt_codec_media_status_t bt_codec_a2dp_aws_get_audio_latency(bt_media_handle_t *handle, uint32_t sampling_rate, uint32_t *latency_us)
This function gets the advanced wireless stereo audio latency.