Loading system/btif/src/btif_av.cc +7 −7 Original line number Original line Diff line number Diff line Loading @@ -346,7 +346,8 @@ class BtifAvSource { bt_status_t Init( bt_status_t Init( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, const std::vector<btav_a2dp_codec_config_t>& codec_priorities); const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference); void Cleanup(); void Cleanup(); btav_source_callbacks_t* Callbacks() { return callbacks_; } btav_source_callbacks_t* Callbacks() { return callbacks_; } Loading Loading @@ -935,7 +936,8 @@ BtifAvSource::~BtifAvSource() { CleanupAllPeers(); } bt_status_t BtifAvSource::Init( bt_status_t BtifAvSource::Init( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, const std::vector<btav_a2dp_codec_config_t>& codec_priorities) { const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference) { LOG_INFO(LOG_TAG, "%s: max_connected_audio_devices=%d", __PRETTY_FUNCTION__, LOG_INFO(LOG_TAG, "%s: max_connected_audio_devices=%d", __PRETTY_FUNCTION__, max_connected_audio_devices); max_connected_audio_devices); if (enabled_) return BT_STATUS_SUCCESS; if (enabled_) return BT_STATUS_SUCCESS; Loading @@ -954,9 +956,6 @@ bt_status_t BtifAvSource::Init( callbacks_ = callbacks; callbacks_ = callbacks; if (a2dp_offload_enabled_) { if (a2dp_offload_enabled_) { // TODO: offloading_preference is for framework preference and should be // input from upper-layer std::vector<btav_a2dp_codec_config_t> offloading_preference(0); bluetooth::audio::a2dp::update_codec_offloading_capabilities( bluetooth::audio::a2dp::update_codec_offloading_capabilities( offloading_preference); offloading_preference); } } Loading Loading @@ -2647,10 +2646,11 @@ static void bta_av_sink_media_callback(tBTA_AV_EVT event, // Initializes the AV interface for source mode // Initializes the AV interface for source mode static bt_status_t init_src( static bt_status_t init_src( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, std::vector<btav_a2dp_codec_config_t> codec_priorities) { const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference) { BTIF_TRACE_EVENT("%s", __func__); BTIF_TRACE_EVENT("%s", __func__); return btif_av_source.Init(callbacks, max_connected_audio_devices, return btif_av_source.Init(callbacks, max_connected_audio_devices, codec_priorities); codec_priorities, offloading_preference); } } // Initializes the AV interface for sink mode // Initializes the AV interface for sink mode Loading system/include/hardware/bt_av.h +4 −3 Original line number Original line Diff line number Diff line Loading @@ -303,9 +303,10 @@ typedef struct { /** /** * Register the BtAv callbacks. * Register the BtAv callbacks. */ */ bt_status_t (*init)(btav_source_callbacks_t* callbacks, bt_status_t (*init)( int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, std::vector<btav_a2dp_codec_config_t> codec_priorities); const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference); /** connect to headset */ /** connect to headset */ bt_status_t (*connect)(const RawAddress& bd_addr); bt_status_t (*connect)(const RawAddress& bd_addr); Loading system/service/hal/bluetooth_av_interface.cc +3 −1 Original line number Original line Diff line number Diff line Loading @@ -146,9 +146,11 @@ class BluetoothAvInterfaceImpl : public BluetoothAvInterface { // Right now we only support one connected audio device. // Right now we only support one connected audio device. int max_connected_audio_devices = 1; int max_connected_audio_devices = 1; std::vector<btav_a2dp_codec_config_t> offloading_preference(0); if (hal_source_iface_->init( if (hal_source_iface_->init( &av_source_callbacks, max_connected_audio_devices, &av_source_callbacks, max_connected_audio_devices, std::move(codec_priorities)) != BT_STATUS_SUCCESS) { std::move(codec_priorities), std::move(offloading_preference)) != BT_STATUS_SUCCESS) { LOG(ERROR) << "Failed to initialize HAL A2DP source interface"; LOG(ERROR) << "Failed to initialize HAL A2DP source interface"; return false; return false; } } Loading Loading
system/btif/src/btif_av.cc +7 −7 Original line number Original line Diff line number Diff line Loading @@ -346,7 +346,8 @@ class BtifAvSource { bt_status_t Init( bt_status_t Init( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, const std::vector<btav_a2dp_codec_config_t>& codec_priorities); const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference); void Cleanup(); void Cleanup(); btav_source_callbacks_t* Callbacks() { return callbacks_; } btav_source_callbacks_t* Callbacks() { return callbacks_; } Loading Loading @@ -935,7 +936,8 @@ BtifAvSource::~BtifAvSource() { CleanupAllPeers(); } bt_status_t BtifAvSource::Init( bt_status_t BtifAvSource::Init( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, const std::vector<btav_a2dp_codec_config_t>& codec_priorities) { const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference) { LOG_INFO(LOG_TAG, "%s: max_connected_audio_devices=%d", __PRETTY_FUNCTION__, LOG_INFO(LOG_TAG, "%s: max_connected_audio_devices=%d", __PRETTY_FUNCTION__, max_connected_audio_devices); max_connected_audio_devices); if (enabled_) return BT_STATUS_SUCCESS; if (enabled_) return BT_STATUS_SUCCESS; Loading @@ -954,9 +956,6 @@ bt_status_t BtifAvSource::Init( callbacks_ = callbacks; callbacks_ = callbacks; if (a2dp_offload_enabled_) { if (a2dp_offload_enabled_) { // TODO: offloading_preference is for framework preference and should be // input from upper-layer std::vector<btav_a2dp_codec_config_t> offloading_preference(0); bluetooth::audio::a2dp::update_codec_offloading_capabilities( bluetooth::audio::a2dp::update_codec_offloading_capabilities( offloading_preference); offloading_preference); } } Loading Loading @@ -2647,10 +2646,11 @@ static void bta_av_sink_media_callback(tBTA_AV_EVT event, // Initializes the AV interface for source mode // Initializes the AV interface for source mode static bt_status_t init_src( static bt_status_t init_src( btav_source_callbacks_t* callbacks, int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, std::vector<btav_a2dp_codec_config_t> codec_priorities) { const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference) { BTIF_TRACE_EVENT("%s", __func__); BTIF_TRACE_EVENT("%s", __func__); return btif_av_source.Init(callbacks, max_connected_audio_devices, return btif_av_source.Init(callbacks, max_connected_audio_devices, codec_priorities); codec_priorities, offloading_preference); } } // Initializes the AV interface for sink mode // Initializes the AV interface for sink mode Loading
system/include/hardware/bt_av.h +4 −3 Original line number Original line Diff line number Diff line Loading @@ -303,9 +303,10 @@ typedef struct { /** /** * Register the BtAv callbacks. * Register the BtAv callbacks. */ */ bt_status_t (*init)(btav_source_callbacks_t* callbacks, bt_status_t (*init)( int max_connected_audio_devices, btav_source_callbacks_t* callbacks, int max_connected_audio_devices, std::vector<btav_a2dp_codec_config_t> codec_priorities); const std::vector<btav_a2dp_codec_config_t>& codec_priorities, const std::vector<btav_a2dp_codec_config_t>& offloading_preference); /** connect to headset */ /** connect to headset */ bt_status_t (*connect)(const RawAddress& bd_addr); bt_status_t (*connect)(const RawAddress& bd_addr); Loading
system/service/hal/bluetooth_av_interface.cc +3 −1 Original line number Original line Diff line number Diff line Loading @@ -146,9 +146,11 @@ class BluetoothAvInterfaceImpl : public BluetoothAvInterface { // Right now we only support one connected audio device. // Right now we only support one connected audio device. int max_connected_audio_devices = 1; int max_connected_audio_devices = 1; std::vector<btav_a2dp_codec_config_t> offloading_preference(0); if (hal_source_iface_->init( if (hal_source_iface_->init( &av_source_callbacks, max_connected_audio_devices, &av_source_callbacks, max_connected_audio_devices, std::move(codec_priorities)) != BT_STATUS_SUCCESS) { std::move(codec_priorities), std::move(offloading_preference)) != BT_STATUS_SUCCESS) { LOG(ERROR) << "Failed to initialize HAL A2DP source interface"; LOG(ERROR) << "Failed to initialize HAL A2DP source interface"; return false; return false; } } Loading