1 // 2 // Copyright (C) 2017 Google, Inc. 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 <cstdint> 20 21 namespace bluetooth { 22 23 // Should match btav_a2dp_codec_config_t in bt_av.h 24 class A2dpCodecConfig { 25 public: 26 A2dpCodecConfig(); 27 A2dpCodecConfig(const A2dpCodecConfig& other); 28 A2dpCodecConfig(int codec_type, int codec_priority, int sample_rate, 29 int bits_per_sample, int channel_mode, 30 int64_t codec_specific_1, int64_t codec_specific_2, 31 int64_t codec_specific_3, int64_t codec_specific_4); 32 ~A2dpCodecConfig(); 33 codec_type()34 int codec_type() const { return codec_type_; } codec_priority()35 int codec_priority() const { return codec_priority_; } sample_rate()36 int sample_rate() const { return sample_rate_; } bits_per_sample()37 int bits_per_sample() const { return bits_per_sample_; } channel_mode()38 int channel_mode() const { return channel_mode_; } codec_specific_1()39 int64_t codec_specific_1() const { return codec_specific_1_; } codec_specific_2()40 int64_t codec_specific_2() const { return codec_specific_2_; } codec_specific_3()41 int64_t codec_specific_3() const { return codec_specific_3_; } codec_specific_4()42 int64_t codec_specific_4() const { return codec_specific_4_; } 43 44 protected: 45 int codec_type_ = 0; 46 int codec_priority_ = 0; 47 int sample_rate_ = 0; 48 int bits_per_sample_ = 0; 49 int channel_mode_ = 0; 50 int64_t codec_specific_1_ = 0; 51 int64_t codec_specific_2_ = 0; 52 int64_t codec_specific_3_ = 0; 53 int64_t codec_specific_4_ = 0; 54 }; 55 56 } // namespace bluetooth 57