1 /* 2 * Copyright (c) 2025 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 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 OHOS_HDI_CODEC_V2_1_CODECHEIFDECODESERVICE_H 17 #define OHOS_HDI_CODEC_V2_1_CODECHEIFDECODESERVICE_H 18 19 #include <mutex> 20 #include "codec_heif_decode_vdi.h" 21 #include "v2_1/icodec_image.h" 22 23 namespace OHOS { 24 namespace HDI { 25 namespace Codec { 26 namespace Image { 27 namespace V2_1 { 28 class CodecHeifDecodeService { 29 public: 30 CodecHeifDecodeService(); 31 virtual ~CodecHeifDecodeService(); 32 int32_t DoHeifDecode(const std::vector<sptr<Ashmem>>& inputs, const sptr<NativeBuffer>& output, 33 const CodecHeifDecInfo& decInfo); 34 private: 35 bool LoadVendorLib(); 36 private: 37 std::mutex mutex_; 38 std::shared_ptr<void> libHeif_ = nullptr; 39 ICodecHeifDecodeHwi* heifDecodeHwi_ = nullptr; 40 bool isIPCMode_; 41 }; 42 } // V2_1 43 } // Image 44 } // Codec 45 } // HDI 46 } // OHOS 47 48 #endif // OHOS_HDI_CODEC_V2_1_CODECHEIFDECODESERVICE_H 49