• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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_CODECJPEGCORE_H
17 #define OHOS_HDI_CODEC_V2_1_CODECJPEGCORE_H
18 
19 #include "codec_jpeg_vdi.h"
20 #include "v2_1/icodec_image.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Codec {
25 namespace Image {
26 class CodecJpegCore {
27 public:
28     using GetCodecJpegHwi = ICodecJpegHwi*(*)();
29 
30     explicit CodecJpegCore() = default;
31 
32     ~CodecJpegCore();
33 
34     void NotifyPowerOn();
35 
36     int32_t JpegInit();
37 
38     int32_t JpegDeInit();
39 
40     int32_t AllocateInBuffer(BufferHandle **buffer, uint32_t size);
41 
42     int32_t FreeInBuffer(BufferHandle *buffer);
43 
44     int32_t DoDecode(BufferHandle *buffer, BufferHandle *outBuffer, const V2_1::CodecJpegDecInfo *decInfo);
45 
46 private:
47     void AddVendorLib();
48 
49 private:
50     void *libHandle_ = nullptr;
51     GetCodecJpegHwi getCodecJpegHwi_ = nullptr;
52     ICodecJpegHwi *JpegHwi_ = nullptr;
53 };
54 } // Image
55 } // Codec
56 } // HDI
57 } // OHOS
58 
59 #endif // OHOS_HDI_CODEC_V2_1_CODECJPEGCORE_H
60