• 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 IMAGE_RECEIVER_MDK_TEST_H
17 #define IMAGE_RECEIVER_MDK_TEST_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "napi/native_api.h"
23 #include "multimedia/image_framework/image_receiver_mdk.h"
24 
25 namespace OHOS {
26 namespace Media {
27 class ImageReceiverNDKTest {
28 public:
29     static napi_value Init(napi_env env, napi_value exports);
30     static napi_value JsCreateImageReceiver(napi_env env, napi_callback_info info);
31     static napi_value JsGetReceivingSurfaceId(napi_env env, napi_callback_info info);
32     static napi_value JsReadLatestImage(napi_env env, napi_callback_info info);
33     static napi_value JsReadNextImage(napi_env env, napi_callback_info info);
34     static napi_value JsOn(napi_env env, napi_callback_info info);
35     static napi_value JsGetSize(napi_env env, napi_callback_info info);
36     static napi_value JsGetCapacity(napi_env env, napi_callback_info info);
37     static napi_value JsGetFormat(napi_env env, napi_callback_info info);
38     static napi_value JsGetOnEventCount(napi_env env, napi_callback_info info);
39 
40     static napi_value JsImageClipRect(napi_env env, napi_callback_info info);
41     static napi_value JsImageSize(napi_env env, napi_callback_info info);
42     static napi_value JsImageFormat(napi_env env, napi_callback_info info);
43     static napi_value JsImageGetComponent(napi_env env, napi_callback_info info);
44     static napi_value JsReceiverRelease(napi_env env, napi_callback_info info);
45     static napi_value JsImageRelease(napi_env env, napi_callback_info info);
46 
47 private:
48     static uint32_t sOnEvnentCount;
49     static void OnEvent();
50 };
51 } // namespace Media
52 } // namespace OHOS
53 #endif // IMAGE_RECEIVER_MDK_TEST_H