1 /* 2 * Copyright (C) 2021 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 #ifndef AVCODEC_LIST_IMPL_H 16 #define AVCODEC_LIST_IMPL_H 17 18 #include "avcodec_info.h" 19 #include "avcodec_list.h" 20 #include "nocopyable.h" 21 #include "i_avcodeclist_service.h" 22 23 namespace OHOS { 24 namespace Media { 25 class AVCodecListImpl : public AVCodecList, public NoCopyable { 26 public: 27 AVCodecListImpl(); 28 ~AVCodecListImpl(); 29 30 std::string FindVideoDecoder(const Format &format) override; 31 std::string FindVideoEncoder(const Format &format) override; 32 std::string FindAudioDecoder(const Format &format) override; 33 std::string FindAudioEncoder(const Format &format) override; 34 std::vector<std::shared_ptr<VideoCaps>> GetVideoDecoderCaps() override; 35 std::vector<std::shared_ptr<VideoCaps>> GetVideoEncoderCaps() override; 36 std::vector<std::shared_ptr<AudioCaps>> GetAudioDecoderCaps() override; 37 std::vector<std::shared_ptr<AudioCaps>> GetAudioEncoderCaps() override; 38 std::vector<CapabilityData> GetCodecCapabilityInfos(); 39 int32_t Init(); 40 41 private: 42 std::vector<CapabilityData> capabilityArray_; 43 std::vector<std::shared_ptr<VideoCaps>> videoDecoderCapsArray_; 44 std::vector<std::shared_ptr<VideoCaps>> videoEncoderCapsArray_; 45 std::vector<std::shared_ptr<AudioCaps>> audioDecoderCapsArray_; 46 std::vector<std::shared_ptr<AudioCaps>> audioEncoderCapsArray_; 47 std::shared_ptr<IAVCodecListService> codecListService_ = nullptr; 48 std::vector<CapabilityData> SelectTargetCapabilityDataArray(const AVCodecType &codecType) const; 49 }; 50 } // namespace Media 51 } // namespace OHOS 52 #endif // AVCODEC_LIST_IMPL_H 53 54