• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <mutex>
20 #include "codec_heif_vdi.h"
21 #include "v2_0/icodec_image.h"
22 
23 namespace OHOS {
24 namespace HDI {
25 namespace Codec {
26 namespace Image {
27 namespace V2_0 {
28 class CodecHeifEncodeService {
29 public:
30     CodecHeifEncodeService();
31     virtual ~CodecHeifEncodeService();
32     int32_t DoHeifEncode(const std::vector<ImageItem>& inputImgs, const std::vector<MetaItem>& inputMetas,
33                          const std::vector<ItemRef>& refs, const SharedBuffer& output, uint32_t& filledLen);
34 private:
35     bool LoadVendorLib();
36     bool ReWrapNativeBufferInImageItem(const std::vector<ImageItem>& inputImgs);
37 private:
38     std::mutex mutex_;
39     std::shared_ptr<void> libHeif_ = nullptr;
40     ICodecHeifHwi* heifHwi_ = nullptr;
41     bool isIPCMode_;
42 };
43 } // V2_0
44 } // Image
45 } // Codec
46 } // HDI
47 } // OHOS
48 
49 #endif // OHOS_HDI_CODEC_V2_0_CODECHEIFENCODESERVICE_H
50