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 294 /** 295 * MJPEG Format. 296 */ 297 CAMERA_FORMAT_MJPEG = 2003 298 } Camera_Format; 299 300 /** 301 * @brief Enum for flash mode. 302 * 303 * @since 11 304 * @version 1.0 305 */ 306 typedef enum Camera_FlashMode { 307 /** 308 * Close mode. 309 */ 310 FLASH_MODE_CLOSE = 0, 311 312 /** 313 * Open mode. 314 */ 315 FLASH_MODE_OPEN = 1, 316 317 /** 318 * Auto mode. 319 */ 320 FLASH_MODE_AUTO = 2, 321 322 /** 323 * Always open mode. 324 */ 325 FLASH_MODE_ALWAYS_OPEN = 3 326 } Camera_FlashMode; 327 328 /** 329 * @brief Enum for exposure mode. 330 * 331 * @since 11 332 * @version 1.0 333 */ 334 typedef enum Camera_ExposureMode { 335 /** 336 * Lock exposure mode. 337 */ 338 EXPOSURE_MODE_LOCKED = 0, 339 340 /** 341 * Auto exposure mode. 342 */ 343 EXPOSURE_MODE_AUTO = 1, 344 345 /** 346 * Continuous automatic exposure. 347 */ 348 EXPOSURE_MODE_CONTINUOUS_AUTO = 2 349 } Camera_ExposureMode; 350 351 /** 352 * @brief Enum for focus mode. 353 * 354 * @since 11 355 * @version 1.0 356 */ 357 typedef enum Camera_FocusMode { 358 /** 359 * Manual mode. 360 */ 361 FOCUS_MODE_MANUAL = 0, 362 363 /** 364 * Continuous auto mode. 365 */ 366 FOCUS_MODE_CONTINUOUS_AUTO = 1, 367 368 /** 369 * Auto mode. 370 */ 371 FOCUS_MODE_AUTO = 2, 372 373 /** 374 * Locked mode. 375 */ 376 FOCUS_MODE_LOCKED = 3 377 } Camera_FocusMode; 378 379 /** 380 * @brief Enum for focus state. 381 * 382 * @since 11 383 * @version 1.0 384 */ 385 typedef enum Camera_FocusState { 386 /** 387 * Scan state. 388 */ 389 FOCUS_STATE_SCAN = 0, 390 391 /** 392 * Focused state. 393 */ 394 FOCUS_STATE_FOCUSED = 1, 395 396 /** 397 * Unfocused state. 398 */ 399 FOCUS_STATE_UNFOCUSED = 2 400 } Camera_FocusState; 401 402 /** 403 * @brief Enum for video stabilization mode. 404 * 405 * @since 11 406 * @version 1.0 407 */ 408 typedef enum Camera_VideoStabilizationMode { 409 /** 410 * Turn off video stablization. 411 */ 412 STABILIZATION_MODE_OFF = 0, 413 414 /** 415 * LOW mode provides basic stabilization effect. 416 */ 417 STABILIZATION_MODE_LOW = 1, 418 419 /** 420 * MIDDLE mode means algorithms can achieve better effects than LOW mode. 421 */ 422 STABILIZATION_MODE_MIDDLE = 2, 423 424 /** 425 * HIGH mode means algorithms can achieve better effects than MIDDLE mode. 426 */ 427 STABILIZATION_MODE_HIGH = 3, 428 429 /** 430 * Camera HDF can select mode automatically. 431 */ 432 STABILIZATION_MODE_AUTO = 4 433 } Camera_VideoStabilizationMode; 434 435 /** 436 * @brief Enum for the image rotation angles. 437 * 438 * @since 11 439 * @version 1.0 440 */ 441 typedef enum Camera_ImageRotation { 442 /** 443 * The capture image rotates 0 degrees. 444 */ 445 IAMGE_ROTATION_0 = 0, 446 447 /** 448 * The capture image rotates 90 degrees. 449 */ 450 IAMGE_ROTATION_90 = 90, 451 452 /** 453 * The capture image rotates 180 degrees. 454 */ 455 IAMGE_ROTATION_180 = 180, 456 457 /** 458 * The capture image rotates 270 degrees. 459 */ 460 IAMGE_ROTATION_270 = 270 461 } Camera_ImageRotation; 462 463 /** 464 * @brief Enum for the image quality levels. 465 * 466 * @since 11 467 * @version 1.0 468 */ 469 typedef enum Camera_QualityLevel { 470 /** 471 * High image quality. 472 */ 473 QUALITY_LEVEL_HIGH = 0, 474 475 /** 476 * Medium image quality. 477 */ 478 QUALITY_LEVEL_MEDIUM = 1, 479 480 /** 481 * Low image quality. 482 */ 483 QUALITY_LEVEL_LOW = 2 484 } Camera_QualityLevel; 485 486 /** 487 * @brief Enum for metadata object type. 488 * 489 * @since 11 490 * @version 1.0 491 */ 492 typedef enum Camera_MetadataObjectType { 493 /** 494 * Face detection. 495 */ 496 FACE_DETECTION = 0 497 } Camera_MetadataObjectType; 498 499 /** 500 * @brief Enum for torch mode. 501 * 502 * @since 12 503 * @version 1.0 504 */ 505 typedef enum Camera_TorchMode { 506 /** 507 * The device torch is always off. 508 */ 509 OFF = 0, 510 511 /** 512 * The device torch is always on. 513 */ 514 ON = 1, 515 516 /** 517 * The device continuously monitors light levels and 518 * uses the torch when necessary. 519 */ 520 AUTO = 2 521 } Camera_TorchMode; 522 523 /** 524 * @brief Enum for smooth zoom mode. 525 * 526 * @since 12 527 * @version 1.0 528 */ 529 typedef enum Camera_SmoothZoomMode { 530 /** 531 * Normal zoom mode. 532 */ 533 NORMAL = 0 534 } Camera_SmoothZoomMode; 535 536 /** 537 * @brief Enum for preconfig type. 538 * 539 * @since 12 540 * @version 1.0 541 */ 542 typedef enum Camera_PreconfigType { 543 /** 544 * The preconfig type is 720P. 545 */ 546 PRECONFIG_720P = 0, 547 548 /** 549 * The preconfig type is 1080P. 550 */ 551 PRECONFIG_1080P = 1, 552 553 /** 554 * The preconfig type is 4K. 555 */ 556 PRECONFIG_4K = 2, 557 558 /** 559 * The preconfig type is high quality. 560 */ 561 PRECONFIG_HIGH_QUALITY = 3 562 } Camera_PreconfigType; 563 564 /** 565 * @brief Enum for preconfig ratio. 566 * 567 * @since 12 568 * @version 1.0 569 */ 570 typedef enum Camera_PreconfigRatio { 571 /** 572 * The preconfig ratio is 1:1. 573 */ 574 PRECONFIG_RATIO_1_1 = 0, 575 576 /** 577 * The preconfig ratio 4:3. 578 */ 579 PRECONFIG_RATIO_4_3 = 1, 580 581 /** 582 * The preconfig ratio 16:9. 583 */ 584 PRECONFIG_RATIO_16_9 = 2 585 } Camera_PreconfigRatio; 586 587 /** 588 * @brief Enum for remote camera device type. 589 * 590 * @since 12 591 * @version 1.0 592 */ 593 typedef enum Camera_HostDeviceType { 594 /** 595 * Indicates an unknown device camera. 596 */ 597 HOST_DEVICE_TYPE_UNKNOWN_TYPE = 0, 598 599 /** 600 * Indicates a smartphone camera. 601 */ 602 HOST_DEVICE_TYPE_PHONE = 0x0E, 603 604 /** 605 * Indicates tablet camera. 606 */ 607 HOST_DEVICE_TYPE_TABLET = 0x11 608 } Camera_HostDeviceType; 609 610 /** 611 * @brief Size parameter. 612 * 613 * @since 11 614 * @version 1.0 615 */ 616 typedef struct Camera_Size { 617 /** 618 * Width. 619 */ 620 uint32_t width; 621 622 /** 623 * Height. 624 */ 625 uint32_t height; 626 } Camera_Size; 627 628 /** 629 * @brief Profile for camera streams. 630 * 631 * @since 11 632 * @version 1.0 633 */ 634 typedef struct Camera_Profile { 635 /** 636 * Camera format. 637 */ 638 Camera_Format format; 639 640 /** 641 * Picture size. 642 */ 643 Camera_Size size; 644 } Camera_Profile; 645 646 /** 647 * @brief Frame rate range. 648 * 649 * @since 11 650 * @version 1.0 651 */ 652 typedef struct Camera_FrameRateRange { 653 /** 654 * Min frame rate. 655 */ 656 uint32_t min; 657 658 /** 659 * Max frame rate. 660 */ 661 uint32_t max; 662 } Camera_FrameRateRange; 663 664 /** 665 * @brief Video profile. 666 * 667 * @since 11 668 * @version 1.0 669 */ 670 typedef struct Camera_VideoProfile { 671 /** 672 * Camera format. 673 */ 674 Camera_Format format; 675 676 /** 677 * Picture size. 678 */ 679 Camera_Size size; 680 681 /** 682 * Frame rate in unit fps (frames per second). 683 */ 684 Camera_FrameRateRange range; 685 } Camera_VideoProfile; 686 687 /** 688 * @brief Camera output capability. 689 * 690 * @since 11 691 * @version 1.0 692 */ 693 typedef struct Camera_OutputCapability { 694 /** 695 * Preview profiles list. 696 */ 697 Camera_Profile** previewProfiles; 698 699 /** 700 * Size of preview profiles list. 701 */ 702 uint32_t previewProfilesSize; 703 704 /** 705 * Photo profiles list. 706 */ 707 Camera_Profile** photoProfiles; 708 709 /** 710 * Size of photo profiles list. 711 */ 712 uint32_t photoProfilesSize; 713 714 /** 715 * Video profiles list. 716 */ 717 Camera_VideoProfile** videoProfiles; 718 719 /** 720 * Size of video profiles list. 721 */ 722 uint32_t videoProfilesSize; 723 724 /** 725 * Metadata object types list. 726 */ 727 Camera_MetadataObjectType** supportedMetadataObjectTypes; 728 729 /** 730 * Size of metadata object types list. 731 */ 732 uint32_t metadataProfilesSize; 733 } Camera_OutputCapability; 734 735 /** 736 * @brief Camera device object. 737 * 738 * @since 11 739 * @version 1.0 740 */ 741 typedef struct Camera_Device { 742 /** 743 * Camera id attribute. 744 */ 745 char* cameraId; 746 747 /** 748 * Camera position attribute. 749 */ 750 Camera_Position cameraPosition; 751 752 /** 753 * Camera type attribute. 754 */ 755 Camera_Type cameraType; 756 757 /** 758 * Camera connection type attribute. 759 */ 760 Camera_Connection connectionType; 761 } Camera_Device; 762 763 /** 764 * @brief Camera status info. 765 * 766 * @since 11 767 * @version 1.0 768 */ 769 typedef struct Camera_StatusInfo { 770 /** 771 * Camera instance. 772 */ 773 Camera_Device* camera; 774 775 /** 776 * Current camera status. 777 */ 778 Camera_Status status; 779 } Camera_StatusInfo; 780 781 /** 782 * @brief Point parameter. 783 * 784 * @since 11 785 * @version 1.0 786 */ 787 typedef struct Camera_Point { 788 /** 789 * X co-ordinate. 790 */ 791 double x; 792 793 /** 794 * Y co-ordinate. 795 */ 796 double y; 797 } Camera_Point; 798 799 /** 800 * @brief Photo capture location. 801 * 802 * @since 11 803 * @version 1.0 804 */ 805 typedef struct Camera_Location { 806 /** 807 * Latitude. 808 */ 809 double latitude; 810 811 /** 812 * Longitude. 813 */ 814 double longitude; 815 816 /** 817 * Altitude. 818 */ 819 double altitude; 820 } Camera_Location; 821 822 /** 823 * @brief Photo capture options to set. 824 * 825 * @since 11 826 * @version 1.0 827 */ 828 typedef struct Camera_PhotoCaptureSetting { 829 /** 830 * Photo image quality. 831 */ 832 Camera_QualityLevel quality; 833 834 /** 835 * Photo rotation. 836 */ 837 Camera_ImageRotation rotation; 838 839 /** 840 * Photo location. 841 */ 842 Camera_Location* location; 843 844 /** 845 * Set the mirror photo function switch, default to false. 846 */ 847 bool mirror; 848 } Camera_PhotoCaptureSetting; 849 850 /** 851 * @brief Frame shutter callback info. 852 * 853 * @since 11 854 * @version 1.0 855 */ 856 typedef struct Camera_FrameShutterInfo { 857 /** 858 * Capture id. 859 */ 860 int32_t captureId; 861 862 /** 863 * Timestamp for frame. 864 */ 865 uint64_t timestamp; 866 } Camera_FrameShutterInfo; 867 868 /** 869 * @brief Capture end info. 870 * 871 * @since 11 872 * @version 1.0 873 */ 874 typedef struct Camera_CaptureEndInfo { 875 /** 876 * Capture id. 877 */ 878 int32_t captureId; 879 880 /** 881 * Frame count. 882 */ 883 int64_t frameCount; 884 } Camera_CaptureEndInfo; 885 886 /** 887 * @brief Rectangle definition. 888 * 889 * @since 11 890 * @version 1.0 891 */ 892 typedef struct Camera_Rect { 893 /** 894 * X coordinator of top left point. 895 */ 896 int32_t topLeftX; 897 898 /** 899 * Y coordinator of top left point. 900 */ 901 int32_t topLeftY; 902 903 /** 904 * Width of this rectangle. 905 */ 906 int32_t width; 907 908 /** 909 * Height of this rectangle. 910 */ 911 int32_t height; 912 } Camera_Rect; 913 914 /** 915 * @brief Metadata object basis. 916 * 917 * @since 11 918 * @version 1.0 919 */ 920 typedef struct Camera_MetadataObject { 921 /** 922 * Metadata object type. 923 */ 924 Camera_MetadataObjectType type; 925 926 /** 927 * Metadata object timestamp in milliseconds. 928 */ 929 int64_t timestamp; 930 931 /** 932 * The axis-aligned bounding box of detected metadata object. 933 */ 934 Camera_Rect* boundingBox; 935 } Camera_MetadataObject; 936 937 /** 938 * @brief Torch Status Info. 939 * 940 * @since 12 941 * @version 1.0 942 */ 943 typedef struct Camera_TorchStatusInfo { 944 /** 945 * is torch available. 946 */ 947 bool isTorchAvailable; 948 949 /** 950 * is torch active. 951 */ 952 bool isTorchActive; 953 954 /** 955 * the current torch brightness level. 956 */ 957 float torchLevel; 958 } Camera_TorchStatusInfo; 959 960 /** 961 * @brief SmoothZoomInfo object. 962 * 963 * @since 12 964 * @version 1.0 965 */ 966 typedef struct Camera_SmoothZoomInfo { 967 /** 968 * The duration of smooth zoom. 969 */ 970 int32_t duration; 971 } Camera_SmoothZoomInfo; 972 973 /** 974 * @brief Capture start info. 975 * 976 * @since 12 977 * @version 1.0 978 */ 979 typedef struct Camera_CaptureStartInfo { 980 /** 981 * Capture id. 982 */ 983 int32_t captureId; 984 985 /** 986 * Time(in milliseconds) is the shutter time for the photo. 987 */ 988 int64_t time; 989 } Camera_CaptureStartInfo; 990 991 /** 992 * @brief Frame shutter end callback info. 993 * 994 * @since 12 995 * @version 1.0 996 */ 997 typedef struct Camera_FrameShutterEndInfo { 998 /** 999 * Capture id. 1000 */ 1001 int32_t captureId; 1002 } Camera_FrameShutterEndInfo; 1003 1004 /** 1005 * @brief Enum for fold status. 1006 * 1007 * @since 13 1008 * @version 1.0 1009 */ 1010 typedef enum Camera_FoldStatus { 1011 /** 1012 * Non_foldable status. 1013 */ 1014 NON_FOLDABLE = 0, 1015 1016 /** 1017 * Expanded status. 1018 */ 1019 EXPANDED = 1, 1020 1021 /** 1022 * Folded status. 1023 */ 1024 FOLDED = 2 1025 } Camera_FoldStatus; 1026 1027 /** 1028 * @brief Fold status info. 1029 * 1030 * @since 13 1031 * @version 1.0 1032 */ 1033 typedef struct Camera_FoldStatusInfo { 1034 /** 1035 * Camera instance list. 1036 */ 1037 Camera_Device** supportedCameras; 1038 1039 /** 1040 * Size of camera list. 1041 */ 1042 uint32_t cameraSize; 1043 1044 /** 1045 * Current fold status. 1046 */ 1047 Camera_FoldStatus foldStatus; 1048 } Camera_FoldStatusInfo; 1049 1050 /** 1051 * @brief Auto device switch status info. 1052 * 1053 * @since 13 1054 * @version 1.0 1055 */ 1056 typedef struct Camera_AutoDeviceSwitchStatusInfo { 1057 /** 1058 * is device switched. 1059 */ 1060 bool isDeviceSwitched; 1061 1062 /** 1063 * is device capability changed. 1064 */ 1065 bool isDeviceCapabilityChanged; 1066 } Camera_AutoDeviceSwitchStatusInfo; 1067 1068 /** 1069 * @brief Creates a CameraManager instance. 1070 * 1071 * @param cameraManager the output {@link Camera_Manager} cameraManager will be created 1072 * if the method call succeeds. 1073 * @return {@link #CAMERA_OK} if the method call succeeds. 1074 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1075 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 1076 * @since 11 1077 */ 1078 Camera_ErrorCode OH_Camera_GetCameraManager(Camera_Manager** cameraManager); 1079 1080 /** 1081 * @brief Delete the CameraManager instance. 1082 * 1083 * @param cameraManager the {@link Camera_Manager} cameraManager instance to be deleted. 1084 * @return {@link #CAMERA_OK} if the method call succeeds. 1085 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1086 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 1087 * @since 11 1088 */ 1089 Camera_ErrorCode OH_Camera_DeleteCameraManager(Camera_Manager* cameraManager); 1090 1091 /** 1092 * @brief Enum for quality prioritization. 1093 * 1094 * @since 14 1095 * @version 1.0 1096 */ 1097 typedef enum Camera_QualityPrioritization { 1098 /** 1099 * Hight quality priority. 1100 */ 1101 HIGH_QUALITY = 0, 1102 1103 /** 1104 * Power balance priority. 1105 */ 1106 POWER_BALANCE = 1 1107 } Camera_QualityPrioritization; 1108 1109 /** 1110 * @brief Enum for camera concurrency type. 1111 * 1112 * @since 16 1113 * @version 1.0 1114 */ 1115 typedef enum Camera_ConcurrentType { 1116 /** 1117 * Hight quality priority. 1118 */ 1119 CONCURRENT_TYPE_LIMITED_CAPABILITY = 0, 1120 1121 /** 1122 * Power balance priority. 1123 */ 1124 CONCURRENT_TYPE_FULL_CAPABILITY = 1 1125 } Camera_ConcurrentType; 1126 1127 /** 1128 * @brief Concurrency capability infos. 1129 * 1130 * @since 16 1131 * @version 1.0 1132 */ 1133 typedef struct Camera_ConcurrentInfo { 1134 /** 1135 * Device. 1136 */ 1137 Camera_Device camera; 1138 1139 /** 1140 * Concurrent type. 1141 */ 1142 Camera_ConcurrentType type; 1143 1144 /** 1145 * Supported Modes. 1146 */ 1147 Camera_SceneMode* sceneModes; 1148 1149 /** 1150 * Supported profiles set 1151 */ 1152 Camera_OutputCapability* outputCapabilities; 1153 1154 /** 1155 * Supported profiles set 1156 */ 1157 uint32_t modeAndCapabilitySize; 1158 } Camera_ConcurrentInfo; 1159 1160 /** 1161 * @brief Enum for system pressure level. 1162 * 1163 * @since 20 1164 * @version 1.0 1165 */ 1166 typedef enum Camera_SystemPressureLevel { 1167 /** 1168 * System pressure normal. 1169 */ 1170 SYSTEM_PRESSURE_NORMAL = 0, 1171 1172 /** 1173 * System pressure mild. 1174 */ 1175 SYSTEM_PRESSURE_MILD = 1, 1176 1177 /** 1178 * System pressure severe. 1179 */ 1180 SYSTEM_PRESSURE_SEVERE = 2, 1181 1182 /** 1183 * System pressure critical. 1184 */ 1185 SYSTEM_PRESSURE_CRITICAL = 3, 1186 1187 /** 1188 * System pressure shutdown. 1189 */ 1190 SYSTEM_PRESSURE_SHUTDOWN = 4 1191 } Camera_SystemPressureLevel; 1192 1193 typedef enum Camera_ControlCenterEffectType { 1194 /** 1195 * Control center beauty effect type. 1196 */ 1197 CONTROL_CENTER_EFFECT_TYPE_BEAUTY = 0, 1198 1199 /** 1200 * Control center portrait effect type. 1201 */ 1202 CONTROL_CENTER_EFFECT_TYPE_PORTRAIT = 1 1203 } Camera_ControlCenterEffectType; 1204 1205 /** 1206 * @brief Control center status info. 1207 * 1208 * @since 20 1209 * @version 1.0 1210 */ 1211 typedef struct Camera_ControlCenterStatusInfo { 1212 /** 1213 * Control center effect type. 1214 */ 1215 Camera_ControlCenterEffectType effectType; 1216 1217 /** 1218 * IsActive 1219 */ 1220 bool isActive; 1221 } Camera_ControlCenterStatusInfo; 1222 1223 typedef enum Camera_WhiteBalanceMode { 1224 /** 1225 * Auto white balance mode. 1226 */ 1227 CAMERA_WHITE_BALANCE_MODE_AUTO = 0, 1228 CAMERA_WHITE_BALANCE_MODE_CLOUDY = 1, 1229 CAMERA_WHITE_BALANCE_MODE_INCANDESCENT = 2, 1230 CAMERA_WHITE_BALANCE_MODE_FLUORESCENT = 3, 1231 CAMERA_WHITE_BALANCE_MODE_DAYLIGHT = 4, 1232 CAMERA_WHITE_BALANCE_MODE_MANUAL = 5, 1233 CAMERA_WHITE_BALANCE_MODE_LOCKED = 6 1234 } Camera_WhiteBalanceMode; 1235 1236 #ifdef __cplusplus 1237 } 1238 #endif 1239 1240 #endif // NATIVE_INCLUDE_CAMERA_CAMERA_H 1241 /** @} */