blob: 09b2b54f464af2f8c99ad2be05de10e3dc6963d7 [file] [log] [blame]
Grzegorz Kolodziejczykb5f2d232019-10-24 12:31:20 +02001/*
2 * Copyright 2020 HIMSA II K/S - www.himsa.com. Represented by EHIMA -
3 * www.ehima.com
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include <android/hardware/bluetooth/audio/2.1/types.h>
21#include <fmq/MessageQueue.h>
22#include <hidl/MQDescriptor.h>
23
24#include "BluetoothAudioProvider.h"
25
26namespace android {
27namespace hardware {
28namespace bluetooth {
29namespace audio {
30namespace V2_1 {
31namespace implementation {
32
33using ::android::hardware::kSynchronizedReadWrite;
34using ::android::hardware::MessageQueue;
35
36using DataMQ = MessageQueue<uint8_t, kSynchronizedReadWrite>;
37
38class LeAudioAudioProvider : public BluetoothAudioProvider {
39 public:
40 LeAudioAudioProvider();
41
42 bool isValid(const SessionType& sessionType) override;
43 bool isValid(const V2_0::SessionType& sessionType) override;
44
45 Return<void> startSession_2_1(const sp<V2_0::IBluetoothAudioPort>& hostIf,
46 const AudioConfiguration& audioConfig,
47 startSession_cb _hidl_cb) override;
48
49 private:
50 /** queue for software encodec/decoded audio data */
51 std::unique_ptr<DataMQ> mDataMQ;
52
53 Return<void> onSessionReady(startSession_cb _hidl_cb) override;
54};
55
56class LeAudioOutputAudioProvider : public LeAudioAudioProvider {
57 public:
58 LeAudioOutputAudioProvider();
59};
60
61class LeAudioInputAudioProvider : public LeAudioAudioProvider {
62 public:
63 LeAudioInputAudioProvider();
64};
65
66} // namespace implementation
67} // namespace V2_1
68} // namespace audio
69} // namespace bluetooth
70} // namespace hardware
71} // namespace android