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 /** 17 * @addtogroup OH_Camera 18 * @{ 19 * 20 * @brief Provide the definition of the C interface for the camera module. 21 * 22 * @syscap SystemCapability.Multimedia.Camera.Core 23 * 24 * @since 11 25 * @version 1.0 26 */ 27 28 /** 29 * @file camera.h 30 * 31 * @brief Declare the camera base concepts. 32 * 33 * @library libohcamera.so 34 * @kit CameraKit 35 * @syscap SystemCapability.Multimedia.Camera.Core 36 * @since 11 37 * @version 1.0 38 */ 39 40 #ifndef NATIVE_INCLUDE_CAMERA_CAMERA_H 41 #define NATIVE_INCLUDE_CAMERA_CAMERA_H 42 43 #include <stdint.h> 44 #include <stdio.h> 45 #include <stdbool.h> 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 /** 52 * @brief camera manager object. 53 * 54 * A pointer can be created using {@link OH_Camera_GetCameraManager} method. 55 * 56 * @since 11 57 * @version 1.0 58 */ 59 typedef struct Camera_Manager Camera_Manager; 60 61 /** 62 * @brief Enum for camera error code. 63 * 64 * @since 11 65 * @version 1.0 66 */ 67 typedef enum Camera_ErrorCode { 68 /** 69 * Camera result is ok. 70 */ 71 CAMERA_OK = 0, 72 73 /** 74 * Parameter missing or parameter type incorrect. 75 */ 76 CAMERA_INVALID_ARGUMENT = 7400101, 77 78 /** 79 * Operation not allowed. 80 */ 81 CAMERA_OPERATION_NOT_ALLOWED = 7400102, 82 83 /** 84 * Session not config. 85 */ 86 CAMERA_SESSION_NOT_CONFIG = 7400103, 87 88 /** 89 * Session not running. 90 */ 91 CAMERA_SESSION_NOT_RUNNING = 7400104, 92 93 /** 94 * Session config locked. 95 */ 96 CAMERA_SESSION_CONFIG_LOCKED = 7400105, 97 98 /** 99 * Device setting locked. 100 */ 101 CAMERA_DEVICE_SETTING_LOCKED = 7400106, 102 103 /** 104 * Can not use camera cause of conflict. 105 */ 106 CAMERA_CONFLICT_CAMERA = 7400107, 107 108 /** 109 * Camera disabled cause of security reason. 110 */ 111 CAMERA_DEVICE_DISABLED = 7400108, 112 113 /** 114 * Can not use camera cause of preempted. 115 */ 116 CAMERA_DEVICE_PREEMPTED = 7400109, 117 118 /** 119 * Unresolved conflicts with current configurations. 120 * @since 12 121 */ 122 CAMERA_UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS = 7400110, 123 124 /** 125 * Camera service fatal error. 126 */ 127 CAMERA_SERVICE_FATAL_ERROR = 7400201 128 } Camera_ErrorCode; 129 130 /** 131 * @brief Enum for camera status. 132 * 133 * @since 11 134 * @version 1.0 135 */ 136 typedef enum Camera_Status { 137 /** 138 * Appear status. 139 */ 140 CAMERA_STATUS_APPEAR = 0, 141 142 /** 143 * Disappear status. 144 */ 145 CAMERA_STATUS_DISAPPEAR = 1, 146 147 /** 148 * Available status. 149 */ 150 CAMERA_STATUS_AVAILABLE = 2, 151 152 /** 153 * Unavailable status. 154 */ 155 CAMERA_STATUS_UNAVAILABLE = 3 156 } Camera_Status; 157 158 /** 159 * @brief Enum for scence mode. 160 * 161 * @since 12 162 * @version 1.0 163 */ 164 typedef enum Camera_SceneMode { 165 /** 166 * Normal photo mode. 167 */ 168 NORMAL_PHOTO = 1, 169 170 /** 171 * Normal video mode. 172 */ 173 NORMAL_VIDEO = 2, 174 175 /** 176 * Secure photo mode. 177 */ 178 SECURE_PHOTO = 12 179 } Camera_SceneMode; 180 181 /** 182 * @brief Enum for camera position. 183 * 184 * @since 11 185 * @version 1.0 186 */ 187 typedef enum Camera_Position { 188 /** 189 * Unspecified position. 190 */ 191 CAMERA_POSITION_UNSPECIFIED = 0, 192 193 /** 194 * Back position. 195 */ 196 CAMERA_POSITION_BACK = 1, 197 198 /** 199 * Front position. 200 */ 201 CAMERA_POSITION_FRONT = 2 202 } Camera_Position; 203 204 /** 205 * @brief Enum for camera type. 206 * 207 * @since 11 208 * @version 1.0 209 */ 210 typedef enum Camera_Type { 211 /** 212 * Default camera type. 213 */ 214 CAMERA_TYPE_DEFAULT = 0, 215 216 /** 217 * Wide camera. 218 */ 219 CAMERA_TYPE_WIDE_ANGLE = 1, 220 221 /** 222 * Ultra wide camera. 223 */ 224 CAMERA_TYPE_ULTRA_WIDE = 2, 225 226 /** 227 * Telephoto camera. 228 */ 229 CAMERA_TYPE_TELEPHOTO = 3, 230 231 /** 232 * True depth camera. 233 */ 234 CAMERA_TYPE_TRUE_DEPTH = 4 235 } Camera_Type; 236 237 /** 238 * @brief Enum for camera connection type. 239 * 240 * @since 11 241 * @version 1.0 242 */ 243 typedef enum Camera_Connection { 244 /** 245 * Built-in camera. 246 */ 247 CAMERA_CONNECTION_BUILT_IN = 0, 248 249 /** 250 * Camera connected using USB. 251 */ 252 CAMERA_CONNECTION_USB_PLUGIN = 1, 253 254 /** 255 * Remote camera. 256 */ 257 CAMERA_CONNECTION_REMOTE = 2 258 } Camera_Connection; 259 260 /** 261 * @brief Enum for camera format type. 262 * 263 * @since 11 264 * @version 1.0 265 */ 266 typedef enum Camera_Format { 267 /** 268 * RGBA 8888 Format. 269 */ 270 CAMERA_FORMAT_RGBA_8888 = 3, 271 272 /** 273 * YUV 420 Format. 274 */ 275 CAMERA_FORMAT_YUV_420_SP = 1003, 276 277 /** 278 * JPEG Format. 279 */ 280 CAMERA_FORMAT_JPEG = 2000, 281 282 /** 283 * YCBCR P010 Format. 284 * @since 12 285 */ 286 CAMERA_FORMAT_YCBCR_P010 = 2001, 287 288 /** 289 * YCRCB P010 Format. 290 * @since 12 291 */ 292 CAMERA_FORMAT_YCRCB_P010 = 2002 293 } Camera_Format; 294 295 /** 296 * @brief Enum for flash mode. 297 * 298 * @since 11 299 * @version 1.0 300 */ 301 typedef enum Camera_FlashMode { 302 /** 303 * Close mode. 304 */ 305 FLASH_MODE_CLOSE = 0, 306 307 /** 308 * Open mode. 309 */ 310 FLASH_MODE_OPEN = 1, 311 312 /** 313 * Auto mode. 314 */ 315 FLASH_MODE_AUTO = 2, 316 317 /** 318 * Always open mode. 319 */ 320 FLASH_MODE_ALWAYS_OPEN = 3 321 } Camera_FlashMode; 322 323 /** 324 * @brief Enum for exposure mode. 325 * 326 * @since 11 327 * @version 1.0 328 */ 329 typedef enum Camera_ExposureMode { 330 /** 331 * Lock exposure mode. 332 */ 333 EXPOSURE_MODE_LOCKED = 0, 334 335 /** 336 * Auto exposure mode. 337 */ 338 EXPOSURE_MODE_AUTO = 1, 339 340 /** 341 * Continuous automatic exposure. 342 */ 343 EXPOSURE_MODE_CONTINUOUS_AUTO = 2 344 } Camera_ExposureMode; 345 346 /** 347 * @brief Enum for focus mode. 348 * 349 * @since 11 350 * @version 1.0 351 */ 352 typedef enum Camera_FocusMode { 353 /** 354 * Manual mode. 355 */ 356 FOCUS_MODE_MANUAL = 0, 357 358 /** 359 * Continuous auto mode. 360 */ 361 FOCUS_MODE_CONTINUOUS_AUTO = 1, 362 363 /** 364 * Auto mode. 365 */ 366 FOCUS_MODE_AUTO = 2, 367 368 /** 369 * Locked mode. 370 */ 371 FOCUS_MODE_LOCKED = 3 372 } Camera_FocusMode; 373 374 /** 375 * @brief Enum for focus state. 376 * 377 * @since 11 378 * @version 1.0 379 */ 380 typedef enum Camera_FocusState { 381 /** 382 * Scan state. 383 */ 384 FOCUS_STATE_SCAN = 0, 385 386 /** 387 * Focused state. 388 */ 389 FOCUS_STATE_FOCUSED = 1, 390 391 /** 392 * Unfocused state. 393 */ 394 FOCUS_STATE_UNFOCUSED = 2 395 } Camera_FocusState; 396 397 /** 398 * @brief Enum for video stabilization mode. 399 * 400 * @since 11 401 * @version 1.0 402 */ 403 typedef enum Camera_VideoStabilizationMode { 404 /** 405 * Turn off video stablization. 406 */ 407 STABILIZATION_MODE_OFF = 0, 408 409 /** 410 * LOW mode provides basic stabilization effect. 411 */ 412 STABILIZATION_MODE_LOW = 1, 413 414 /** 415 * MIDDLE mode means algorithms can achieve better effects than LOW mode. 416 */ 417 STABILIZATION_MODE_MIDDLE = 2, 418 419 /** 420 * HIGH mode means algorithms can achieve better effects than MIDDLE mode. 421 */ 422 STABILIZATION_MODE_HIGH = 3, 423 424 /** 425 * Camera HDF can select mode automatically. 426 */ 427 STABILIZATION_MODE_AUTO = 4 428 } Camera_VideoStabilizationMode; 429 430 /** 431 * @brief Enum for the image rotation angles. 432 * 433 * @since 11 434 * @version 1.0 435 */ 436 typedef enum Camera_ImageRotation { 437 /** 438 * The capture image rotates 0 degrees. 439 */ 440 IAMGE_ROTATION_0 = 0, 441 442 /** 443 * The capture image rotates 90 degrees. 444 */ 445 IAMGE_ROTATION_90 = 90, 446 447 /** 448 * The capture image rotates 180 degrees. 449 */ 450 IAMGE_ROTATION_180 = 180, 451 452 /** 453 * The capture image rotates 270 degrees. 454 */ 455 IAMGE_ROTATION_270 = 270 456 } Camera_ImageRotation; 457 458 /** 459 * @brief Enum for the image quality levels. 460 * 461 * @since 11 462 * @version 1.0 463 */ 464 typedef enum Camera_QualityLevel { 465 /** 466 * High image quality. 467 */ 468 QUALITY_LEVEL_HIGH = 0, 469 470 /** 471 * Medium image quality. 472 */ 473 QUALITY_LEVEL_MEDIUM = 1, 474 475 /** 476 * Low image quality. 477 */ 478 QUALITY_LEVEL_LOW = 2 479 } Camera_QualityLevel; 480 481 /** 482 * @brief Enum for metadata object type. 483 * 484 * @since 11 485 * @version 1.0 486 */ 487 typedef enum Camera_MetadataObjectType { 488 /** 489 * Face detection. 490 */ 491 FACE_DETECTION = 0 492 } Camera_MetadataObjectType; 493 494 /** 495 * @brief Enum for torch mode. 496 * 497 * @since 12 498 * @version 1.0 499 */ 500 typedef enum Camera_TorchMode { 501 /** 502 * The device torch is always off. 503 */ 504 OFF = 0, 505 506 /** 507 * The device torch is always on. 508 */ 509 ON = 1, 510 511 /** 512 * The device continuously monitors light levels and 513 * uses the torch when necessary. 514 */ 515 AUTO = 2 516 } Camera_TorchMode; 517 518 /** 519 * @brief Enum for smooth zoom mode. 520 * 521 * @since 12 522 * @version 1.0 523 */ 524 typedef enum Camera_SmoothZoomMode { 525 /** 526 * Normal zoom mode. 527 */ 528 NORMAL = 0 529 } Camera_SmoothZoomMode; 530 531 /** 532 * @brief Enum for preconfig type. 533 * 534 * @since 12 535 * @version 1.0 536 */ 537 typedef enum Camera_PreconfigType { 538 /** 539 * The preconfig type is 720P. 540 */ 541 PRECONFIG_720P = 0, 542 543 /** 544 * The preconfig type is 1080P. 545 */ 546 PRECONFIG_1080P = 1, 547 548 /** 549 * The preconfig type is 4K. 550 */ 551 PRECONFIG_4K = 2, 552 553 /** 554 * The preconfig type is high quality. 555 */ 556 PRECONFIG_HIGH_QUALITY = 3 557 } Camera_PreconfigType; 558 559 /** 560 * @brief Enum for preconfig ratio. 561 * 562 * @since 12 563 * @version 1.0 564 */ 565 typedef enum Camera_PreconfigRatio { 566 /** 567 * The preconfig ratio is 1:1. 568 */ 569 PRECONFIG_RATIO_1_1 = 0, 570 571 /** 572 * The preconfig ratio 4:3. 573 */ 574 PRECONFIG_RATIO_4_3 = 1, 575 576 /** 577 * The preconfig ratio 16:9. 578 */ 579 PRECONFIG_RATIO_16_9 = 2 580 } Camera_PreconfigRatio; 581 582 /** 583 * @brief Enum for remote camera device type. 584 * 585 * @since 15 586 * @version 1.0 587 */ 588 typedef enum Camera_HostDeviceType { 589 /** 590 * Indicates an unknown device camera. 591 */ 592 HOST_DEVICE_TYPE_UNKNOWN_TYPE = 0, 593 594 /** 595 * Indicates a smartphone camera. 596 */ 597 HOST_DEVICE_TYPE_PHONE = 0x0E, 598 599 /** 600 * Indicates tablet camera. 601 */ 602 HOST_DEVICE_TYPE_TABLET = 0x11 603 } Camera_HostDeviceType; 604 605 /** 606 * @brief Size parameter. 607 * 608 * @since 11 609 * @version 1.0 610 */ 611 typedef struct Camera_Size { 612 /** 613 * Width. 614 */ 615 uint32_t width; 616 617 /** 618 * Height. 619 */ 620 uint32_t height; 621 } Camera_Size; 622 623 /** 624 * @brief Profile for camera streams. 625 * 626 * @since 11 627 * @version 1.0 628 */ 629 typedef struct Camera_Profile { 630 /** 631 * Camera format. 632 */ 633 Camera_Format format; 634 635 /** 636 * Picture size. 637 */ 638 Camera_Size size; 639 } Camera_Profile; 640 641 /** 642 * @brief Frame rate range. 643 * 644 * @since 11 645 * @version 1.0 646 */ 647 typedef struct Camera_FrameRateRange { 648 /** 649 * Min frame rate. 650 */ 651 uint32_t min; 652 653 /** 654 * Max frame rate. 655 */ 656 uint32_t max; 657 } Camera_FrameRateRange; 658 659 /** 660 * @brief Video profile. 661 * 662 * @since 11 663 * @version 1.0 664 */ 665 typedef struct Camera_VideoProfile { 666 /** 667 * Camera format. 668 */ 669 Camera_Format format; 670 671 /** 672 * Picture size. 673 */ 674 Camera_Size size; 675 676 /** 677 * Frame rate in unit fps (frames per second). 678 */ 679 Camera_FrameRateRange range; 680 } Camera_VideoProfile; 681 682 /** 683 * @brief Camera output capability. 684 * 685 * @since 11 686 * @version 1.0 687 */ 688 typedef struct Camera_OutputCapability { 689 /** 690 * Preview profiles list. 691 */ 692 Camera_Profile** previewProfiles; 693 694 /** 695 * Size of preview profiles list. 696 */ 697 uint32_t previewProfilesSize; 698 699 /** 700 * Photo profiles list. 701 */ 702 Camera_Profile** photoProfiles; 703 704 /** 705 * Size of photo profiles list. 706 */ 707 uint32_t photoProfilesSize; 708 709 /** 710 * Video profiles list. 711 */ 712 Camera_VideoProfile** videoProfiles; 713 714 /** 715 * Size of video profiles list. 716 */ 717 uint32_t videoProfilesSize; 718 719 /** 720 * Metadata object types list. 721 */ 722 Camera_MetadataObjectType** supportedMetadataObjectTypes; 723 724 /** 725 * Size of metadata object types list. 726 */ 727 uint32_t metadataProfilesSize; 728 } Camera_OutputCapability; 729 730 /** 731 * @brief Camera device object. 732 * 733 * @since 11 734 * @version 1.0 735 */ 736 typedef struct Camera_Device { 737 /** 738 * Camera id attribute. 739 */ 740 char* cameraId; 741 742 /** 743 * Camera position attribute. 744 */ 745 Camera_Position cameraPosition; 746 747 /** 748 * Camera type attribute. 749 */ 750 Camera_Type cameraType; 751 752 /** 753 * Camera connection type attribute. 754 */ 755 Camera_Connection connectionType; 756 } Camera_Device; 757 758 /** 759 * @brief Camera status info. 760 * 761 * @since 11 762 * @version 1.0 763 */ 764 typedef struct Camera_StatusInfo { 765 /** 766 * Camera instance. 767 */ 768 Camera_Device* camera; 769 770 /** 771 * Current camera status. 772 */ 773 Camera_Status status; 774 } Camera_StatusInfo; 775 776 /** 777 * @brief Point parameter. 778 * 779 * @since 11 780 * @version 1.0 781 */ 782 typedef struct Camera_Point { 783 /** 784 * X co-ordinate. 785 */ 786 double x; 787 788 /** 789 * Y co-ordinate. 790 */ 791 double y; 792 } Camera_Point; 793 794 /** 795 * @brief Photo capture location. 796 * 797 * @since 11 798 * @version 1.0 799 */ 800 typedef struct Camera_Location { 801 /** 802 * Latitude. 803 */ 804 double latitude; 805 806 /** 807 * Longitude. 808 */ 809 double longitude; 810 811 /** 812 * Altitude. 813 */ 814 double altitude; 815 } Camera_Location; 816 817 /** 818 * @brief Photo capture options to set. 819 * 820 * @since 11 821 * @version 1.0 822 */ 823 typedef struct Camera_PhotoCaptureSetting { 824 /** 825 * Photo image quality. 826 */ 827 Camera_QualityLevel quality; 828 829 /** 830 * Photo rotation. 831 */ 832 Camera_ImageRotation rotation; 833 834 /** 835 * Photo location. 836 */ 837 Camera_Location* location; 838 839 /** 840 * Set the mirror photo function switch, default to false. 841 */ 842 bool mirror; 843 } Camera_PhotoCaptureSetting; 844 845 /** 846 * @brief Frame shutter callback info. 847 * 848 * @since 11 849 * @version 1.0 850 */ 851 typedef struct Camera_FrameShutterInfo { 852 /** 853 * Capture id. 854 */ 855 int32_t captureId; 856 857 /** 858 * Timestamp for frame. 859 */ 860 uint64_t timestamp; 861 } Camera_FrameShutterInfo; 862 863 /** 864 * @brief Capture end info. 865 * 866 * @since 11 867 * @version 1.0 868 */ 869 typedef struct Camera_CaptureEndInfo { 870 /** 871 * Capture id. 872 */ 873 int32_t captureId; 874 875 /** 876 * Frame count. 877 */ 878 int64_t frameCount; 879 } Camera_CaptureEndInfo; 880 881 /** 882 * @brief Rectangle definition. 883 * 884 * @since 11 885 * @version 1.0 886 */ 887 typedef struct Camera_Rect { 888 /** 889 * X coordinator of top left point. 890 */ 891 int32_t topLeftX; 892 893 /** 894 * Y coordinator of top left point. 895 */ 896 int32_t topLeftY; 897 898 /** 899 * Width of this rectangle. 900 */ 901 int32_t width; 902 903 /** 904 * Height of this rectangle. 905 */ 906 int32_t height; 907 } Camera_Rect; 908 909 /** 910 * @brief Metadata object basis. 911 * 912 * @since 11 913 * @version 1.0 914 */ 915 typedef struct Camera_MetadataObject { 916 /** 917 * Metadata object type. 918 */ 919 Camera_MetadataObjectType type; 920 921 /** 922 * Metadata object timestamp in milliseconds. 923 */ 924 int64_t timestamp; 925 926 /** 927 * The axis-aligned bounding box of detected metadata object. 928 */ 929 Camera_Rect* boundingBox; 930 } Camera_MetadataObject; 931 932 /** 933 * @brief Torch Status Info. 934 * 935 * @since 12 936 * @version 1.0 937 */ 938 typedef struct Camera_TorchStatusInfo { 939 /** 940 * is torch available. 941 */ 942 bool isTorchAvailable; 943 944 /** 945 * is torch active. 946 */ 947 bool isTorchActive; 948 949 /** 950 * the current torch brightness level. 951 */ 952 float torchLevel; 953 } Camera_TorchStatusInfo; 954 955 /** 956 * @brief SmoothZoomInfo object. 957 * 958 * @since 12 959 * @version 1.0 960 */ 961 typedef struct Camera_SmoothZoomInfo { 962 /** 963 * The duration of smooth zoom. 964 */ 965 int32_t duration; 966 } Camera_SmoothZoomInfo; 967 968 /** 969 * @brief Capture start info. 970 * 971 * @since 12 972 * @version 1.0 973 */ 974 typedef struct Camera_CaptureStartInfo { 975 /** 976 * Capture id. 977 */ 978 int32_t captureId; 979 980 /** 981 * Time(in milliseconds) is the shutter time for the photo. 982 */ 983 int64_t time; 984 } Camera_CaptureStartInfo; 985 986 /** 987 * @brief Frame shutter end callback info. 988 * 989 * @since 12 990 * @version 1.0 991 */ 992 typedef struct Camera_FrameShutterEndInfo { 993 /** 994 * Capture id. 995 */ 996 int32_t captureId; 997 } Camera_FrameShutterEndInfo; 998 999 /** 1000 * @brief Enum for fold status. 1001 * 1002 * @since 13 1003 * @version 1.0 1004 */ 1005 typedef enum Camera_FoldStatus { 1006 /** 1007 * Non_foldable status. 1008 */ 1009 NON_FOLDABLE = 0, 1010 1011 /** 1012 * Expanded status. 1013 */ 1014 EXPANDED = 1, 1015 1016 /** 1017 * Folded status. 1018 */ 1019 FOLDED = 2 1020 } Camera_FoldStatus; 1021 1022 /** 1023 * @brief Fold status info. 1024 * 1025 * @since 13 1026 * @version 1.0 1027 */ 1028 typedef struct Camera_FoldStatusInfo { 1029 /** 1030 * Camera instance list. 1031 */ 1032 Camera_Device** supportedCameras; 1033 1034 /** 1035 * Size of camera list. 1036 */ 1037 uint32_t cameraSize; 1038 1039 /** 1040 * Current fold status. 1041 */ 1042 Camera_FoldStatus foldStatus; 1043 } Camera_FoldStatusInfo; 1044 1045 /** 1046 * @brief Auto device switch status info. 1047 * 1048 * @since 13 1049 * @version 1.0 1050 */ 1051 typedef struct Camera_AutoDeviceSwitchStatusInfo { 1052 /** 1053 * is device switched. 1054 */ 1055 bool isDeviceSwitched; 1056 1057 /** 1058 * is device capability changed. 1059 */ 1060 bool isDeviceCapabilityChanged; 1061 } Camera_AutoDeviceSwitchStatusInfo; 1062 1063 /** 1064 * @brief Creates a CameraManager instance. 1065 * 1066 * @param cameraManager the output {@link Camera_Manager} cameraManager will be created 1067 * if the method call succeeds. 1068 * @return {@link #CAMERA_OK} if the method call succeeds. 1069 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1070 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 1071 * @since 11 1072 */ 1073 Camera_ErrorCode OH_Camera_GetCameraManager(Camera_Manager** cameraManager); 1074 1075 /** 1076 * @brief Delete the CameraManager instance. 1077 * 1078 * @param cameraManager the {@link Camera_Manager} cameraManager instance to be deleted. 1079 * @return {@link #CAMERA_OK} if the method call succeeds. 1080 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1081 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 1082 * @since 11 1083 */ 1084 Camera_ErrorCode OH_Camera_DeleteCameraManager(Camera_Manager* cameraManager); 1085 1086 /** 1087 * @brief Enum for quality prioritization. 1088 * 1089 * @since 14 1090 * @version 1.0 1091 */ 1092 typedef enum Camera_QualityPrioritization { 1093 /** 1094 * Hight quality priority. 1095 */ 1096 HIGH_QUALITY = 0, 1097 1098 /** 1099 * Power balance priority. 1100 */ 1101 POWER_BALANCE = 1 1102 } Camera_QualityPrioritization; 1103 1104 /** 1105 * @brief Enum for camera concurrent type. 1106 * 1107 * @since 18 1108 * @version 1.0 1109 */ 1110 typedef enum Camera_ConcurrentType { 1111 /** 1112 * Cameras concurrency with limited capability. 1113 */ 1114 CAMERA_CONCURRENT_TYPE_LIMITED_CAPABILITY = 0, 1115 1116 /** 1117 * Cameras concurrenct with full capability. 1118 */ 1119 CAMERA_CONCURRENT_TYPE_FULL_CAPABILITY = 1 1120 } Camera_ConcurrentType; 1121 1122 /** 1123 * @brief Concurrency capability infos. 1124 * 1125 * @since 18 1126 * @version 1.0 1127 */ 1128 typedef struct Camera_ConcurrentInfo { 1129 /** 1130 * Camera instance. 1131 */ 1132 Camera_Device camera; 1133 1134 /** 1135 * Supported concurrent type. 1136 */ 1137 Camera_ConcurrentType type; 1138 1139 /** 1140 * Supported Modes. 1141 */ 1142 Camera_SceneMode* sceneModes; 1143 1144 /** 1145 * Supported outputCapabilities 1146 */ 1147 Camera_OutputCapability* outputCapabilities; 1148 1149 /** 1150 * Supported outputCapabilities size. 1151 */ 1152 uint32_t modeAndCapabilitySize; 1153 } Camera_ConcurrentInfo; 1154 1155 /** 1156 * @brief Enumerates the white balance modes. 1157 * 1158 * @since 20 1159 * @version 1.0 1160 */ 1161 typedef enum Camera_WhiteBalanceMode { 1162 /** 1163 * Automatic white balance mode. 1164 */ 1165 CAMERA_WHITE_BALANCE_MODE_AUTO = 0, 1166 1167 /** 1168 * Cloudy white balance mode. 1169 */ 1170 CAMERA_WHITE_BALANCE_MODE_CLOUDY = 1, 1171 1172 /** 1173 * Incandescent white balance mode. 1174 */ 1175 CAMERA_WHITE_BALANCE_MODE_INCANDESCENT = 2, 1176 1177 /** 1178 * Fluorescent white balance mode. 1179 */ 1180 CAMERA_WHITE_BALANCE_MODE_FLUORESCENT = 3, 1181 1182 /** 1183 * Daylight white balance mode. 1184 */ 1185 CAMERA_WHITE_BALANCE_MODE_DAYLIGHT = 4, 1186 1187 /** 1188 * Manual white balance mode. 1189 */ 1190 CAMERA_WHITE_BALANCE_MODE_MANUAL = 5, 1191 1192 /** 1193 * Lock white balance mode. 1194 */ 1195 CAMERA_WHITE_BALANCE_MODE_LOCKED = 6 1196 } Camera_WhiteBalanceMode; 1197 1198 /** 1199 * @brief Enumerates the system pressure levels of the current camera session. When the system pressure 1200 * increases, you are advised to reduce the load of the current camera session. 1201 * 1202 * @since 20 1203 * @version 1.0 1204 */ 1205 typedef enum Camera_SystemPressureLevel { 1206 /** 1207 * Normal level. This level indicates the system pressure is normal. 1208 */ 1209 SYSTEM_PRESSURE_NORMAL = 0, 1210 1211 /** 1212 * Mild level. This level indicates the system pressure is slightly elevated. 1213 */ 1214 SYSTEM_PRESSURE_MILD = 1, 1215 1216 /** 1217 * Severe level. This level indicates the system pressure is severely elevated. 1218 */ 1219 SYSTEM_PRESSURE_SEVERE = 2, 1220 1221 /** 1222 * Critical level. This level indicates the system pressure is critically elevated. 1223 */ 1224 SYSTEM_PRESSURE_CRITICAL = 3, 1225 1226 /** 1227 * Shutdown level. This level indicates the system pressure is fatal, so the camera session will be shut down soon. 1228 */ 1229 SYSTEM_PRESSURE_SHUTDOWN = 4 1230 } Camera_SystemPressureLevel; 1231 1232 /** 1233 * @brief Enumerates the control center effect types. 1234 * 1235 * @since 20 1236 * @version 1.0 1237 */ 1238 typedef enum Camera_ControlCenterEffectType { 1239 /** 1240 * Control center beauty effect type. 1241 */ 1242 CONTROL_CENTER_EFFECT_TYPE_BEAUTY = 0, 1243 1244 /** 1245 * Control center portrait effect type. 1246 */ 1247 CONTROL_CENTER_EFFECT_TYPE_PORTRAIT = 1 1248 } Camera_ControlCenterEffectType; 1249 1250 /** 1251 * @brief Control center status info. 1252 * 1253 * @since 20 1254 * @version 1.0 1255 */ 1256 typedef struct Camera_ControlCenterStatusInfo { 1257 /** 1258 * Control center effect type. 1259 */ 1260 Camera_ControlCenterEffectType effectType; 1261 1262 /** 1263 * If control center effect is active. 1264 */ 1265 bool isActive; 1266 } Camera_ControlCenterStatusInfo; 1267 1268 #ifdef __cplusplus 1269 } 1270 #endif 1271 1272 #endif // NATIVE_INCLUDE_CAMERA_CAMERA_H 1273 /** @} */