Loading system/audio_bluetooth_hw/device_port_proxy.cc +15 −0 Original line number Original line Diff line number Diff line Loading @@ -535,6 +535,21 @@ void BluetoothAudioPort::UpdateMetadata( source_metadata); source_metadata); } } void BluetoothAudioPort::UpdateSinkMetadata( const sink_metadata* sink_metadata) const { if (!in_use()) { LOG(ERROR) << __func__ << ": BluetoothAudioPort is not in use"; return; } LOG(DEBUG) << __func__ << ": session_type=" << toString(session_type_) << ", cookie=" << StringPrintf("%#hx", cookie_) << ", state=" << state_ << ", " << sink_metadata->track_count << " track(s)"; if (sink_metadata->track_count == 0) return; BluetoothAudioSessionControl_2_2::UpdateSinkMetadata(session_type_, sink_metadata); } BluetoothStreamState BluetoothAudioPort::GetState() const { return state_; } BluetoothStreamState BluetoothAudioPort::GetState() const { return state_; } void BluetoothAudioPort::SetState(BluetoothStreamState state) { void BluetoothAudioPort::SetState(BluetoothStreamState state) { Loading system/audio_bluetooth_hw/device_port_proxy.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -78,6 +78,8 @@ class BluetoothAudioPort { // source has been changed. // source has been changed. void UpdateMetadata(const source_metadata* source_metadata) const; void UpdateMetadata(const source_metadata* source_metadata) const; void UpdateSinkMetadata(const sink_metadata* sink_metadata) const; // Return the current BluetoothStreamState // Return the current BluetoothStreamState BluetoothStreamState GetState() const; BluetoothStreamState GetState() const; Loading system/audio_bluetooth_hw/stream_apis.cc +9 −2 Original line number Original line Diff line number Diff line Loading @@ -1143,9 +1143,16 @@ static int in_set_microphone_field_dimension( static void in_update_sink_metadata(struct audio_stream_in* stream, static void in_update_sink_metadata(struct audio_stream_in* stream, const struct sink_metadata* sink_metadata) { const struct sink_metadata* sink_metadata) { LOG(INFO) << __func__; if (sink_metadata == nullptr || sink_metadata->track_count == 0) { return; } const auto* in = reinterpret_cast<const BluetoothStreamIn*>(stream); const auto* in = reinterpret_cast<const BluetoothStreamIn*>(stream); LOG(VERBOSE) << __func__ LOG(INFO) << __func__ << ": state=" << in->bluetooth_input_.GetState() << ", " << ": NOT HANDLED! state=" << in->bluetooth_input_.GetState(); << sink_metadata->track_count << " track(s)"; in->bluetooth_input_.UpdateSinkMetadata(sink_metadata); } } int adev_open_input_stream(struct audio_hw_device* dev, int adev_open_input_stream(struct audio_hw_device* dev, Loading system/audio_hal_interface/client_interface.cc +12 −3 Original line number Original line Diff line number Diff line Loading @@ -17,14 +17,15 @@ #define LOG_TAG "BTAudioClientIf" #define LOG_TAG "BTAudioClientIf" #include "client_interface.h" #include "client_interface.h" #include "hal_version_manager.h" #include <android/hardware/bluetooth/audio/2.0/IBluetoothAudioPort.h> #include <android/hardware/bluetooth/audio/2.2/IBluetoothAudioPort.h> #include <base/logging.h> #include <base/logging.h> #include <hidl/MQDescriptor.h> #include <hidl/MQDescriptor.h> #include <future> #include <future> #include "common/stop_watch_legacy.h" #include "common/stop_watch_legacy.h" #include "hal_version_manager.h" #include "osi/include/log.h" #include "osi/include/log.h" namespace bluetooth { namespace bluetooth { Loading @@ -33,8 +34,9 @@ namespace audio { using ::android::hardware::hidl_vec; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::Void; using ::android::hardware::audio::common::V5_0::SinkMetadata; using ::android::hardware::audio::common::V5_0::SourceMetadata; using ::android::hardware::audio::common::V5_0::SourceMetadata; using ::android::hardware::bluetooth::audio::V2_0::IBluetoothAudioPort; using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort; using ::bluetooth::common::StopWatchLegacy; using ::bluetooth::common::StopWatchLegacy; using DataMQ = ::android::hardware::MessageQueue< using DataMQ = ::android::hardware::MessageQueue< Loading Loading @@ -156,6 +158,13 @@ class BluetoothAudioPortImpl : public IBluetoothAudioPort { return Void(); return Void(); } } Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override { StopWatchLegacy stop_watch(__func__); LOG(INFO) << __func__ << ": " << sinkMetadata.tracks.size() << " track(s)"; // TODO: pass the metadata up to transport_instance and LE Audio return Void(); } private: private: IBluetoothTransportInstance* transport_instance_; IBluetoothTransportInstance* transport_instance_; const android::sp<IBluetoothAudioProvider> provider_; const android::sp<IBluetoothAudioProvider> provider_; Loading system/audio_hal_interface/client_interface.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ namespace bluetooth { namespace bluetooth { namespace audio { namespace audio { using ::android::hardware::bluetooth::audio::V2_0::IBluetoothAudioPort; using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort; using AudioCapabilities = using AudioCapabilities = ::android::hardware::bluetooth::audio::V2_0::AudioCapabilities; ::android::hardware::bluetooth::audio::V2_0::AudioCapabilities; using AudioCapabilities_2_1 = using AudioCapabilities_2_1 = Loading Loading
system/audio_bluetooth_hw/device_port_proxy.cc +15 −0 Original line number Original line Diff line number Diff line Loading @@ -535,6 +535,21 @@ void BluetoothAudioPort::UpdateMetadata( source_metadata); source_metadata); } } void BluetoothAudioPort::UpdateSinkMetadata( const sink_metadata* sink_metadata) const { if (!in_use()) { LOG(ERROR) << __func__ << ": BluetoothAudioPort is not in use"; return; } LOG(DEBUG) << __func__ << ": session_type=" << toString(session_type_) << ", cookie=" << StringPrintf("%#hx", cookie_) << ", state=" << state_ << ", " << sink_metadata->track_count << " track(s)"; if (sink_metadata->track_count == 0) return; BluetoothAudioSessionControl_2_2::UpdateSinkMetadata(session_type_, sink_metadata); } BluetoothStreamState BluetoothAudioPort::GetState() const { return state_; } BluetoothStreamState BluetoothAudioPort::GetState() const { return state_; } void BluetoothAudioPort::SetState(BluetoothStreamState state) { void BluetoothAudioPort::SetState(BluetoothStreamState state) { Loading
system/audio_bluetooth_hw/device_port_proxy.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -78,6 +78,8 @@ class BluetoothAudioPort { // source has been changed. // source has been changed. void UpdateMetadata(const source_metadata* source_metadata) const; void UpdateMetadata(const source_metadata* source_metadata) const; void UpdateSinkMetadata(const sink_metadata* sink_metadata) const; // Return the current BluetoothStreamState // Return the current BluetoothStreamState BluetoothStreamState GetState() const; BluetoothStreamState GetState() const; Loading
system/audio_bluetooth_hw/stream_apis.cc +9 −2 Original line number Original line Diff line number Diff line Loading @@ -1143,9 +1143,16 @@ static int in_set_microphone_field_dimension( static void in_update_sink_metadata(struct audio_stream_in* stream, static void in_update_sink_metadata(struct audio_stream_in* stream, const struct sink_metadata* sink_metadata) { const struct sink_metadata* sink_metadata) { LOG(INFO) << __func__; if (sink_metadata == nullptr || sink_metadata->track_count == 0) { return; } const auto* in = reinterpret_cast<const BluetoothStreamIn*>(stream); const auto* in = reinterpret_cast<const BluetoothStreamIn*>(stream); LOG(VERBOSE) << __func__ LOG(INFO) << __func__ << ": state=" << in->bluetooth_input_.GetState() << ", " << ": NOT HANDLED! state=" << in->bluetooth_input_.GetState(); << sink_metadata->track_count << " track(s)"; in->bluetooth_input_.UpdateSinkMetadata(sink_metadata); } } int adev_open_input_stream(struct audio_hw_device* dev, int adev_open_input_stream(struct audio_hw_device* dev, Loading
system/audio_hal_interface/client_interface.cc +12 −3 Original line number Original line Diff line number Diff line Loading @@ -17,14 +17,15 @@ #define LOG_TAG "BTAudioClientIf" #define LOG_TAG "BTAudioClientIf" #include "client_interface.h" #include "client_interface.h" #include "hal_version_manager.h" #include <android/hardware/bluetooth/audio/2.0/IBluetoothAudioPort.h> #include <android/hardware/bluetooth/audio/2.2/IBluetoothAudioPort.h> #include <base/logging.h> #include <base/logging.h> #include <hidl/MQDescriptor.h> #include <hidl/MQDescriptor.h> #include <future> #include <future> #include "common/stop_watch_legacy.h" #include "common/stop_watch_legacy.h" #include "hal_version_manager.h" #include "osi/include/log.h" #include "osi/include/log.h" namespace bluetooth { namespace bluetooth { Loading @@ -33,8 +34,9 @@ namespace audio { using ::android::hardware::hidl_vec; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::Void; using ::android::hardware::audio::common::V5_0::SinkMetadata; using ::android::hardware::audio::common::V5_0::SourceMetadata; using ::android::hardware::audio::common::V5_0::SourceMetadata; using ::android::hardware::bluetooth::audio::V2_0::IBluetoothAudioPort; using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort; using ::bluetooth::common::StopWatchLegacy; using ::bluetooth::common::StopWatchLegacy; using DataMQ = ::android::hardware::MessageQueue< using DataMQ = ::android::hardware::MessageQueue< Loading Loading @@ -156,6 +158,13 @@ class BluetoothAudioPortImpl : public IBluetoothAudioPort { return Void(); return Void(); } } Return<void> updateSinkMetadata(const SinkMetadata& sinkMetadata) override { StopWatchLegacy stop_watch(__func__); LOG(INFO) << __func__ << ": " << sinkMetadata.tracks.size() << " track(s)"; // TODO: pass the metadata up to transport_instance and LE Audio return Void(); } private: private: IBluetoothTransportInstance* transport_instance_; IBluetoothTransportInstance* transport_instance_; const android::sp<IBluetoothAudioProvider> provider_; const android::sp<IBluetoothAudioProvider> provider_; Loading
system/audio_hal_interface/client_interface.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ namespace bluetooth { namespace bluetooth { namespace audio { namespace audio { using ::android::hardware::bluetooth::audio::V2_0::IBluetoothAudioPort; using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort; using AudioCapabilities = using AudioCapabilities = ::android::hardware::bluetooth::audio::V2_0::AudioCapabilities; ::android::hardware::bluetooth::audio::V2_0::AudioCapabilities; using AudioCapabilities_2_1 = using AudioCapabilities_2_1 = Loading