MT2523 API Reference  LinkIt SDK v4
_bt_media_handle_t Struct Reference

A2DP audio handle structure type. More...

#include <bt_codec.h>

Data Fields

bt_codec_state_t state
 The Bluetooth codec state. More...
 
bt_audio_buffer_t buffer_info
 The shared buffer information for the Bluetooth codec. More...
 
bool underflow
 The Bluetooth codec data underflow occurred. More...
 
bool waiting
 The Bluetooth codec is waiting to fill data. More...
 
uint16_t audio_id
 The audio ID of the Bluetooth codec. More...
 
void(* handler )(struct _bt_media_handle_t *handle, bt_codec_media_event_t event_id)
 The Bluetooth codec handler. More...
 
void(* set_buffer )(struct _bt_media_handle_t *handle, uint8_t *buffer, uint32_t length)
 Set the shared buffer for bitstream. More...
 
void(* set_get_data_function )(struct _bt_media_handle_t *handle, bt_codec_get_data func)
 Set the callback function for bitstream. More...
 
void(* set_get_data_count_function )(struct _bt_media_handle_t *handle, bt_codec_get_data_count func)
 Set the callback function for bitstream. More...
 
void(* get_write_buffer )(struct _bt_media_handle_t *handle, uint8_t **buffer, uint32_t *length)
 Get the available length to write into a shared buffer and a pointer to the shared buffer. More...
 
void(* get_read_buffer )(struct _bt_media_handle_t *handle, uint8_t **buffer, uint32_t *length)
 Get the available length to read from a shared buffer and a pointer to the shared buffer. More...
 
void(* write_data_done )(struct _bt_media_handle_t *handle, uint32_t length)
 Update the write pointer to the shared buffer. More...
 
void(* finish_write_data )(struct _bt_media_handle_t *handle)
 Indicate the last data transfer. More...
 
void(* reset_share_buffer )(struct _bt_media_handle_t *handle)
 Reset the shared buffer's information. More...
 
void(* read_data_done )(struct _bt_media_handle_t *handle, uint32_t length)
 Update the read pointer to the shared buffer. More...
 
int32_t(* get_free_space )(struct _bt_media_handle_t *handle)
 Get the free space length available in the shared buffer. More...
 
int32_t(* get_data_count )(struct _bt_media_handle_t *handle)
 Get the available data amount of the shared buffer. More...
 
bt_codec_get_data directly_access_dsp_function
 Set function to access DSP buffer directly. More...
 
bt_codec_get_data_count get_data_count_function
 Set function to get available data amount of the uplayer total buffer size. More...
 
bt_codec_media_status_t(* play )(struct _bt_media_handle_t *handle)
 The Bluetooth codec play function. More...
 
bt_codec_media_status_t(* process )(struct _bt_media_handle_t *handle, bt_codec_media_event_t event_id)
 The Bluetooth codec process function. More...
 
bt_codec_media_status_t(* stop )(struct _bt_media_handle_t *handle)
 The Bluetooth codec stop function. More...
 

Detailed Description

A2DP audio handle structure type.

Field Documentation

uint16_t audio_id

The audio ID of the Bluetooth codec.

bt_audio_buffer_t buffer_info

The shared buffer information for the Bluetooth codec.

bt_codec_get_data directly_access_dsp_function

Set function to access DSP buffer directly.

void(* finish_write_data) (struct _bt_media_handle_t *handle)

Indicate the last data transfer.

int32_t(* get_data_count) (struct _bt_media_handle_t *handle)

Get the available data amount of the shared buffer.

bt_codec_get_data_count get_data_count_function

Set function to get available data amount of the uplayer total buffer size.

int32_t(* get_free_space) (struct _bt_media_handle_t *handle)

Get the free space length available in the shared buffer.

void(* get_read_buffer) (struct _bt_media_handle_t *handle, uint8_t **buffer, uint32_t *length)

Get the available length to read from a shared buffer and a pointer to the shared buffer.

void(* get_write_buffer) (struct _bt_media_handle_t *handle, uint8_t **buffer, uint32_t *length)

Get the available length to write into a shared buffer and a pointer to the shared buffer.

void(* handler) (struct _bt_media_handle_t *handle, bt_codec_media_event_t event_id)

The Bluetooth codec handler.

bt_codec_media_status_t(* play) (struct _bt_media_handle_t *handle)

The Bluetooth codec play function.

bt_codec_media_status_t(* process) (struct _bt_media_handle_t *handle, bt_codec_media_event_t event_id)

The Bluetooth codec process function.

void(* read_data_done) (struct _bt_media_handle_t *handle, uint32_t length)

Update the read pointer to the shared buffer.

void(* reset_share_buffer) (struct _bt_media_handle_t *handle)

Reset the shared buffer's information.

void(* set_buffer) (struct _bt_media_handle_t *handle, uint8_t *buffer, uint32_t length)

Set the shared buffer for bitstream.

The audio streaming data can be filled through a shared buffer or through a callback function.

void(* set_get_data_count_function) (struct _bt_media_handle_t *handle, bt_codec_get_data_count func)

Set the callback function for bitstream.

The amount of streaming data can be queried.

void(* set_get_data_function) (struct _bt_media_handle_t *handle, bt_codec_get_data func)

Set the callback function for bitstream.

The audio streaming data can be filled through a shared buffer or through a callback function.

The Bluetooth codec state.

bt_codec_media_status_t(* stop) (struct _bt_media_handle_t *handle)

The Bluetooth codec stop function.

bool underflow

The Bluetooth codec data underflow occurred.

bool waiting

The Bluetooth codec is waiting to fill data.

void(* write_data_done) (struct _bt_media_handle_t *handle, uint32_t length)

Update the write pointer to the shared buffer.


The documentation for this struct was generated from the following file: