blob: a2d03fe3f33cd01de8e84df4d773f00ed1fc5f21 [file] [log] [blame]
Josh Wu6ab53e72021-12-29 23:53:33 -08001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000019#include "A2dpOffloadCodecFactory.h"
Josh Wu6ab53e72021-12-29 23:53:33 -080020#include "BluetoothAudioProvider.h"
21
22namespace aidl {
23namespace android {
24namespace hardware {
25namespace bluetooth {
26namespace audio {
27
28class A2dpOffloadAudioProvider : public BluetoothAudioProvider {
29 public:
Josh Wu6ab53e72021-12-29 23:53:33 -080030 bool isValid(const SessionType& session_type) override;
31
32 ndk::ScopedAStatus startSession(
33 const std::shared_ptr<IBluetoothAudioPort>& host_if,
Chen Chenc92270e2022-02-14 18:29:52 -080034 const AudioConfiguration& audio_config,
35 const std::vector<LatencyMode>& latency_modes,
Antoine SOULIER4e34d052023-09-29 19:10:07 +000036 DataMQDesc* _aidl_return) override;
37
38 ndk::ScopedAStatus parseA2dpConfiguration(
39 const CodecId& codec_id, const std::vector<uint8_t>& configuration,
40 CodecParameters* codec_parameters, A2dpStatus* _aidl_return) override;
41
42 ndk::ScopedAStatus getA2dpConfiguration(
43 const std::vector<A2dpRemoteCapabilities>& remote_a2dp_capabilities,
44 const A2dpConfigurationHint& hint,
45 std::optional<audio::A2dpConfiguration>* _aidl_return) override;
Josh Wu6ab53e72021-12-29 23:53:33 -080046
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000047 protected:
48 A2dpOffloadAudioProvider(const A2dpOffloadCodecFactory&);
49
Josh Wu6ab53e72021-12-29 23:53:33 -080050 private:
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000051 const A2dpOffloadCodecFactory& codec_factory_;
52
Josh Wu6ab53e72021-12-29 23:53:33 -080053 ndk::ScopedAStatus onSessionReady(DataMQDesc* _aidl_return) override;
54};
55
Alice Kuoadcceec2022-03-28 13:28:43 +080056class A2dpOffloadEncodingAudioProvider : public A2dpOffloadAudioProvider {
57 public:
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000058 A2dpOffloadEncodingAudioProvider(const A2dpOffloadCodecFactory&);
Alice Kuoadcceec2022-03-28 13:28:43 +080059};
60
61class A2dpOffloadDecodingAudioProvider : public A2dpOffloadAudioProvider {
62 public:
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000063 A2dpOffloadDecodingAudioProvider(const A2dpOffloadCodecFactory&);
Alice Kuoadcceec2022-03-28 13:28:43 +080064};
65
Josh Wu6ab53e72021-12-29 23:53:33 -080066} // namespace audio
67} // namespace bluetooth
68} // namespace hardware
69} // namespace android
70} // namespace aidl