blob: 7ed58723460237cb9dbe21792ad488f11e4e2a9d [file] [log] [blame]
Antoine SOULIER4e34d052023-09-29 19:10:07 +00001/*
2 * Copyright (C) 2023 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
19#include <aidl/android/hardware/bluetooth/audio/A2dpStatus.h>
20#include <aidl/android/hardware/bluetooth/audio/ChannelMode.h>
21#include <aidl/android/hardware/bluetooth/audio/CodecParameters.h>
22
23#include "BluetoothAudioProviderFactory.h"
24
25namespace aidl::android::hardware::bluetooth::audio {
26
27class A2dpOffloadCodec {
28 protected:
29 A2dpOffloadCodec(const CodecInfo& info) : info(info) {}
30 virtual ~A2dpOffloadCodec() {}
31
32 public:
33 const CodecInfo& info;
34
35 const CodecId& GetCodecId() const { return info.id; }
36
37 virtual A2dpStatus ParseConfiguration(
38 const std::vector<uint8_t>& configuration,
39 CodecParameters* codec_parameters) const = 0;
40
41 virtual bool BuildConfiguration(
42 const std::vector<uint8_t>& remote_capabilities,
43 const std::optional<CodecParameters>& hint,
44 std::vector<uint8_t>* configuration) const = 0;
45};
46
47} // namespace aidl::android::hardware::bluetooth::audio