mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
BtAudio: Add InReadPcmData to middleware
Bug: 203490261 Test: m android.hardware.bluetooth.audio-V1-impl Change-Id: I330226ecc38368b3838c01a191b66b700a2338a7
This commit is contained in:
@@ -641,6 +641,12 @@ size_t HidlToAidlMiddleware_2_0::OutWritePcmData(
|
||||
from_session_type_2_0(session_type), buffer, bytes);
|
||||
}
|
||||
|
||||
size_t HidlToAidlMiddleware_2_0::InReadPcmData(
|
||||
const SessionType_2_0& session_type, void* buffer, size_t bytes) {
|
||||
return BluetoothAudioSessionControl::InReadPcmData(
|
||||
from_session_type_2_0(session_type), buffer, bytes);
|
||||
}
|
||||
|
||||
bool HidlToAidlMiddleware_2_0::IsAidlAvailable() {
|
||||
return BluetoothAudioSession::IsAidlAvailable();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,9 @@ class HidlToAidlMiddleware_2_0 {
|
||||
|
||||
static size_t OutWritePcmData(const SessionType_2_0& session_type,
|
||||
const void* buffer, size_t bytes);
|
||||
|
||||
static size_t InReadPcmData(const SessionType_2_0& session_type, void* buffer,
|
||||
size_t bytes);
|
||||
};
|
||||
|
||||
} // namespace audio
|
||||
|
||||
@@ -437,6 +437,9 @@ size_t BluetoothAudioSession::OutWritePcmData(const void* buffer,
|
||||
|
||||
// The control function reads stream from FMQ
|
||||
size_t BluetoothAudioSession::InReadPcmData(void* buffer, size_t bytes) {
|
||||
if (HidlToAidlMiddleware_2_0::IsAidlAvailable())
|
||||
return HidlToAidlMiddleware_2_0::InReadPcmData(session_type_, buffer,
|
||||
bytes);
|
||||
if (buffer == nullptr || !bytes) return 0;
|
||||
size_t totalRead = 0;
|
||||
int ms_timeout = kFmqReceiveTimeoutMs;
|
||||
|
||||
Reference in New Issue
Block a user