Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82c341fb authored by More Kuo's avatar More Kuo
Browse files

Dynamic Audio Buffer (3/3)

Handle the dynamic audio buffer in the BT stack:
1. Send HCI VSC command to the controller.
2. Receive HCI VSC event from the controller.
3. Communicate with framework.

Bug: 163968696
Tag: #feature
Test: Run dynamic audio buffer test
Change-Id: I6a699c2c24b714ce76d1fad858574f2438b64262
parent 0a09d568
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
package android.bluetooth;

parcelable BufferConstraints;
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.bluetooth;
import android.bluetooth.BluetoothCodecConfig;
import android.bluetooth.BluetoothCodecStatus;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BufferConstraints;

/**
 * APIs for Bluetooth A2DP service
@@ -52,5 +53,8 @@ interface IBluetoothA2dp {
    int supportsOptionalCodecs(in BluetoothDevice device);
    int getOptionalCodecsEnabled(in BluetoothDevice device);
    oneway void setOptionalCodecsEnabled(in BluetoothDevice device, int value);
    int getDynamicBufferSupport();
    BufferConstraints getBufferConstraints();
    boolean setBufferMillis(int codec, int size);
    int getPriority(in BluetoothDevice device);
}
+4 −0
Original line number Diff line number Diff line
@@ -126,4 +126,8 @@ BT_HDR* btif_a2dp_source_audio_readbuf(void);
// information.
void btif_a2dp_source_debug_dump(int fd);

// Set the dynamic audio buffer size
void btif_a2dp_source_set_dynamic_audio_buffer_size(
    uint8_t dynamic_audio_buffer_size);

#endif /* BTIF_A2DP_SOURCE_H */
+11 −0
Original line number Diff line number Diff line
@@ -378,4 +378,15 @@ bt_status_t btif_config_hci_snoop_log(uint8_t enable);
 ******************************************************************************/
void btif_debug_bond_event_dump(int fd);

/*******************************************************************************
 *
 * Function         btif_set_dynamic_audio_buffer_size
 *
 * Description     Set dynamic audio buffer size
 *
 * Returns          BT_STATUS_SUCCESS on success
 *
 ******************************************************************************/
bt_status_t btif_set_dynamic_audio_buffer_size(int codec, int size);

#endif /* BTIF_API_H */
+7 −0
Original line number Diff line number Diff line
@@ -216,4 +216,11 @@ bool btif_av_is_a2dp_offload_running(void);
 */
bool btif_av_is_peer_silenced(const RawAddress& peer_address);

/**
 * Set the dynamic audio buffer size
 *
 * @param dynamic_audio_buffer_size to set
 */
void btif_av_set_dynamic_audio_buffer_size(uint8_t dynamic_audio_buffer_size);

#endif /* BTIF_AV_H */
Loading