1 /* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef A2DP_DECODER_SBC_H 17 #define A2DP_DECODER_SBC_H 18 19 #include <cstdint> 20 #include <memory> 21 #include "a2dp_sbc_dynamic_lib_ctrl.h" 22 #include "../../include/a2dp_codec_wrapper.h" 23 24 namespace OHOS { 25 namespace bluetooth { 26 class A2dpSbcDecoder : public A2dpDecoder { 27 public: 28 explicit A2dpSbcDecoder(A2dpDecoderObserver *observer); 29 ~A2dpSbcDecoder(); 30 bool DecodePacket(uint8_t *data, uint16_t size) override; 31 private: 32 sbc::IDecoderBase* sbcDecoder_ = nullptr; 33 std::unique_ptr<A2dpSBCDynamicLibCtrl> codecLib_ = nullptr; 34 CODECSbcLib *codecSbcDecoderLib_ = nullptr; 35 BT_DISALLOW_COPY_AND_ASSIGN(A2dpSbcDecoder); 36 }; 37 } // namespace bluetooth 38 } // namespace OHOS 39 40 #endif // !A2DP_DECODER_SBC_H 41