• 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 applicable 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 FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_SOURCE_MDK_KITS_H_
17 #define FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_SOURCE_MDK_KITS_H_
18 
19 #include "common_utils.h"
20 #include "image_source_napi.h"
21 #include "image_source_mdk.h"
22 
23 namespace OHOS {
24 namespace Media {
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct ImageSourceArgs {
30     struct OhosImageSource* source;
31     struct OhosImageSourceOps* sourceOps;
32     struct OhosImageDecodingOps* decodingOps;
33     struct OhosImageSourceDelayTimeList* outDelayTimes;
34     struct OhosImageSourceSupportedFormatList* outFormats;
35     struct OhosImageSourceInfo* outInfo;
36     struct OhosImageSourceProperty* inPropertyKey;
37     struct OhosImageSourceProperty* propertyVal;
38     struct OhosImageSourceUpdateData* inUpdateData;
39     ImageSourceNapi* napi;
40     napi_env inEnv;
41     napi_value inVal;
42     int32_t inInt32;
43     napi_value *outVal;
44     uint32_t* outUint32;
45 };
46 
47 enum {
48     ENV_FUNC_IMAGE_SOURCE_CREATE,
49     ENV_FUNC_IMAGE_SOURCE_CREATE_INCREMENTAL,
50     ENV_FUNC_IMAGE_SOURCE_UNWRAP,
51     STA_FUNC_IMAGE_SOURCE_GET_SUPPORTED_FORMATS,
52     CTX_FUNC_IMAGE_SOURCE_CREATE_PIXELMAP,
53     CTX_FUNC_IMAGE_SOURCE_CREATE_PIXELMAP_LIST,
54     CTX_FUNC_IMAGE_SOURCE_GET_DELAY_TIME,
55     CTX_FUNC_IMAGE_SOURCE_GET_FRAME_COUNT,
56     CTX_FUNC_IMAGE_SOURCE_GET_IMAGE_INFO,
57     CTX_FUNC_IMAGE_SOURCE_GET_IMAGE_PROPERTY,
58     CTX_FUNC_IMAGE_SOURCE_MODIFY_IMAGE_PROPERTY,
59     CTX_FUNC_IMAGE_SOURCE_UPDATE_DATA
60 };
61 
62 int32_t ImageSourceNativeCall(int32_t mode, struct ImageSourceArgs* args);
63 #ifdef __cplusplus
64 };
65 #endif
66 } // namespace Media
67 } // namespace OHOS
68 
69 #endif // FRAMEWORKS_KITS_JS_COMMON_INCLUDE_IMAGE_SOURCE_MDK_KITS_H_