blob: 65e927d7f57ecbf11682b0d5014813d8b546e0cd [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 "A2dpOffloadCodec.h"
20
21namespace aidl::android::hardware::bluetooth::audio {
22
23struct AacParameters : public CodecParameters {
24 enum class ObjectType { MPEG2_AAC_LC, MPEG4_AAC_LC };
25
26 ObjectType object_type;
27};
28
29class A2dpOffloadCodecAac : public A2dpOffloadCodec {
30 CodecInfo info_;
31
Antoine SOULIER4e34d052023-09-29 19:10:07 +000032 A2dpStatus ParseConfiguration(const std::vector<uint8_t>& configuration,
33 CodecParameters* codec_parameters,
34 AacParameters* aac_parameters) const;
35
36 public:
Antoine SOULIERbabe71d2024-01-12 23:20:58 +000037 A2dpOffloadCodecAac();
Antoine SOULIER4e34d052023-09-29 19:10:07 +000038
39 A2dpStatus ParseConfiguration(
40 const std::vector<uint8_t>& configuration,
41 CodecParameters* codec_parameters) const override {
42 return ParseConfiguration(configuration, codec_parameters, nullptr);
43 }
44
45 A2dpStatus ParseConfiguration(const std::vector<uint8_t>& configuration,
46 AacParameters* aac_parameters) const {
47 return ParseConfiguration(configuration, aac_parameters, aac_parameters);
48 }
49
50 bool BuildConfiguration(const std::vector<uint8_t>& remote_capabilities,
51 const std::optional<CodecParameters>& hint,
52 std::vector<uint8_t>* configuration) const override;
53};
54
55} // namespace aidl::android::hardware::bluetooth::audio