• 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_1_CODECHEIFENCODESERVICE_H
17 #define OHOS_HDI_CODEC_V2_1_CODECHEIFENCODESERVICE_H
18 
19 #include <mutex>
20 #include "codec_heif_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 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 private:
37     std::mutex mutex_;
38     std::shared_ptr<void> libHeif_ = nullptr;
39     OHOS::VDI::HEIF::ICodecHeifHwi* heifHwi_ = nullptr;
40     bool isIPCMode_;
41 };
42 } // V2_1
43 } // Image
44 } // Codec
45 } // HDI
46 } // OHOS
47 
48 #endif // OHOS_HDI_CODEC_V2_1_CODECHEIFENCODESERVICE_H
49