1/* 2 * Copyright (c) 2024 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 * @file Types.h 18 * 19 * @brief Declares data types 20 * used by the Hardware Driver Interfaces (HDIs) of this module. 21 * 22 * @since 3.2 23 * @version 1.3 24 */ 25 26package ohos.hdi.camera.v1_3; 27 28import ohos.hdi.camera.v1_2.Types; 29import ohos.hdi.camera.v1_0.Types; 30 31sequenceable ohos.hdi.camera.v1_0.BufferHandleSequenceable; 32sequenceable ohos.hdi.camera.v1_0.MapDataSequenceable; 33 34/** 35 * @brief Enumerates stream operation modes. 36 * @since 3.2 37 * @version 1.3 38 */ 39enum OperationMode : ohos.hdi.camera.v1_2.OperationMode_V1_2 { 40 41 /** 42 * Professional mode, which dedicated to professional photo scene 43 * Abandoned, use the new operationMode below 44 * 45 * @since 4.1 46 * @version 1.1 47 */ 48 PROFESSIONAL_V1_3 = PROFESSIONAL, 49 50 /** 51 * Professional mode, which dedicated to capture code 52 * 53 * @since 5.0 54 * @version 1.0 55 */ 56 PROFESSIONAL_PHOTO = 11, 57 58 /** 59 * Professional mode, which dedicated to video code 60 * 61 * @since 5.0 62 * @version 1.0 63 */ 64 PROFESSIONAL_VIDEO = 12, 65 66 /** 67 * Slow motion mode, which dedicated to video recording slow motion 68 * 69 * @since 5.0 70 * @version 1.0 71 */ 72 HIGH_FRAME_RATE = 13, 73 74 /** 75 * High resolution photo mode, which dedicated to capture recording high pixel 76 * 77 * @since 5.0 78 * @version 1.0 79 */ 80 HIGH_RESOLUTION_PHOTO = 14, 81 82 /** 83 * Secure mode, which dedicated to secure mode 84 * @since 5.0 85 * @version 1.0 86 */ 87 SECURE = 15, 88 89 /** 90 * quick shot photo mode, which dedicated to quick shot photo mode 91 * @since 5.0 92 * @version 1.0 93 */ 94 QUICK_SHOT_PHOTO = 16, 95 96 /** 97 * Light painting mode, which dedicated to light painting mode 98 * @since 5.0 99 * @version 1.0 100 */ 101 LIGHT_PAINTING = 17, 102 103 /** 104 * Panorama photo mode, which dedicated to panorama photo mode 105 * @since 5.0 106 * @version 1.0 107 */ 108 PANORAMA_PHOTO = 18, 109 110 /** 111 * Timelapse photo mode, which dedicated to timelapse photo mode 112 * @since 5.0 113 * @version 1.0 114 */ 115 TIMELAPSE_PHOTO = 19, 116 117 /** 118 * Aperture video mode, which dedicated to aperture video mode 119 * @since 5.0 120 * @version 1.0 121 */ 122 APERTURE_VIDEO = 20, 123 124 /** 125 * fluorescence photo mode, which dedicated to fluorescence photo mode 126 * @since 5.0 127 * @version 1.0 128 */ 129 FLUORESCENCE_PHOTO = 21, 130}; 131 132/** 133 * @brief Enumerates types of the extended stream information. 134 * @since 4.0 135 * @version 1.2 136 */ 137enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { 138 139 /** 140 * Extended stream information of raw. 141 * @since 5.0 142 * @version 1.0 143 */ 144 EXTENDED_STREAM_INFO_RAW = 2, 145 146 /** 147 * Extended stream information of depth. 148 * @since 5.0 149 * @version 1.0 150 */ 151 EXTENDED_STREAM_INFO_DEPTH = 3, 152 153 /** 154 * Extended stream information of meta. 155 * @since 5.0 156 * @version 1.0 157 */ 158 EXTENDED_STREAM_INFO_META = 4, 159 160 /** 161 * Extended stream information of secure. 162 * @since 5.0 163 * @version 1.0 164 */ 165 EXTENDED_STREAM_INFO_SECURE = 5, 166 167 /** 168 * Extended stream information of maker. 169 * @since 5.0 170 * @version 1.0 171 */ 172 EXTENDED_STREAM_INFO_MAKER_INFO = 6, 173 174 /** 175 * Extended stream information of exif. 176 * @since 5.0 177 * @version 1.0 178 */ 179 EXTENDED_STREAM_INFO_EXIF = 7, 180 181 /** 182 * Extended stream information of gainmap. 183 * @since 5.0 184 * @version 1.0 185 */ 186 EXTENDED_STREAM_INFO_GAINMAP = 8, 187 188 /** 189 * Extended stream information of unrefocus. 190 * @since 5.0 191 * @version 1.0 192 */ 193 EXTENDED_STREAM_INFO_UNREFOCUS = 9, 194 195 /** 196 * Extended stream information of linear. 197 * @since 5.0 198 * @version 1.0 199 */ 200 EXTENDED_STREAM_INFO_LINEAR = 10, 201 202 /** 203 * Extended stream information of fragment. 204 * @since 5.0 205 * @version 1.0 206 */ 207 EXTENDED_STREAM_INFO_FRAGMENT =11, 208}; 209 210/** 211 * @brief Enumerates stream types. 212 * @since 5.0 213 * @version 1.0 214 */ 215enum StreamType { 216 217 /** 218 * Preview streams, indicating that stream data is used for preview 219 */ 220 STREAM_TYPE_PREVIEW = 0, 221 222 /** 223 * Video streams, indicating that stream data is used to encode and generate videos 224 */ 225 STREAM_TYPE_VIDEO = 1, 226 227 /** 228 * Photographing streams, indicating that stream data is used to encode and generate images 229 */ 230 STREAM_TYPE_STILL_CAPTURE = 2, 231 232 /** 233 * Stream data that is used to store thumbnails 234 */ 235 STREAM_TYPE_POST_VIEW = 3, 236 237 /** 238 * Stream data that is used for image analysis 239 */ 240 STREAM_TYPE_ANALYZE = 4, 241 242 /** 243 * Custom type 244 */ 245 STREAM_TYPE_CUSTOM = 5, 246 247 /** 248 * Depth type 249 */ 250 STREAM_TYPE_DEPTH = 6, 251}; 252 253/** 254 * @brief Enumerates types of the execution modes. 255 * @since 4.1 256 * @version 1.1 257 */ 258enum ExecutionMode : ohos.hdi.camera.v1_2.ExecutionMode { 259 /** 260 * Default mode. 261 */ 262 DEFAULT = 3, 263}; 264 265/** 266 * @brief Enumerates camera device error types, which are used by {@link OnError}. 267 * @since 3.2 268 * @version 1.1 269 */ 270enum ErrorType : ohos.hdi.camera.v1_0.ErrorType { 271 /** 272 * sensor data error. 273 * @since 5.0 274 * @version 1.0 275 */ 276 SENSOR_DATA_ERROR = 5, 277}; 278 279/** 280 * @brief Defines the CameraDeviceResourceCost, which is used by {@link ICameraDevice::GetResourceCost}. 281 */ 282struct CameraDeviceResourceCost { 283 /** 284 * @brief Total resource cost of using current camera device, scope is [0, 100]. 285 */ 286 unsigned int resourceCost_; 287 288 /** 289 * @brief Cameradevices ID that can not open while current camera device is on. 290 */ 291 String[] conflictingDevices_; 292}; 293 294/** 295 * @brief Enumerates camera media stream type. 296 * @since 5.0 297 * @version 1.0 298 */ 299enum MediaStreamType { 300 /** 301 * video media stream 302 * @since 5.0 303 * @version 1.0 304 */ 305 MEDIA_STREAM_TYPE_VIDEO = 0, 306 /** 307 * metadata media stream 308 * @since 5.0 309 * @version 1.0 310 */ 311 MEDIA_STREAM_TYPE_METADATA = 1, 312 /** 313 * maker media stream 314 * @since 5.0 315 * @version 1.0 316 */ 317 MEDIA_STREAM_TYPE_MAKER = 2, 318}; 319 320/** 321 * @brief Defines the SteramDescription, which is used by {@link IVideoProcessSession::Prepare}. 322 * @since 5.0 323 * @version 1.0 324 */ 325struct StreamDescription { 326 /** 327 * stream id 328 * @since 5.0 329 * @version 1.0 330 */ 331 int streamId; 332 /** 333 * media stream type 334 * @since 5.0 335 * @version 1.0 336 */ 337 enum MediaStreamType type; 338 /** 339 * pixel format 340 * @since 5.0 341 * @version 1.0 342 */ 343 int pixelFormat; 344 /** 345 * image width 346 * @since 5.0 347 * @version 1.0 348 */ 349 int width; 350 /** 351 * image height 352 * @since 5.0 353 * @version 1.0 354 */ 355 int height; 356 /** 357 * image color space 358 * @since 5.0 359 * @version 1.0 360 */ 361 int dataspace; 362}; 363 364/** 365 * @brief Defines the CaptureEndedInfoExt, which is used by {@link IStreamOperatorCallback::OnCaptureEndedExt}. 366 * @since 5.0 367 * @version 1.0 368 */ 369struct CaptureEndedInfoExt { 370 /** 371 * stream id 372 * @since 5.0 373 * @version 1.0 374 */ 375 int streamId_; 376 /** 377 * frame count 378 * @since 5.0 379 * @version 1.0 380 */ 381 int frameCount_; 382 /** 383 * whether deffered video enhancement available 384 * @since 5.0 385 * @version 1.0 386 */ 387 boolean isDeferredVideoEnhancementAvailable_; 388 /** 389 * video id 390 * @since 5.0 391 * @version 1.0 392 */ 393 String videoId_; 394}; 395 396/** 397 * @brief Defines the ImageBufferInfo, which is used by {@link IImageProcessCallback::OnProcessDoneExt}. 398 * @since 5.0 399 * @version 1.0 400 */ 401struct ImageBufferInfoExt { 402 /** 403 * @brief The information of metadata. 404 * @since 5.0 405 * @version 1.0 406 */ 407 MapDataSequenceable metadata; 408 409 /** 410 * @brief The information of imageHandle. 411 * @since 5.0 412 * @version 1.0 413 */ 414 BufferHandleSequenceable imageHandle; 415 416 /** 417 * @brief If the gain map reported. 418 * @since 5.0 419 * @version 1.0 420 */ 421 boolean isGainMapValid; 422 423 /** 424 * @brief The gain map information. 425 * @since 5.0 426 * @version 1.0 427 */ 428 BufferHandleSequenceable gainMapHandle; 429 430 /** 431 * @brief Is depthMapHandle valid. 432 * @since 5.0 433 * @version 1.0 434 */ 435 boolean isDepthMapValid; 436 437 /** 438 * @brief Data of metadata. 439 * @since 5.0 440 * @version 1.0 441 */ 442 BufferHandleSequenceable depthMapHandle; 443 444 /** 445 * @brief If the unrefocus image of portrait mode reported. 446 * @since 5.0 447 * @version 1.0 448 */ 449 boolean isUnrefocusImageValid; 450 451 /** 452 * @brief The unrefocus image of portrait mode. 453 * @since 5.0 454 * @version 1.0 455 */ 456 BufferHandleSequenceable unrefocusImageHandle; 457 458 /** 459 * @brief If the high bit depth linear image reported. 460 * @since 5.0 461 * @version 1.0 462 */ 463 boolean isHighBitDepthLinearImageValid; 464 465 /** 466 * @brief The high bit depth linear image. 467 * @since 5.0 468 * @version 1.0 469 */ 470 BufferHandleSequenceable highBitDepthLinearImageHandle; 471 472 /** 473 * @brief If the exif information reported. 474 * @since 5.0 475 * @version 1.0 476 */ 477 boolean isExifValid; 478 479 /** 480 * @brief The exif information. 481 * @since 5.0 482 * @version 1.0 483 */ 484 BufferHandleSequenceable exifHandle; 485 486 /** 487 * @brief If the maker information reported. 488 * @since 5.0 489 * @version 1.0 490 */ 491 boolean isMakerInfoValid; 492 493 /** 494 * @brief The maker information. 495 * @since 5.0 496 * @version 1.0 497 */ 498 BufferHandleSequenceable makerInfoHandle; 499}; 500 501/** 502 * @brief Enumerates encoding types of stream data. 503 * @since 5.0 504 * @version 1.0 505 */ 506enum EncodeType : ohos.hdi.camera.v1_0.EncodeType { 507 /** 508 * HEIC 509 */ 510 ENCODE_TYPE_HEIC = 4, 511}; 512 513/** 514 * @brief Enumerates stream error types, which are used by {@link CaptureErrorInfo}. 515 * @since 3.2 516 * @version 1.1 517 */ 518enum StreamError : ohos.hdi.camera.v1_0.StreamError { 519 /** 520 * When the sensor temperature is higher than the threshold, the cameraHal will stop the sketch stream 521 * and report the high temperature error through by {@link OnCaptureError}. 522 * @since 5.0 523 * @version 1.0 524 */ 525 HIGH_TEMPERATURE_ERROR = 2, 526};