diff options
author | Cheney Ni <cheneyni@google.com> | 2022-03-03 00:12:48 +0800 |
---|---|---|
committer | Cheney Ni <cheneyni@google.com> | 2022-03-08 11:55:41 +0800 |
commit | 6ecbc76603672e88007479c1a2d395a477799d14 (patch) | |
tree | a396fcb852953842c302d1f20398c9502554985c /bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h | |
parent | 90019d46c2fd7009677e5e8b6c1b1b0042cb38af (diff) |
SpatialAudio: Export LatencyMode functions to BluetoothAudioSession
BluetoothAudioSession utility supports latency control functions, so
audio_bluetooth_hw can get / set the LatencyMode easily.
Bug: 214615268
Bug: 218708371
Test: build
Tag: #feature
Change-Id: Ia85581c74fc91f406309539755d60d36c173f5e0
Diffstat (limited to 'bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h')
-rw-r--r-- | bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h index 451a31fb7e..5b838b0b3f 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSessionControl.h @@ -98,11 +98,12 @@ class BluetoothAudioSessionControl { stop * stream, to check position, and to update metadata. ***/ - static bool StartStream(const SessionType& session_type) { + static bool StartStream(const SessionType& session_type, + bool low_latency = false) { std::shared_ptr<BluetoothAudioSession> session_ptr = BluetoothAudioSessionInstance::GetSessionInstance(session_type); if (session_ptr != nullptr) { - return session_ptr->StartStream(); + return session_ptr->StartStream(low_latency); } return false; } @@ -154,6 +155,25 @@ class BluetoothAudioSessionControl { } } + static std::vector<LatencyMode> GetSupportedLatencyModes( + const SessionType& session_type) { + std::shared_ptr<BluetoothAudioSession> session_ptr = + BluetoothAudioSessionInstance::GetSessionInstance(session_type); + if (session_ptr != nullptr) { + return session_ptr->GetSupportedLatencyModes(); + } + return std::vector<LatencyMode>(); + } + + static void SetLatencyMode(const SessionType& session_type, + const LatencyMode& latency_mode) { + std::shared_ptr<BluetoothAudioSession> session_ptr = + BluetoothAudioSessionInstance::GetSessionInstance(session_type); + if (session_ptr != nullptr) { + session_ptr->SetLatencyMode(latency_mode); + } + } + /*** * The control API writes stream to FMQ ***/ @@ -185,4 +205,4 @@ class BluetoothAudioSessionControl { } // namespace bluetooth } // namespace hardware } // namespace android -} // namespace aidl
\ No newline at end of file +} // namespace aidl |