1 /* 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/CodecInfo.h> 22 #include <aidl/android/hardware/bluetooth/audio/CodecParameters.h> 23 24 namespace aidl::android::hardware::bluetooth::audio { 25 26 class A2dpOffloadCodec { 27 protected: A2dpOffloadCodec(const CodecInfo & info)28 A2dpOffloadCodec(const CodecInfo& info) : info(info) {} ~A2dpOffloadCodec()29 virtual ~A2dpOffloadCodec() {} 30 31 public: 32 const CodecInfo& info; 33 GetCodecId()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 47