17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup OH_Camera 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provide the definition of the C interface for the camera module. 217777dab0Sopenharmony_ci * 227777dab0Sopenharmony_ci * @syscap SystemCapability.Multimedia.Camera.Core 237777dab0Sopenharmony_ci * 247777dab0Sopenharmony_ci * @since 11 257777dab0Sopenharmony_ci * @version 1.0 267777dab0Sopenharmony_ci */ 277777dab0Sopenharmony_ci 287777dab0Sopenharmony_ci/** 297777dab0Sopenharmony_ci * @file camera_manager.h 307777dab0Sopenharmony_ci * 317777dab0Sopenharmony_ci * @brief Declare the camera manager concepts. 327777dab0Sopenharmony_ci * 337777dab0Sopenharmony_ci * @library libohcamera.so 347777dab0Sopenharmony_ci * @kit CameraKit 357777dab0Sopenharmony_ci * @syscap SystemCapability.Multimedia.Camera.Core 367777dab0Sopenharmony_ci * @since 11 377777dab0Sopenharmony_ci * @version 1.0 387777dab0Sopenharmony_ci */ 397777dab0Sopenharmony_ci 407777dab0Sopenharmony_ci#ifndef NATIVE_INCLUDE_CAMERA_CAMERA_MANAGER_H 417777dab0Sopenharmony_ci#define NATIVE_INCLUDE_CAMERA_CAMERA_MANAGER_H 427777dab0Sopenharmony_ci 437777dab0Sopenharmony_ci#include <stdint.h> 447777dab0Sopenharmony_ci#include <stdio.h> 457777dab0Sopenharmony_ci#include "camera.h" 467777dab0Sopenharmony_ci#include "camera_input.h" 477777dab0Sopenharmony_ci#include "capture_session.h" 487777dab0Sopenharmony_ci#include "preview_output.h" 497777dab0Sopenharmony_ci#include "video_output.h" 507777dab0Sopenharmony_ci#include "photo_output.h" 517777dab0Sopenharmony_ci#include "metadata_output.h" 527777dab0Sopenharmony_ci 537777dab0Sopenharmony_ci#ifdef __cplusplus 547777dab0Sopenharmony_ciextern "C" { 557777dab0Sopenharmony_ci#endif 567777dab0Sopenharmony_ci 577777dab0Sopenharmony_ci/** 587777dab0Sopenharmony_ci * @brief Camera manager status callback to be called in {@link CameraManager_Callbacks}. 597777dab0Sopenharmony_ci * 607777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} which deliver the callback. 617777dab0Sopenharmony_ci * @param status the {@link Camera_StatusInfo} of each camera device. 627777dab0Sopenharmony_ci * @since 11 637777dab0Sopenharmony_ci */ 647777dab0Sopenharmony_citypedef void (*OH_CameraManager_StatusCallback)(Camera_Manager* cameraManager, Camera_StatusInfo* status); 657777dab0Sopenharmony_ci 667777dab0Sopenharmony_ci/** 677777dab0Sopenharmony_ci * @brief Camera manager torch status callback. 687777dab0Sopenharmony_ci * 697777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} which deliver the callback. 707777dab0Sopenharmony_ci * @param status the {@link Camera_TorchStatusInfo} of the torch. 717777dab0Sopenharmony_ci * @since 12 727777dab0Sopenharmony_ci */ 737777dab0Sopenharmony_citypedef void (*OH_CameraManager_TorchStatusCallback)(Camera_Manager* cameraManager, Camera_TorchStatusInfo* status); 747777dab0Sopenharmony_ci 757777dab0Sopenharmony_ci/** 767777dab0Sopenharmony_ci * @brief Camera manager fold status info callback. 777777dab0Sopenharmony_ci * 787777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} which deliver the callback. 797777dab0Sopenharmony_ci * @param foldStatusInfo the {@link Camera_FoldStatusInfo} of the device. 807777dab0Sopenharmony_ci * @since 13 817777dab0Sopenharmony_ci */ 827777dab0Sopenharmony_citypedef void (*OH_CameraManager_OnFoldStatusInfoChange)(Camera_Manager* cameraManager, 837777dab0Sopenharmony_ci Camera_FoldStatusInfo* foldStatusInfo); 847777dab0Sopenharmony_ci 857777dab0Sopenharmony_ci/** 867777dab0Sopenharmony_ci * @brief A listener for camera devices status. 877777dab0Sopenharmony_ci * 887777dab0Sopenharmony_ci * @see OH_CameraManager_RegisterCallback 897777dab0Sopenharmony_ci * @since 11 907777dab0Sopenharmony_ci * @version 1.0 917777dab0Sopenharmony_ci */ 927777dab0Sopenharmony_citypedef struct CameraManager_Callbacks { 937777dab0Sopenharmony_ci /** 947777dab0Sopenharmony_ci * Camera status change event. 957777dab0Sopenharmony_ci */ 967777dab0Sopenharmony_ci OH_CameraManager_StatusCallback onCameraStatus; 977777dab0Sopenharmony_ci} CameraManager_Callbacks; 987777dab0Sopenharmony_ci 997777dab0Sopenharmony_ci/** 1007777dab0Sopenharmony_ci * @brief Register camera status change event callback. 1017777dab0Sopenharmony_ci * 1027777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1037777dab0Sopenharmony_ci * @param callback the {@link CameraManager_Callbacks} to be registered. 1047777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1057777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1067777dab0Sopenharmony_ci * @since 11 1077777dab0Sopenharmony_ci */ 1087777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_RegisterCallback(Camera_Manager* cameraManager, CameraManager_Callbacks* callback); 1097777dab0Sopenharmony_ci 1107777dab0Sopenharmony_ci/** 1117777dab0Sopenharmony_ci * @brief Unregister camera status change event callback. 1127777dab0Sopenharmony_ci * 1137777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1147777dab0Sopenharmony_ci * @param callback the {@link CameraManager_Callbacks} to be unregistered. 1157777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1167777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1177777dab0Sopenharmony_ci * @since 11 1187777dab0Sopenharmony_ci */ 1197777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_UnregisterCallback(Camera_Manager* cameraManager, CameraManager_Callbacks* callback); 1207777dab0Sopenharmony_ci 1217777dab0Sopenharmony_ci/** 1227777dab0Sopenharmony_ci * @brief Register torch status change event callback. 1237777dab0Sopenharmony_ci * 1247777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1257777dab0Sopenharmony_ci * @param torchStatusCallback the {@link OH_CameraManager_TorchStatusCallback} to be registered. 1267777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1277777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1287777dab0Sopenharmony_ci * @since 12 1297777dab0Sopenharmony_ci */ 1307777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_RegisterTorchStatusCallback(Camera_Manager* cameraManager, 1317777dab0Sopenharmony_ci OH_CameraManager_TorchStatusCallback torchStatusCallback); 1327777dab0Sopenharmony_ci 1337777dab0Sopenharmony_ci/** 1347777dab0Sopenharmony_ci * @brief Unregister torch status change event callback. 1357777dab0Sopenharmony_ci * 1367777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1377777dab0Sopenharmony_ci * @param torchStatusCallback the {@link OH_CameraManager_TorchStatusCallback} to be unregistered. 1387777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1397777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1407777dab0Sopenharmony_ci * @since 12 1417777dab0Sopenharmony_ci */ 1427777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_UnregisterTorchStatusCallback(Camera_Manager* cameraManager, 1437777dab0Sopenharmony_ci OH_CameraManager_TorchStatusCallback torchStatusCallback); 1447777dab0Sopenharmony_ci 1457777dab0Sopenharmony_ci/** 1467777dab0Sopenharmony_ci * @brief Register fold status info change event callback. 1477777dab0Sopenharmony_ci * 1487777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1497777dab0Sopenharmony_ci * @param foldStatusInfoCallback the {@link OH_CameraManager_OnFoldStatusInfoChange} to be registered. 1507777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1517777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1527777dab0Sopenharmony_ci * @since 13 1537777dab0Sopenharmony_ci */ 1547777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_RegisterFoldStatusInfoCallback(Camera_Manager* cameraManager, 1557777dab0Sopenharmony_ci OH_CameraManager_OnFoldStatusInfoChange foldStatusInfoCallback); 1567777dab0Sopenharmony_ci 1577777dab0Sopenharmony_ci/** 1587777dab0Sopenharmony_ci * @brief Unregister fold status info change event callback. 1597777dab0Sopenharmony_ci * 1607777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1617777dab0Sopenharmony_ci * @param foldStatusInfoCallback the {@link OH_CameraManager_OnFoldStatusInfoChange} to be unregistered. 1627777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1637777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1647777dab0Sopenharmony_ci * @since 13 1657777dab0Sopenharmony_ci */ 1667777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_UnregisterFoldStatusInfoCallback(Camera_Manager* cameraManager, 1677777dab0Sopenharmony_ci OH_CameraManager_OnFoldStatusInfoChange foldStatusInfoCallback); 1687777dab0Sopenharmony_ci 1697777dab0Sopenharmony_ci/** 1707777dab0Sopenharmony_ci * @brief Gets supported camera descriptions. 1717777dab0Sopenharmony_ci * 1727777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1737777dab0Sopenharmony_ci * @param cameras the supported {@link Camera_Device} list will be filled 1747777dab0Sopenharmony_ci * if the method call succeeds. 1757777dab0Sopenharmony_ci * @param size the size of supported {@link Camera_Device} list will be filled 1767777dab0Sopenharmony_ci * if the method call succeeds. 1777777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1787777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1797777dab0Sopenharmony_ci * @since 11 1807777dab0Sopenharmony_ci */ 1817777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_GetSupportedCameras(Camera_Manager* cameraManager, 1827777dab0Sopenharmony_ci Camera_Device** cameras, uint32_t* size); 1837777dab0Sopenharmony_ci 1847777dab0Sopenharmony_ci/** 1857777dab0Sopenharmony_ci * @brief Delete supported camera. 1867777dab0Sopenharmony_ci * 1877777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 1887777dab0Sopenharmony_ci * @param cameras the {@link Camera_Device} list to be deleted. 1897777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 1907777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1917777dab0Sopenharmony_ci * @since 11 1927777dab0Sopenharmony_ci */ 1937777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_DeleteSupportedCameras(Camera_Manager* cameraManager, 1947777dab0Sopenharmony_ci Camera_Device* cameras, uint32_t size); 1957777dab0Sopenharmony_ci 1967777dab0Sopenharmony_ci/** 1977777dab0Sopenharmony_ci * @brief Gets the supported output capability for the specific camera and specific mode. 1987777dab0Sopenharmony_ci * 1997777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2007777dab0Sopenharmony_ci * @param cameras the {@link Camera_Device} to be queryed. 2017777dab0Sopenharmony_ci * @param cameraOutputCapability the supported {@link Camera_OutputCapability} will be filled 2027777dab0Sopenharmony_ci * if the method call succeeds. 2037777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2047777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2057777dab0Sopenharmony_ci * @since 11 2067777dab0Sopenharmony_ci */ 2077777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_GetSupportedCameraOutputCapability(Camera_Manager* cameraManager, 2087777dab0Sopenharmony_ci const Camera_Device* camera, Camera_OutputCapability** cameraOutputCapability); 2097777dab0Sopenharmony_ci 2107777dab0Sopenharmony_ci/** 2117777dab0Sopenharmony_ci * @brief Gets supported output capability for specific camera and specific sceneMode. 2127777dab0Sopenharmony_ci * 2137777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2147777dab0Sopenharmony_ci * @param camera the {@link Camera_Device} to be queryed. 2157777dab0Sopenharmony_ci * @param sceneMode the {@link Camera_SceneMode} to be queryed. 2167777dab0Sopenharmony_ci * @param cameraOutputCapability the supported {@link Camera_OutputCapability} will be filled 2177777dab0Sopenharmony_ci * if the method call succeeds. 2187777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2197777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2207777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 2217777dab0Sopenharmony_ci * @since 12 2227777dab0Sopenharmony_ci */ 2237777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_GetSupportedCameraOutputCapabilityWithSceneMode(Camera_Manager* cameraManager, 2247777dab0Sopenharmony_ci const Camera_Device* camera, Camera_SceneMode sceneMode, Camera_OutputCapability** cameraOutputCapability); 2257777dab0Sopenharmony_ci 2267777dab0Sopenharmony_ci/** 2277777dab0Sopenharmony_ci * @brief Delete the supported output capability. 2287777dab0Sopenharmony_ci * 2297777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2307777dab0Sopenharmony_ci * @param cameraOutputCapability the {@link Camera_OutputCapability} to be deleted. 2317777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2327777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2337777dab0Sopenharmony_ci * @since 11 2347777dab0Sopenharmony_ci */ 2357777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_DeleteSupportedCameraOutputCapability(Camera_Manager* cameraManager, 2367777dab0Sopenharmony_ci Camera_OutputCapability* cameraOutputCapability); 2377777dab0Sopenharmony_ci 2387777dab0Sopenharmony_ci/** 2397777dab0Sopenharmony_ci * @brief Determine whether camera is muted. 2407777dab0Sopenharmony_ci * 2417777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2427777dab0Sopenharmony_ci * @param isCameraMuted whether camera is muted will be filled if the method call succeeds. 2437777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2447777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2457777dab0Sopenharmony_ci * @since 11 2467777dab0Sopenharmony_ci */ 2477777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_IsCameraMuted(Camera_Manager* cameraManager, bool* isCameraMuted); 2487777dab0Sopenharmony_ci 2497777dab0Sopenharmony_ci/** 2507777dab0Sopenharmony_ci * @brief Create a capture session instance.The default session mode is photo session. 2517777dab0Sopenharmony_ci * 2527777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2537777dab0Sopenharmony_ci * @param captureSession the {@link Camera_CaptureSession} will be created 2547777dab0Sopenharmony_ci * if the method call succeeds. 2557777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2567777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2577777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 2587777dab0Sopenharmony_ci * @since 11 2597777dab0Sopenharmony_ci */ 2607777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateCaptureSession(Camera_Manager* cameraManager, 2617777dab0Sopenharmony_ci Camera_CaptureSession** captureSession); 2627777dab0Sopenharmony_ci 2637777dab0Sopenharmony_ci/** 2647777dab0Sopenharmony_ci * @brief Create a camera input instance. 2657777dab0Sopenharmony_ci * 2667777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2677777dab0Sopenharmony_ci * @param camera the {@link Camera_Device} which use to create {@link Camera_Input}. 2687777dab0Sopenharmony_ci * @param cameraInput the {@link Camera_Input} will be created if the method call succeeds. 2697777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2707777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2717777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 2727777dab0Sopenharmony_ci * @permission ohos.permission.CAMERA 2737777dab0Sopenharmony_ci * @since 11 2747777dab0Sopenharmony_ci */ 2757777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateCameraInput(Camera_Manager* cameraManager, 2767777dab0Sopenharmony_ci const Camera_Device* camera, Camera_Input** cameraInput); 2777777dab0Sopenharmony_ci 2787777dab0Sopenharmony_ci/** 2797777dab0Sopenharmony_ci * @brief Create a camera input instance. 2807777dab0Sopenharmony_ci * 2817777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2827777dab0Sopenharmony_ci * @param position the {@link Camera_Position} which use to create {@link Camera_Input}. 2837777dab0Sopenharmony_ci * @param type the {@link Camera_Type} which use to create {@link Camera_Input}. 2847777dab0Sopenharmony_ci * @param cameraInput the {@link Camera_Input} will be created if the method call succeeds. 2857777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 2867777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 2877777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 2887777dab0Sopenharmony_ci * @permission ohos.permission.CAMERA 2897777dab0Sopenharmony_ci * @since 11 2907777dab0Sopenharmony_ci */ 2917777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateCameraInput_WithPositionAndType(Camera_Manager* cameraManager, 2927777dab0Sopenharmony_ci Camera_Position position, Camera_Type type, Camera_Input** cameraInput); 2937777dab0Sopenharmony_ci 2947777dab0Sopenharmony_ci/** 2957777dab0Sopenharmony_ci * @brief Create a preview output instance. 2967777dab0Sopenharmony_ci * 2977777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 2987777dab0Sopenharmony_ci * @param profile the {@link Camera_Profile} to create {@link Camera_PreviewOutput}. 2997777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_PreviewOutput}. 3007777dab0Sopenharmony_ci * @param previewOutput the {@link Camera_PreviewOutput} will be created if the method call succeeds. 3017777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3027777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3037777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3047777dab0Sopenharmony_ci * @since 11 3057777dab0Sopenharmony_ci */ 3067777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreatePreviewOutput(Camera_Manager* cameraManager, const Camera_Profile* profile, 3077777dab0Sopenharmony_ci const char* surfaceId, Camera_PreviewOutput** previewOutput); 3087777dab0Sopenharmony_ci 3097777dab0Sopenharmony_ci/** 3107777dab0Sopenharmony_ci * @brief Create a preview output instance used in preconfig. 3117777dab0Sopenharmony_ci * 3127777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3137777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_PreviewOutput}. 3147777dab0Sopenharmony_ci * @param previewOutput the {@link Camera_PreviewOutput} will be created if the method call succeeds. 3157777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3167777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3177777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3187777dab0Sopenharmony_ci * @since 12 3197777dab0Sopenharmony_ci */ 3207777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreatePreviewOutputUsedInPreconfig(Camera_Manager* cameraManager, 3217777dab0Sopenharmony_ci const char* surfaceId, Camera_PreviewOutput** previewOutput); 3227777dab0Sopenharmony_ci 3237777dab0Sopenharmony_ci/** 3247777dab0Sopenharmony_ci * @brief Create a photo output instance. 3257777dab0Sopenharmony_ci * 3267777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3277777dab0Sopenharmony_ci * @param profile the {@link Camera_Profile} to create {@link Camera_PhotoOutput}. 3287777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_PhotoOutput}. 3297777dab0Sopenharmony_ci * @param photoOutput the {@link Camera_PhotoOutput} will be created if the method call succeeds. 3307777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3317777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3327777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3337777dab0Sopenharmony_ci * @since 11 3347777dab0Sopenharmony_ci */ 3357777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreatePhotoOutput(Camera_Manager* cameraManager, const Camera_Profile* profile, 3367777dab0Sopenharmony_ci const char* surfaceId, Camera_PhotoOutput** photoOutput); 3377777dab0Sopenharmony_ci 3387777dab0Sopenharmony_ci/** 3397777dab0Sopenharmony_ci * @brief Create a photo output instance used in preconfig. 3407777dab0Sopenharmony_ci * 3417777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3427777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_PhotoOutput}. 3437777dab0Sopenharmony_ci * @param photoOutput the {@link Camera_PhotoOutput} will be created if the method call succeeds. 3447777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3457777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3467777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3477777dab0Sopenharmony_ci * @since 12 3487777dab0Sopenharmony_ci */ 3497777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreatePhotoOutputUsedInPreconfig(Camera_Manager* cameraManager, 3507777dab0Sopenharmony_ci const char* surfaceId, Camera_PhotoOutput** photoOutput); 3517777dab0Sopenharmony_ci 3527777dab0Sopenharmony_ci/** 3537777dab0Sopenharmony_ci * @brief Create a photo output instance without surfaceId. 3547777dab0Sopenharmony_ci * 3557777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3567777dab0Sopenharmony_ci * @param profile the {@link Camera_Profile} to create {@link Camera_PhotoOutput}. 3577777dab0Sopenharmony_ci * @param photoOutput the {@link Camera_PhotoOutput} will be created if the method call succeeds. 3587777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3597777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3607777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3617777dab0Sopenharmony_ci * @since 12 3627777dab0Sopenharmony_ci */ 3637777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreatePhotoOutputWithoutSurface(Camera_Manager *cameraManager, 3647777dab0Sopenharmony_ci const Camera_Profile *profile, Camera_PhotoOutput **photoOutput); 3657777dab0Sopenharmony_ci 3667777dab0Sopenharmony_ci/** 3677777dab0Sopenharmony_ci * @brief Create a video output instance. 3687777dab0Sopenharmony_ci * 3697777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3707777dab0Sopenharmony_ci * @param profile the {@link Camera_VideoProfile} to create {@link Camera_VideoOutput}. 3717777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_VideoOutput}. 3727777dab0Sopenharmony_ci * @param videoOutput the {@link Camera_VideoOutput} will be created if the method call succeeds. 3737777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3747777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3757777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3767777dab0Sopenharmony_ci * @since 11 3777777dab0Sopenharmony_ci */ 3787777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateVideoOutput(Camera_Manager* cameraManager, const Camera_VideoProfile* profile, 3797777dab0Sopenharmony_ci const char* surfaceId, Camera_VideoOutput** videoOutput); 3807777dab0Sopenharmony_ci 3817777dab0Sopenharmony_ci/** 3827777dab0Sopenharmony_ci * @brief Create a video output instance used in preconfig. 3837777dab0Sopenharmony_ci * 3847777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3857777dab0Sopenharmony_ci * @param surfaceId the which use to create {@link Camera_VideoOutput}. 3867777dab0Sopenharmony_ci * @param videoOutput the {@link Camera_VideoOutput} will be created if the method call succeeds. 3877777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 3887777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 3897777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 3907777dab0Sopenharmony_ci * @since 12 3917777dab0Sopenharmony_ci */ 3927777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateVideoOutputUsedInPreconfig(Camera_Manager* cameraManager, 3937777dab0Sopenharmony_ci const char* surfaceId, Camera_VideoOutput** videoOutput); 3947777dab0Sopenharmony_ci 3957777dab0Sopenharmony_ci/** 3967777dab0Sopenharmony_ci * @brief Create a metadata output instance. 3977777dab0Sopenharmony_ci * 3987777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 3997777dab0Sopenharmony_ci * @param profile the {@link Camera_MetadataObjectType} to create {@link Camera_MetadataOutput}. 4007777dab0Sopenharmony_ci * @param metadataOutput the {@link Camera_MetadataOutput} will be created if the method call succeeds. 4017777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4027777dab0Sopenharmony_ci * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4037777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 4047777dab0Sopenharmony_ci * @since 11 4057777dab0Sopenharmony_ci */ 4067777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_CreateMetadataOutput(Camera_Manager* cameraManager, 4077777dab0Sopenharmony_ci const Camera_MetadataObjectType* profile, Camera_MetadataOutput** metadataOutput); 4087777dab0Sopenharmony_ci 4097777dab0Sopenharmony_ci/** 4107777dab0Sopenharmony_ci * @brief Gets supported scene mode for specific camera. 4117777dab0Sopenharmony_ci * 4127777dab0Sopenharmony_ci * @param camera the {@link Camera_Device} to be queryed. 4137777dab0Sopenharmony_ci * @param sceneModes the supported {@link Camera_SceneMode} will be filled if the method call succeeds. 4147777dab0Sopenharmony_ci * @param size the size of supported {@link Camera_SceneMode} list will be filled if the method call succeeds. 4157777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4167777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4177777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 4187777dab0Sopenharmony_ci * @since 12 4197777dab0Sopenharmony_ci */ 4207777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_GetSupportedSceneModes(Camera_Device* camera, 4217777dab0Sopenharmony_ci Camera_SceneMode** sceneModes, uint32_t* size); 4227777dab0Sopenharmony_ci 4237777dab0Sopenharmony_ci/** 4247777dab0Sopenharmony_ci * @brief Delete the scene mode. 4257777dab0Sopenharmony_ci * 4267777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 4277777dab0Sopenharmony_ci * @param sceneModes the {@link Camera_SceneMode} to be deleted. 4287777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4297777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4307777dab0Sopenharmony_ci * @since 12 4317777dab0Sopenharmony_ci */ 4327777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_DeleteSceneModes(Camera_Manager* cameraManager, Camera_SceneMode* sceneModes); 4337777dab0Sopenharmony_ci 4347777dab0Sopenharmony_ci/** 4357777dab0Sopenharmony_ci * @brief Check if the device supports torch. 4367777dab0Sopenharmony_ci * 4377777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 4387777dab0Sopenharmony_ci * @param isTorchSupported whether the device supports torch. 4397777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4407777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4417777dab0Sopenharmony_ci * @since 12 4427777dab0Sopenharmony_ci */ 4437777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_IsTorchSupported(Camera_Manager* cameraManager, 4447777dab0Sopenharmony_ci bool* isTorchSupported); 4457777dab0Sopenharmony_ci 4467777dab0Sopenharmony_ci/** 4477777dab0Sopenharmony_ci * @brief Check whether the device supports the torch with the specified torch mode. 4487777dab0Sopenharmony_ci * 4497777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 4507777dab0Sopenharmony_ci * @param torchMode the {@link Camera_TorchMode} to be checked. 4517777dab0Sopenharmony_ci * @param isTorchSupported whether device supports the torch mode. 4527777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4537777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4547777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 4557777dab0Sopenharmony_ci * @since 12 4567777dab0Sopenharmony_ci */ 4577777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_IsTorchSupportedByTorchMode(Camera_Manager* cameraManager, 4587777dab0Sopenharmony_ci Camera_TorchMode torchMode, bool* isTorchSupported); 4597777dab0Sopenharmony_ci 4607777dab0Sopenharmony_ci/** 4617777dab0Sopenharmony_ci * @brief Set camera torch mode. 4627777dab0Sopenharmony_ci * 4637777dab0Sopenharmony_ci * @param cameraManager the {@link Camera_Manager} instance. 4647777dab0Sopenharmony_ci * @param torchMode the {@link Camera_TorchMode} to be set. 4657777dab0Sopenharmony_ci * @return {@link #CAMERA_OK} if the method call succeeds. 4667777dab0Sopenharmony_ci * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 4677777dab0Sopenharmony_ci * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 4687777dab0Sopenharmony_ci * @since 12 4697777dab0Sopenharmony_ci */ 4707777dab0Sopenharmony_ciCamera_ErrorCode OH_CameraManager_SetTorchMode(Camera_Manager* cameraManager, 4717777dab0Sopenharmony_ci Camera_TorchMode torchMode); 4727777dab0Sopenharmony_ci 4737777dab0Sopenharmony_ci#ifdef __cplusplus 4747777dab0Sopenharmony_ci} 4757777dab0Sopenharmony_ci#endif 4767777dab0Sopenharmony_ci 4777777dab0Sopenharmony_ci#endif // NATIVE_INCLUDE_CAMERA_CAMERA_MANAGER_H 4787777dab0Sopenharmony_ci/** @} */