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 capture_session.h 30 * 31 * @brief Declare the capture Session 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_SESSION_H 41 #define NATIVE_INCLUDE_CAMERA_CAMERA_SESSION_H 42 43 #include <stdint.h> 44 #include <stdio.h> 45 #include "camera.h" 46 #include "camera_input.h" 47 #include "preview_output.h" 48 #include "photo_output.h" 49 #include "video_output.h" 50 #include "metadata_output.h" 51 #include "native_buffer/native_buffer.h" 52 53 #ifdef __cplusplus 54 extern "C" { 55 #endif 56 57 /** 58 * @brief Capture session object 59 * 60 * A pointer can be created using {@link Camera_CaptureSession} method. 61 * 62 * @since 11 63 * @version 1.0 64 */ 65 typedef struct Camera_CaptureSession Camera_CaptureSession; 66 67 /** 68 * @brief Capture session focus state callback to be called in {@link CaptureSession_Callbacks}. 69 * 70 * @param session the {@link Camera_CaptureSession} which deliver the callback. 71 * @param focusState the {@link Camera_FocusState} which delivered by the callback. 72 * @since 11 73 */ 74 typedef void (*OH_CaptureSession_OnFocusStateChange)(Camera_CaptureSession* session, Camera_FocusState focusState); 75 76 /** 77 * @brief Capture session error callback to be called in {@link CaptureSession_Callbacks}. 78 * 79 * @param session the {@link Camera_CaptureSession} which deliver the callback. 80 * @param errorCode the {@link Camera_ErrorCode} of the capture session. 81 * 82 * @see CAMERA_SERVICE_FATAL_ERROR 83 * @since 11 84 */ 85 typedef void (*OH_CaptureSession_OnError)(Camera_CaptureSession* session, Camera_ErrorCode errorCode); 86 87 /** 88 * @brief Capture session smooth zoom info callback. 89 * 90 * @param session the {@link Camera_CaptureSession} which deliver the callback. 91 * @param smoothZoomInfo the {@link Camera_SmoothZoomInfo} which delivered by the callback. 92 * @since 12 93 */ 94 typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* session, 95 Camera_SmoothZoomInfo* smoothZoomInfo); 96 97 /** 98 * @brief Capture session device switch status callback. 99 * 100 * @param session the {@link Camera_CaptureSession} which deliver the callback. 101 * @param autoDeviceSwitchStatusInfo the {@link Camera_AutoDeviceSwitchStatusInfo} which delivered by the callback. 102 * @since 13 103 */ 104 typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session, 105 Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo); 106 107 /** 108 * @brief Capture session system pressure level callback. 109 * 110 * @param session the {@link Camera_CaptureSession} which deliver the callback. 111 * @param systemPressureLevel the {@link Camera_SystemPressureLevel} which delivered by the callback. 112 * @since 20 113 */ 114 typedef void (*OH_CaptureSession_OnSystemPressureLevelChange)(Camera_CaptureSession* session, 115 Camera_SystemPressureLevel systemPressureLevel); 116 117 /** 118 * @brief A listener for capture session. 119 * 120 * @see OH_CaptureSession_RegisterCallback 121 * @since 11 122 * @version 1.0 123 */ 124 typedef struct CaptureSession_Callbacks { 125 /** 126 * Capture session focus state change event. 127 */ 128 OH_CaptureSession_OnFocusStateChange onFocusStateChange; 129 130 /** 131 * Capture session error event. 132 */ 133 OH_CaptureSession_OnError onError; 134 } CaptureSession_Callbacks; 135 136 /** 137 * @brief Register capture session event callback. 138 * 139 * @param session the {@link Camera_CaptureSession} instance. 140 * @param callback the {@link CaptureSession_Callbacks} to be registered. 141 * @return {@link #CAMERA_OK} if the method call succeeds. 142 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 143 * @since 11 144 */ 145 Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* session, 146 CaptureSession_Callbacks* callback); 147 148 /** 149 * @brief Unregister capture session event callback. 150 * 151 * @param session the {@link Camera_CaptureSession} instance. 152 * @param callback the {@link CaptureSession_Callbacks} to be unregistered. 153 * @return {@link #CAMERA_OK} if the method call succeeds. 154 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 155 * @since 11 156 */ 157 Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session, 158 CaptureSession_Callbacks* callback); 159 160 /** 161 * @brief Register smooth zoom information event callback. 162 * 163 * @param session the {@link Camera_CaptureSession} instance. 164 * @param smoothZoomInfoCallback the {@link OH_CaptureSession_OnSmoothZoomInfo} to be registered. 165 * @return {@link #CAMERA_OK} if the method call succeeds. 166 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 167 * @since 12 168 */ 169 Camera_ErrorCode OH_CaptureSession_RegisterSmoothZoomInfoCallback(Camera_CaptureSession* session, 170 OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback); 171 172 /** 173 * @brief Unregister smooth zoom information event callback. 174 * 175 * @param session the {@link Camera_CaptureSession} instance. 176 * @param smoothZoomInfoCallback the {@link OH_CaptureSession_OnSmoothZoomInfo} to be unregistered. 177 * @return {@link #CAMERA_OK} if the method call succeeds. 178 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 179 * @since 12 180 */ 181 Camera_ErrorCode OH_CaptureSession_UnregisterSmoothZoomInfoCallback(Camera_CaptureSession* session, 182 OH_CaptureSession_OnSmoothZoomInfo smoothZoomInfoCallback); 183 184 /** 185 * @brief Specifies the specific mode. 186 * 187 * This interface cannot be used after {@link OH_CaptureSession_BeginConfig}. 188 * We recommend using this interface immediately after using {@link OH_CameraManager_CreateCaptureSession}. 189 * 190 * @param session the {@link Camera_CaptureSession} instance. 191 * @param sceneMode the {@link CaptureSession_SceneMode} instance. 192 * @return {@link #CAMERA_OK} if the method call succeeds. 193 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 194 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 195 * {@link #CAMERA_SESSION_CONFIG_LOCKED} if session config locked. 196 * @since 12 197 */ 198 Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode); 199 200 /** 201 * @brief Add Secure output for camera. 202 * 203 * @param session the {@link Camera_CaptureSession} instance. 204 * @param previewOutput the target {@link Camera_PreviewOutput} to Set as a secure flow. 205 * @return {@link #CAMERA_OK} if the method call succeeds. 206 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 207 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 208 * {@link #CAMERA_SESSION_CONFIG_LOCKED} if session config locked. 209 * @since 12 210 */ 211 Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput); 212 213 /** 214 * @brief Begin capture session config. 215 * 216 * @param session the {@link Camera_CaptureSession} instance. 217 * @return {@link #CAMERA_OK} if the method call succeeds. 218 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 219 * {@link #CAMERA_SESSION_CONFIG_LOCKED} if session config locked. 220 * @since 11 221 */ 222 Camera_ErrorCode OH_CaptureSession_BeginConfig(Camera_CaptureSession* session); 223 224 /** 225 * @brief Commit capture session config. 226 * 227 * @param session the {@link Camera_CaptureSession} instance. 228 * @return {@link #CAMERA_OK} if the method call succeeds. 229 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 230 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 231 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 232 * @since 11 233 */ 234 Camera_ErrorCode OH_CaptureSession_CommitConfig(Camera_CaptureSession* session); 235 236 /** 237 * @brief Add a camera input. 238 * 239 * @param session the {@link Camera_CaptureSession} instance. 240 * @param cameraInput the target {@link Camera_Input} to add. 241 * @return {@link #CAMERA_OK} if the method call succeeds. 242 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 243 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 244 * @since 11 245 */ 246 Camera_ErrorCode OH_CaptureSession_AddInput(Camera_CaptureSession* session, Camera_Input* cameraInput); 247 248 /** 249 * @brief Remove a camera input. 250 * 251 * @param session the {@link Camera_CaptureSession} instance. 252 * @param cameraInput the target {@link Camera_Input} to remove. 253 * @return {@link #CAMERA_OK} if the method call succeeds. 254 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 255 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 256 * @since 11 257 */ 258 Camera_ErrorCode OH_CaptureSession_RemoveInput(Camera_CaptureSession* session, Camera_Input* cameraInput); 259 260 /** 261 * @brief Add a preview output. 262 * 263 * @param session the {@link Camera_CaptureSession} instance. 264 * @param previewOutput the target {@link Camera_PreviewOutput} to add. 265 * @return {@link #CAMERA_OK} if the method call succeeds. 266 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 267 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 268 * @since 11 269 */ 270 Camera_ErrorCode OH_CaptureSession_AddPreviewOutput(Camera_CaptureSession* session, 271 Camera_PreviewOutput* previewOutput); 272 273 /** 274 * @brief Remove a preview output. 275 * 276 * @param session the {@link Camera_CaptureSession} instance. 277 * @param previewOutput the target {@link Camera_PreviewOutput} to remove. 278 * @return {@link #CAMERA_OK} if the method call succeeds. 279 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 280 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 281 * @since 11 282 */ 283 Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput(Camera_CaptureSession* session, 284 Camera_PreviewOutput* previewOutput); 285 286 /** 287 * @brief Add a photo output. 288 * 289 * @param session the {@link Camera_CaptureSession} instance. 290 * @param photoOutput the target {@link Camera_PhotoOutput} to add. 291 * @return {@link #CAMERA_OK} if the method call succeeds. 292 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 293 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 294 * @since 11 295 */ 296 Camera_ErrorCode OH_CaptureSession_AddPhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput); 297 298 /** 299 * @brief Remove a photo output. 300 * 301 * @param session the {@link Camera_CaptureSession} instance. 302 * @param photoOutput the target {@link Camera_PhotoOutput} to remove. 303 * @return {@link #CAMERA_OK} if the method call succeeds. 304 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 305 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 306 * @since 11 307 */ 308 Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput(Camera_CaptureSession* session, Camera_PhotoOutput* photoOutput); 309 310 /** 311 * @brief Add a video output. 312 * 313 * @param session the {@link Camera_CaptureSession} instance. 314 * @param videoOutput the target {@link Camera_VideoOutput} to add. 315 * @return {@link #CAMERA_OK} if the method call succeeds. 316 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 317 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 318 * @since 11 319 */ 320 Camera_ErrorCode OH_CaptureSession_AddVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput); 321 322 /** 323 * @brief Remove a video output. 324 * 325 * @param session the {@link Camera_CaptureSession} instance. 326 * @param videoOutput the target {@link Camera_VideoOutput} to remove. 327 * @return {@link #CAMERA_OK} if the method call succeeds. 328 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 329 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 330 * @since 11 331 */ 332 Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput(Camera_CaptureSession* session, Camera_VideoOutput* videoOutput); 333 334 /** 335 * @brief Add a metadata output. 336 * 337 * @param session the {@link Camera_CaptureSession} instance. 338 * @param metadataOutput the target {@link Camera_MetadataOutput} to add. 339 * @return {@link #CAMERA_OK} if the method call succeeds. 340 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 341 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 342 * @since 11 343 */ 344 Camera_ErrorCode OH_CaptureSession_AddMetadataOutput(Camera_CaptureSession* session, 345 Camera_MetadataOutput* metadataOutput); 346 347 /** 348 * @brief Remove a metadata output. 349 * 350 * @param session the {@link Camera_CaptureSession} instance. 351 * @param metadataOutput the target {@link Camera_MetadataOutput} to remove. 352 * @return {@link #CAMERA_OK} if the method call succeeds. 353 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 354 * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. 355 * @since 11 356 */ 357 Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput(Camera_CaptureSession* session, 358 Camera_MetadataOutput* metadataOutput); 359 360 /** 361 * @brief Start capture session. 362 * 363 * @param session the {@link Camera_CaptureSession} instance to be started. 364 * @return {@link #CAMERA_OK} if the method call succeeds. 365 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 366 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 367 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 368 * @since 11 369 */ 370 Camera_ErrorCode OH_CaptureSession_Start(Camera_CaptureSession* session); 371 372 /** 373 * @brief Stop capture session. 374 * 375 * @param session the {@link Camera_CaptureSession} instance to be stoped. 376 * @return {@link #CAMERA_OK} if the method call succeeds. 377 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 378 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 379 * @since 11 380 */ 381 Camera_ErrorCode OH_CaptureSession_Stop(Camera_CaptureSession* session); 382 383 /** 384 * @brief Release capture session. 385 * 386 * @param session the {@link Camera_CaptureSession} instance to be release. 387 * @return {@link #CAMERA_OK} if the method call succeeds. 388 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 389 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 390 * @since 11 391 */ 392 Camera_ErrorCode OH_CaptureSession_Release(Camera_CaptureSession* session); 393 394 /** 395 * @brief Check if device has flash light. 396 * 397 * @param session the {@link Camera_CaptureSession} instance. 398 * @param hasFlash the result of whether flash supported. 399 * @return {@link #CAMERA_OK} if the method call succeeds. 400 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 401 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 402 * @since 11 403 */ 404 Camera_ErrorCode OH_CaptureSession_HasFlash(Camera_CaptureSession* session, bool* hasFlash); 405 406 /** 407 * @brief Check whether a specified flash mode is supported. 408 * 409 * @param session the {@link Camera_CaptureSession} instance. 410 * @param flashMode the {@link Camera_FlashMode} to be checked. 411 * @param isSupported the result of whether flash mode supported. 412 * @return {@link #CAMERA_OK} if the method call succeeds. 413 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 414 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 415 * @since 11 416 */ 417 Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported(Camera_CaptureSession* session, 418 Camera_FlashMode flashMode, bool* isSupported); 419 420 /** 421 * @brief Get current flash mode. 422 * 423 * @param session the {@link Camera_CaptureSession} instance. 424 * @param flashMode the current {@link Camera_FlashMode}. 425 * @return {@link #CAMERA_OK} if the method call succeeds. 426 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 427 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 428 * @since 11 429 */ 430 Camera_ErrorCode OH_CaptureSession_GetFlashMode(Camera_CaptureSession* session, Camera_FlashMode* flashMode); 431 432 /** 433 * @brief Set flash mode. 434 * 435 * @param session the {@link Camera_CaptureSession} instance. 436 * @param flashMode the target {@link Camera_FlashMode} to set. 437 * @return {@link #CAMERA_OK} if the method call succeeds. 438 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 439 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 440 * @since 11 441 */ 442 Camera_ErrorCode OH_CaptureSession_SetFlashMode(Camera_CaptureSession* session, Camera_FlashMode flashMode); 443 444 /** 445 * @brief Check whether a specified exposure mode is supported. 446 * 447 * @param session the {@link Camera_CaptureSession} instance. 448 * @param exposureMode the {@link Camera_ExposureMode} to be checked. 449 * @param isSupported the result of whether exposure mode supported. 450 * @return {@link #CAMERA_OK} if the method call succeeds. 451 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 452 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 453 * @since 11 454 */ 455 Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported(Camera_CaptureSession* session, 456 Camera_ExposureMode exposureMode, bool* isSupported); 457 458 /** 459 * @brief Get current exposure mode. 460 * 461 * @param session the {@link Camera_CaptureSession} instance. 462 * @param exposureMode the current {@link Camera_ExposureMode}. 463 * @return {@link #CAMERA_OK} if the method call succeeds. 464 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 465 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 466 * @since 11 467 */ 468 Camera_ErrorCode OH_CaptureSession_GetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode* exposureMode); 469 470 /** 471 * @brief Set exposure mode. 472 * 473 * @param session the {@link Camera_CaptureSession} instance. 474 * @param exposureMode the target {@link Camera_ExposureMode} to set. 475 * @return {@link #CAMERA_OK} if the method call succeeds. 476 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 477 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 478 * @since 11 479 */ 480 Camera_ErrorCode OH_CaptureSession_SetExposureMode(Camera_CaptureSession* session, Camera_ExposureMode exposureMode); 481 482 /** 483 * @brief Get current metering point. 484 * 485 * @param session the {@link Camera_CaptureSession} instance. 486 * @param point the current {@link Camera_Point} metering point. 487 * @return {@link #CAMERA_OK} if the method call succeeds. 488 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 489 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 490 * @since 11 491 */ 492 Camera_ErrorCode OH_CaptureSession_GetMeteringPoint(Camera_CaptureSession* session, Camera_Point* point); 493 494 /** 495 * @brief Set the center point of the metering area. 496 * 497 * @param session the {@link Camera_CaptureSession} instance. 498 * @param point the target {@link Camera_Point} to set. 499 * @return {@link #CAMERA_OK} if the method call succeeds. 500 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 501 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 502 * @since 11 503 */ 504 Camera_ErrorCode OH_CaptureSession_SetMeteringPoint(Camera_CaptureSession* session, Camera_Point point); 505 506 /** 507 * @brief Query the exposure compensation range. 508 * 509 * @param session the {@link Camera_CaptureSession} instance. 510 * @param minExposureBias the minimum of exposure compensation. 511 * @param maxExposureBias the Maximum of exposure compensation. 512 * @param step the step of exposure compensation between each level. 513 * @return {@link #CAMERA_OK} if the method call succeeds. 514 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 515 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 516 * @since 11 517 */ 518 Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange(Camera_CaptureSession* session, float* minExposureBias, 519 float* maxExposureBias, float* step); 520 521 /** 522 * @brief Set exposure compensation. 523 * 524 * @param session the {@link Camera_CaptureSession} instance. 525 * @param exposureBias the target exposure compensation to set. 526 * @return {@link #CAMERA_OK} if the method call succeeds. 527 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 528 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 529 * @since 11 530 */ 531 Camera_ErrorCode OH_CaptureSession_SetExposureBias(Camera_CaptureSession* session, float exposureBias); 532 533 /** 534 * @brief Get current exposure compensation. 535 * 536 * @param session the {@link Camera_CaptureSession} instance. 537 * @param exposureBias the current exposure compensation. 538 * @return {@link #CAMERA_OK} if the method call succeeds. 539 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 540 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 541 * @since 11 542 */ 543 Camera_ErrorCode OH_CaptureSession_GetExposureBias(Camera_CaptureSession* session, float* exposureBias); 544 545 /** 546 * @brief Check whether a specified focus mode is supported. 547 * 548 * @param session the {@link Camera_CaptureSession} instance. 549 * @param focusMode the {@link Camera_FocusMode} to be checked. 550 * @param isSupported the result of whether focus mode supported. 551 * @return {@link #CAMERA_OK} if the method call succeeds. 552 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 553 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 554 * @since 11 555 */ 556 Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported(Camera_CaptureSession* session, 557 Camera_FocusMode focusMode, bool* isSupported); 558 559 /** 560 * @brief Get current focus mode. 561 * 562 * @param session the {@link Camera_CaptureSession} instance. 563 * @param focusMode the current {@link Camera_FocusMode}. 564 * @return {@link #CAMERA_OK} if the method call succeeds. 565 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 566 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 567 * @since 11 568 */ 569 Camera_ErrorCode OH_CaptureSession_GetFocusMode(Camera_CaptureSession* session, Camera_FocusMode* focusMode); 570 571 /** 572 * @brief Set focus mode. 573 * 574 * @param session the {@link Camera_CaptureSession} instance. 575 * @param focusMode the target {@link Camera_FocusMode} to set. 576 * @return {@link #CAMERA_OK} if the method call succeeds. 577 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 578 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 579 * @since 11 580 */ 581 Camera_ErrorCode OH_CaptureSession_SetFocusMode(Camera_CaptureSession* session, Camera_FocusMode focusMode); 582 583 /** 584 * @brief Get current focus point. 585 * 586 * @param session the {@link Camera_CaptureSession} instance. 587 * @param focusPoint the current {@link Camera_Point}. 588 * @return {@link #CAMERA_OK} if the method call succeeds. 589 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 590 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 591 * @since 11 592 */ 593 Camera_ErrorCode OH_CaptureSession_GetFocusPoint(Camera_CaptureSession* session, Camera_Point* focusPoint); 594 595 /** 596 * @brief Set focus point. 597 * 598 * @param session the {@link Camera_CaptureSession} instance. 599 * @param focusPoint the target {@link Camera_Point} to set. 600 * @return {@link #CAMERA_OK} if the method call succeeds. 601 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 602 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 603 * @since 11 604 */ 605 Camera_ErrorCode OH_CaptureSession_SetFocusPoint(Camera_CaptureSession* session, Camera_Point focusPoint); 606 607 /** 608 * @brief Get all supported zoom ratio range. 609 * 610 * @param session the {@link Camera_CaptureSession} instance. 611 * @param minZoom the minimum of zoom ratio range. 612 * @param maxZoom the Maximum of zoom ratio range. 613 * @return {@link #CAMERA_OK} if the method call succeeds. 614 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 615 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 616 * @since 11 617 */ 618 Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange(Camera_CaptureSession* session, float* minZoom, float* maxZoom); 619 620 /** 621 * @brief Get current zoom ratio. 622 * 623 * @param session the {@link Camera_CaptureSession} instance. 624 * @param zoom the current zoom ratio. 625 * @return {@link #CAMERA_OK} if the method call succeeds. 626 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 627 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 628 * @since 11 629 */ 630 Camera_ErrorCode OH_CaptureSession_GetZoomRatio(Camera_CaptureSession* session, float* zoom); 631 632 /** 633 * @brief Set zoom ratio. 634 * 635 * @param session the {@link Camera_CaptureSession} instance. 636 * @param zoom the target zoom ratio to set. 637 * @return {@link #CAMERA_OK} if the method call succeeds. 638 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 639 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 640 * @since 11 641 */ 642 Camera_ErrorCode OH_CaptureSession_SetZoomRatio(Camera_CaptureSession* session, float zoom); 643 644 /** 645 * @brief Check whether a specified video stabilization mode is supported. 646 * 647 * @param session the {@link Camera_CaptureSession} instance. 648 * @param mode the {@link Camera_VideoStabilizationMode} to be checked. 649 * @param isSupported the result of whether video stabilization mode supported. 650 * @return {@link #CAMERA_OK} if the method call succeeds. 651 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 652 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 653 * @since 11 654 */ 655 Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported(Camera_CaptureSession* session, 656 Camera_VideoStabilizationMode mode, bool* isSupported); 657 658 /** 659 * @brief Get current video stabilization mode. 660 * 661 * @param session the {@link Camera_CaptureSession} instance. 662 * @param mode the current {@link Camera_VideoStabilizationMode}. 663 * @return {@link #CAMERA_OK} if the method call succeeds. 664 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 665 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 666 * @since 11 667 */ 668 Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSession* session, 669 Camera_VideoStabilizationMode* mode); 670 671 /** 672 * @brief Set video stabilization mode. 673 * 674 * @param session the {@link Camera_CaptureSession} instance. 675 * @param mode the target {@link Camera_VideoStabilizationMode} to set. 676 * @return {@link #CAMERA_OK} if the method call succeeds. 677 * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 678 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 679 * @since 11 680 */ 681 Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session, 682 Camera_VideoStabilizationMode mode); 683 684 /** 685 * @brief Determines whether the camera input can be added into the session. 686 * 687 * @param session the {@link Camera_CaptureSession} instance. 688 * @param cameraInput the target {@link Camera_Input} to set. 689 * @param isSuccessful the result of whether the camera input can be added into the session. 690 * @return {@link #CAMERA_OK} if the method call succeeds. 691 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 692 * @since 12 693 */ 694 Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session, 695 Camera_Input* cameraInput, bool* isSuccessful); 696 697 /** 698 * @brief Determines whether the camera preview output can be added into the session. 699 * 700 * @param session the {@link Camera_CaptureSession} instance. 701 * @param cameraOutput the target {@link Camera_PreviewOutput} to set. 702 * @param isSuccessful the result of whether the camera preview output can be added into the session. 703 * @return {@link #CAMERA_OK} if the method call succeeds. 704 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 705 * @since 12 706 */ 707 Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session, 708 Camera_PreviewOutput* cameraOutput, bool* isSuccessful); 709 710 /** 711 * @brief Determines whether the camera photo output can be added into the session. 712 * 713 * @param session the {@link Camera_CaptureSession} instance. 714 * @param cameraOutput the target {@link Camera_PhotoOutput} to set. 715 * @param isSuccessful the result of whether the camera photo output can be added into the session. 716 * @return {@link #CAMERA_OK} if the method call succeeds. 717 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 718 * @since 12 719 */ 720 Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session, 721 Camera_PhotoOutput* cameraOutput, bool* isSuccessful); 722 723 /** 724 * @brief Determines whether the camera video output can be added into the session. 725 * 726 * @param session the {@link Camera_CaptureSession} instance. 727 * @param cameraOutput the target {@link Camera_VideoOutput} to set. 728 * @param isSuccessful the result of whether the camera video output can be added into the session. 729 * @return {@link #CAMERA_OK} if the method call succeeds. 730 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 731 * @since 12 732 */ 733 Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session, 734 Camera_VideoOutput* cameraOutput, bool* isSuccessful); 735 736 /** 737 * @brief Check the preconfig type is supported or not. 738 * 739 * @param session the {@link Camera_CaptureSession} instance. 740 * @param preconfigType The type {@link Camera_PreconfigType} to check support for. 741 * @param canPreconfig The result of whether preconfiguration supported. 742 * @return {@link #CAMERA_OK} if the method call succeeds. 743 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 744 * @since 12 745 */ 746 Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session, 747 Camera_PreconfigType preconfigType, bool* canPreconfig); 748 749 /** 750 * @brief Check the preconfig type with ratio is supported or not. 751 * 752 * @param session the {@link Camera_CaptureSession} instance. 753 * @param preconfigType The type {@link Camera_PreconfigType} to check support for. 754 * @param preconfigRatio The ratio {@link Camera_PreconfigRatio} to check support for. 755 * @param canPreconfig The result of whether preconfiguration supported. 756 * @return {@link #CAMERA_OK} if the method call succeeds. 757 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 758 * @since 12 759 */ 760 Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session, 761 Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, bool* canPreconfig); 762 763 /** 764 * @brief Set the preconfig type. 765 * 766 * @param session the {@link Camera_CaptureSession} instance. 767 * @param preconfigType The type {@link Camera_PreconfigType} to check support for. 768 * @return {@link #CAMERA_OK} if the method call succeeds. 769 * {@link #CAMERA_SERVICE_FATAL_ERROR} if the internal preconfiguration fails. 770 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 771 * @since 12 772 */ 773 Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, 774 Camera_PreconfigType preconfigType); 775 776 /** 777 * @brief Set the preconfig type with ratio. 778 * 779 * @param session the {@link Camera_CaptureSession} instance. 780 * @param preconfigType The type {@link Camera_PreconfigType} to check support for. 781 * @param preconfigRatio The ratio {@link Camera_PreconfigRatio} to check support for. 782 * @return {@link #CAMERA_OK} if the method call succeeds. 783 * {@link #CAMERA_SERVICE_FATAL_ERROR} if the internal preconfiguration fails. 784 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 785 * @since 12 786 */ 787 Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session, 788 Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio); 789 790 /** 791 * @brief Query the exposure value. 792 * 793 * @param session the {@link Camera_CaptureSession} instance. 794 * @param exposureValue the current exposure value. 795 * @return {@link #CAMERA_OK} if the method call succeeds. 796 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 797 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 798 * @since 12 799 */ 800 Camera_ErrorCode OH_CaptureSession_GetExposureValue(Camera_CaptureSession* session, float* exposureValue); 801 802 /** 803 * @brief Get current focal length. 804 * 805 * @param session the {@link Camera_CaptureSession} instance. 806 * @param focalLength the current focal length. 807 * @return {@link #CAMERA_OK} if the method call succeeds. 808 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 809 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 810 * @since 12 811 */ 812 Camera_ErrorCode OH_CaptureSession_GetFocalLength(Camera_CaptureSession* session, float* focalLength); 813 814 /** 815 * @brief Set target zoom ratio by smooth method. 816 * 817 * @param session the {@link Camera_CaptureSession} instance. 818 * @param targetZoom the target zoom ratio to set. 819 * @param smoothZoomMode the {@link Camera_SmoothZoomMode} instance. 820 * @return {@link #CAMERA_OK} if the method call succeeds. 821 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 822 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 823 * @since 12 824 */ 825 Camera_ErrorCode OH_CaptureSession_SetSmoothZoom(Camera_CaptureSession* session, 826 float targetZoom, Camera_SmoothZoomMode smoothZoomMode); 827 828 /** 829 * @brief Get the supported color spaces. 830 * 831 * @param session the {@link Camera_CaptureSession} instance. 832 * @param colorSpace the supported {@link OH_NativeBuffer_ColorSpace} list to be filled if the method call succeeds. 833 * @param size the size of supported color Spaces queried. 834 * @return {@link #CAMERA_OK} if the method call succeeds. 835 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 836 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 837 * @since 12 838 */ 839 Camera_ErrorCode OH_CaptureSession_GetSupportedColorSpaces(Camera_CaptureSession* session, 840 OH_NativeBuffer_ColorSpace** colorSpace, uint32_t* size); 841 842 /** 843 * @brief Delete the color spaces. 844 * 845 * @param session the {@link Camera_CaptureSession} instance. 846 * @param colorSpace the target {@link OH_NativeBuffer_ColorSpace} list to be deleted if the method call succeeds. 847 * @return {@link #CAMERA_OK} if the method call succeeds. 848 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 849 * @since 12 850 */ 851 Camera_ErrorCode OH_CaptureSession_DeleteColorSpaces(Camera_CaptureSession* session, 852 OH_NativeBuffer_ColorSpace* colorSpace); 853 854 /** 855 * @brief Get current color space. 856 * 857 * @param session the {@link Camera_CaptureSession} instance. 858 * @param colorSpace the current {@link OH_NativeBuffer_ColorSpace} . 859 * @return {@link #CAMERA_OK} if the method call succeeds. 860 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 861 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 862 * @since 12 863 */ 864 Camera_ErrorCode OH_CaptureSession_GetActiveColorSpace(Camera_CaptureSession* session, 865 OH_NativeBuffer_ColorSpace* colorSpace); 866 867 /** 868 * @brief Set current color space. 869 * 870 * @param session the {@link Camera_CaptureSession} instance. 871 * @param colorSpace the target {@link OH_NativeBuffer_ColorSpace} to set. 872 * @return {@link #CAMERA_OK} if the method call succeeds. 873 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 874 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 875 * @since 12 876 */ 877 Camera_ErrorCode OH_CaptureSession_SetActiveColorSpace(Camera_CaptureSession* session, 878 OH_NativeBuffer_ColorSpace colorSpace); 879 880 /** 881 * @brief Register device switch event callback. 882 * 883 * @param session the {@link Camera_CaptureSession} instance. 884 * @param autoDeviceSwitchStatusChange the {@link OH_CaptureSession_OnAutoDeviceSwitchStatusChange} to be registered. 885 * @return {@link #CAMERA_OK} if the method call succeeds. 886 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 887 * @since 13 888 */ 889 Camera_ErrorCode OH_CaptureSession_RegisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, 890 OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange); 891 892 /** 893 * @brief Unregister device switch event callback. 894 * 895 * @param session the {@link Camera_CaptureSession} instance. 896 * @param autoDeviceSwitchStatusChange the {@link OH_CaptureSession_OnAutoDeviceSwitchStatusChange} to be unregistered. 897 * @return {@link #CAMERA_OK} if the method call succeeds. 898 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 899 * @since 13 900 */ 901 Camera_ErrorCode OH_CaptureSession_UnregisterAutoDeviceSwitchStatusCallback(Camera_CaptureSession* session, 902 OH_CaptureSession_OnAutoDeviceSwitchStatusChange autoDeviceSwitchStatusChange); 903 904 /** 905 * @brief Check whether auto device switch is supported. 906 * 907 * @param session the {@link Camera_CaptureSession} instance. 908 * @param isSupported the result of whether auto device switch supported. 909 * @return {@link #CAMERA_OK} if the method call succeeds. 910 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 911 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 912 * @since 13 913 */ 914 Camera_ErrorCode OH_CaptureSession_IsAutoDeviceSwitchSupported(Camera_CaptureSession* session, bool* isSupported); 915 916 /** 917 * @brief Enable auto switch or not for the camera device. 918 * 919 * @param session the {@link Camera_CaptureSession} instance. 920 * @param enabled the flag of enable auto switch or not. 921 * @return {@link #CAMERA_OK} if the method call succeeds. 922 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 923 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 924 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 925 * @since 13 926 */ 927 Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* session, bool enabled); 928 929 /** 930 * @brief Set quality prioritization. 931 * 932 * @param session the {@link Camera_CaptureSession} instance. 933 * @param qualityPrioritization the target {@link Camera_QualityPrioritization} to set. 934 * @return {@link #CAMERA_OK} if the method call succeeds. 935 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 936 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 937 * @since 14 938 */ 939 Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization( 940 Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization); 941 942 /** 943 * @brief Checks whether the macro capability is supported. 944 * 945 * @param session Pointer to an {@link Camera_CaptureSession} instance. 946 * @param isSupported Pointer to the check result. The value true means that the macro capability is supported, and false means the opposite. 947 * @return {@link Camera_ErrorCode}: 948 * CAMERA_OK = 0: The function call is successful.\n 949 * CAMERA_INVALID_ARGUMENT = 7400101: A parameter is missing or the parameter type is incorrect.\n 950 * CAMERA_SESSION_NOT_CONFIG = 7400103: The capture session is not configured. 951 * @since 19 952 */ 953 Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* session, bool* isSupported); 954 955 /** 956 * @brief Enables or disables the macro capability of the camera device. 957 * 958 * @param session Pointer to an {@link Camera_CaptureSession} instance. 959 * @param enabled Whether to enable the macro capability. The value true means to enable the macro capability, and false means to disable it. 960 * @return {@link Camera_ErrorCode}: 961 * CAMERA_OK = 0: The function call is successful.\n 962 * CAMERA_INVALID_ARGUMENT = 7400101: A parameter is missing or the parameter type is incorrect.\n 963 * CAMERA_SESSION_NOT_CONFIG = 7400103: The capture session is not configured.\n 964 * CAMERA_OPERATION_NOT_ALLOWED = 7400102: The operation is not allowed. 965 * @since 19 966 */ 967 Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled); 968 969 /** 970 * @brief Checks whether the specified white balance mode is supported. 971 * 972 * @param session Pointer to a {@link Camera_CaptureSession} instance. 973 * @param whiteBalanceMode White balance mode. 974 * @param isSupported Pointer to the check result. 975 * @return Result code. 976 * {@link #CAMERA_OK} is returned if the function is called successfully. 977 * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. 978 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. 979 * @since 20 980 */ 981 Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported( 982 Camera_CaptureSession *session, Camera_WhiteBalanceMode whiteBalanceMode, bool *isSupported); 983 984 /** 985 * @brief Obtains the white balance mode in use. 986 * 987 * @param session Pointer to a {@link Camera_CaptureSession} instance. 988 * @param whiteBalanceMode Pointer to the white balance mode. 989 * @return Result code. 990 * {@link #CAMERA_OK} is returned if the function is called successfully. 991 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 992 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the session is not configured when the function is called. 993 * @since 20 994 */ 995 Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode( 996 Camera_CaptureSession *session, Camera_WhiteBalanceMode *whiteBalanceMode); 997 998 /** 999 * @brief Obtains the supported white balance color temperature range. 1000 * 1001 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1002 * @param minColorTemperature Pointer to the minimum color temperature. 1003 * @param maxColorTemperature Pointer to the maximum color temperature. 1004 * @return Result code. 1005 * {@link #CAMERA_OK} is returned if the function is called successfully. 1006 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1007 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the session is not configured when the function is called. 1008 * @since 20 1009 */ 1010 Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange( 1011 Camera_CaptureSession *session, int32_t *minColorTemperature, int32_t *maxColorTemperature); 1012 1013 /** 1014 * @brief Obtains the white balance color temperature. 1015 * 1016 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1017 * @param colorTemperature Pointer to the color temperature. 1018 * @return Result code. 1019 * {@link #CAMERA_OK} is returned if the function is called successfully. 1020 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1021 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the session is not configured when the function is called. 1022 * @since 20 1023 */ 1024 Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession *session, int32_t *colorTemperature); 1025 1026 /** 1027 * @brief Sets the white balance color temperature. 1028 * 1029 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1030 * @param colorTemperature Color temperature. 1031 * @return Result code. 1032 * {@link #CAMERA_OK} is returned if the function is called successfully. 1033 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1034 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the session is not configured when the function is called. 1035 * @since 20 1036 */ 1037 Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession *session, int32_t colorTemperature); 1038 1039 /** 1040 * @brief Sets a white balance mode. 1041 * 1042 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1043 * @param whiteBalanceMode White balance mode. 1044 * @return Result code. 1045 * {@link #CAMERA_OK} is returned if the function is called successfully. 1046 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1047 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the session is not configured when the function is called. 1048 * @since 20 1049 */ 1050 Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode( 1051 Camera_CaptureSession *session, Camera_WhiteBalanceMode whiteBalanceMode); 1052 1053 /** 1054 * @brief Register system pressure level changes callback. 1055 * 1056 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1057 * @param systemPressureLevelChange the {@link OH_CaptureSession_OnSystemPressureLevelChange} to be registered. 1058 * @return Result code. 1059 * {@link #CAMERA_OK} is returned if the function is called successfully. 1060 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1061 * @since 20 1062 */ 1063 Camera_ErrorCode OH_CaptureSession_RegisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, 1064 OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange); 1065 1066 /** 1067 * @brief Unregister system pressure level changes callback. 1068 * 1069 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1070 * @param systemPressureLevelChange the {@link OH_CaptureSession_OnSystemPressureLevelChange} to be unregistered. 1071 * @return Result code. 1072 * {@link #CAMERA_OK} is returned if the function is called successfully. 1073 * {@link #CAMERA_INVALID_ARGUMENT} is returned if an input parameter is missing or the parameter type is incorrect. 1074 * @since 20 1075 */ 1076 Camera_ErrorCode OH_CaptureSession_UnregisterSystemPressureLevelChangeCallback(Camera_CaptureSession* session, 1077 OH_CaptureSession_OnSystemPressureLevelChange systemPressureLevelChange); 1078 1079 /** 1080 * @brief Checks whether the control center is supported. 1081 * 1082 * @param session Pointer to a {@link Camera_CaptureSession} instance. 1083 * @param isSupported Pointer to the check result. The value true means that the control center is supported, and false means the opposite. 1084 * @return Result code. 1085 * {@link #CAMERA_OK} is returned if the function is called successfully. 1086 * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. 1087 * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. 1088 * @since 20 1089 */ 1090 Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported); 1091 1092 /** 1093 * @brief Get the supported effect types . 1094 * 1095 * @param session the {@link Camera_CaptureSession} instance. 1096 * @param types the supported {@link Camera_ControlCenterEffectType} list to be filled if the method call succeeds. 1097 * @param size the size of supported effect types queried. 1098 * @return {@link #CAMERA_OK} if the method call succeeds. 1099 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1100 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 1101 * @since 20 1102 */ 1103 Camera_ErrorCode OH_CaptureSession_GetSupportedEffectTypes( 1104 Camera_CaptureSession* session, Camera_ControlCenterEffectType** types, uint32_t* size); 1105 1106 /** 1107 * @brief Delete the effect types. 1108 * 1109 * @param session the {@link Camera_CaptureSession} instance. 1110 * @param types the target {@link Camera_ControlCenterEffectType} list to be deleted if the method call succeeds. 1111 * @param size the size of supported effect types to be deleted. 1112 * @return {@link #CAMERA_OK} if the method call succeeds. 1113 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1114 * @since 20 1115 */ 1116 Camera_ErrorCode OH_CaptureSession_DeleteSupportedEffectTypes(Camera_CaptureSession* session, 1117 Camera_ControlCenterEffectType* types, uint32_t size); 1118 1119 /** 1120 * @brief Enables or disables the control center. 1121 * 1122 * @param session the {@link Camera_CaptureSession} instance. 1123 * @param enabled Whether to enable the control center. The value true means to enable the control center, and false means to disable it. 1124 * @return {@link #CAMERA_OK} if the method call succeeds. 1125 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1126 * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. 1127 * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. 1128 * @since 20 1129 */ 1130 Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enabled); 1131 1132 /** 1133 * @brief Capture session control center effect status info callback. 1134 * 1135 * @param session the {@link Camera_CaptureSession} which deliver the callback. 1136 * @param controlCenterStatusInfo the {@link Camera_ControlCenterStatusInfo} which delivered by the callback. 1137 * @since 20 1138 */ 1139 typedef void (*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session, 1140 Camera_ControlCenterStatusInfo* controlCenterStatusInfo); 1141 1142 /** 1143 * @brief Register control center effect status information event callback. 1144 * 1145 * @param session the {@link Camera_CaptureSession} instance. 1146 * @param controlCenterEffectStatusChange the {@link OH_CaptureSession_OnControlCenterEffectStatusChange} to be registered. 1147 * @return {@link #CAMERA_OK} if the method call succeeds. 1148 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1149 * @since 20 1150 */ 1151 Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, 1152 OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange); 1153 1154 /** 1155 * @brief Unregister control center effect status information event callback. 1156 * 1157 * @param session the {@link Camera_CaptureSession} instance. 1158 * @param controlCenterEffectStatusChange the {@link OH_CaptureSession_OnControlCenterEffectStatusChange} to be unregistered. 1159 * @return {@link #CAMERA_OK} if the method call succeeds. 1160 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1161 * @since 20 1162 */ 1163 Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, 1164 OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange); 1165 1166 /** 1167 * @brief Capture session macro status change callback. 1168 * 1169 * @param session Pointer to the {@link Camera_CaptureSession} which deliver the callback. 1170 * @param isMacroDetected The macro detection result which delivered by the callback. 1171 * @since 20 1172 */ 1173 typedef void (*OH_CaptureSession_OnMacroStatusChange)(Camera_CaptureSession* session, bool isMacroDetected); 1174 1175 /** 1176 * @brief Register macro status change event callback. 1177 * 1178 * @param session Pointer to the {@link Camera_CaptureSession} instance. 1179 * @param macroStatusChange The {@link OH_CaptureSession_OnMacroStatusChange} to be registered. 1180 * @return {@link #CAMERA_OK} if the method call succeeds. 1181 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1182 * @since 20 1183 */ 1184 Camera_ErrorCode OH_CaptureSession_RegisterMacroStatusChangeCallback( 1185 Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange); 1186 1187 /** 1188 * @brief Unregister macro status change callback. 1189 * 1190 * @param session Pointer to the {@link Camera_CaptureSession} instance. 1191 * @param macroStatusChange The {@link OH_CaptureSession_OnMacroStatusChange} to be unregistered. 1192 * @return {@link #CAMERA_OK} if the method call succeeds. 1193 * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. 1194 * @since 20 1195 */ 1196 Camera_ErrorCode OH_CaptureSession_UnregisterMacroStatusChangeCallback( 1197 Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange); 1198 1199 #ifdef __cplusplus 1200 } 1201 #endif 1202 1203 #endif // NATIVE_INCLUDE_CAMERA_CAMERA_SESSION_H 1204 /** @} */