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 16 #ifndef AVCODECLIST_SERVER_H 17 #define AVCODECLIST_SERVER_H 18 19 #include <mutex> 20 #include "i_avcodeclist_service.h" 21 #include "i_avcodeclist_engine.h" 22 #include "nocopyable.h" 23 24 namespace OHOS { 25 namespace Media { 26 class AVCodecListServer : public IAVCodecListService, public NoCopyable { 27 public: 28 static std::shared_ptr<IAVCodecListService> Create(); 29 AVCodecListServer(); 30 virtual ~AVCodecListServer(); 31 32 std::string FindVideoDecoder(const Format &format) override; 33 std::string FindVideoEncoder(const Format &format) override; 34 std::string FindAudioDecoder(const Format &format) override; 35 std::string FindAudioEncoder(const Format &format) override; 36 std::vector<CapabilityData> GetCodecCapabilityInfos() override; 37 38 private: 39 int32_t Init(); 40 std::unique_ptr<IAVCodecListEngine> codecListEngine_; 41 std::mutex mutex_; 42 std::mutex cbMutex_; 43 }; 44 } // namespace Media 45 } // namespace OHOS 46 #endif // AVCODECLIST_SERVER_H