1 /* 2 * Copyright (c) 2025 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 CAMERA_NAPI_EX_PROXY_H_ 17 #define CAMERA_NAPI_EX_PROXY_H_ 18 19 #include "camera_dynamic_loader.h" 20 #include "napi/native_node_api.h" 21 #include "output/capture_output.h" 22 23 namespace OHOS { 24 namespace CameraStandard { 25 class CameraNapiExProxy { 26 public: 27 static std::shared_ptr<CameraNapiExProxy> GetCameraNapiExProxy(); 28 29 explicit CameraNapiExProxy(std::shared_ptr<Dynamiclib> napiExLib); 30 ~CameraNapiExProxy(); 31 napi_value CreateSessionForSys(napi_env env, int32_t jsModeName); 32 napi_value CreateDeprecatedSessionForSys(napi_env env); 33 napi_value CreateDepthDataOutput(napi_env env, DepthProfile& depthProfile); 34 napi_value CreateModeManager(napi_env env); 35 36 bool CheckAndGetOutput(napi_env env, napi_value obj, sptr<CaptureOutput> &output); 37 38 private: 39 std::shared_ptr<Dynamiclib> napiExLib_; 40 }; 41 } // namespace CameraStandard 42 } // namespace OHOS 43 #endif // CAMERA_NAPI_EX_PROXY_H_