blob: 2f51c73857095e2dac80ac0eda21115e55171cb4 [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>
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000021#include <aidl/android/hardware/bluetooth/audio/CodecInfo.h>
Antoine SOULIER4e34d052023-09-29 19:10:07 +000022#include <aidl/android/hardware/bluetooth/audio/CodecParameters.h>
23
Antoine SOULIER4e34d052023-09-29 19:10:07 +000024namespace aidl::android::hardware::bluetooth::audio {
25
26class A2dpOffloadCodec {
27 protected:
28 A2dpOffloadCodec(const CodecInfo& info) : info(info) {}
29 virtual ~A2dpOffloadCodec() {}
30
31 public:
32 const CodecInfo& info;
33
34 const CodecId& GetCodecId() const { return info.id; }
35
36 virtual A2dpStatus ParseConfiguration(
37 const std::vector<uint8_t>& configuration,
38 CodecParameters* codec_parameters) const = 0;
39
40 virtual bool BuildConfiguration(
41 const std::vector<uint8_t>& remote_capabilities,
42 const std::optional<CodecParameters>& hint,
43 std::vector<uint8_t>* configuration) const = 0;
44};
45
46} // namespace aidl::android::hardware::bluetooth::audio