1 /*
2  * Copyright (c) 2024 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_0_CODECHEIFENCODESERVICE_H
17 #define OHOS_HDI_CODEC_V2_0_CODECHEIFENCODESERVICE_H
18 
19 #include "codec_heif_vdi.h"
20 #include "v2_0/icodec_image.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Codec {
25 namespace Image {
26 namespace V2_0 {
27 class CodecHeifEncodeService {
28 public:
29     CodecHeifEncodeService() = default;
30     ~CodecHeifEncodeService() = default;
31     int32_t DoHeifEncode(const std::vector<ImageItem>& inputImgs, const std::vector<MetaItem>& inputMetas,
32                          const std::vector<ItemRef>& refs, const SharedBuffer& output, uint32_t& filledLen);
33 private:
34     bool LoadVendorLib();
35 private:
36     std::shared_ptr<void> libHeif_ = nullptr;
37     ICodecHeifHwi* heifHwi_ = nullptr;
38 };
39 } // V2_0
40 } // Image
41 } // Codec
42 } // HDI
43 } // OHOS
44 
45 #endif // OHOS_HDI_CODEC_V2_0_CODECHEIFENCODESERVICE_H
46