harmony 鸿蒙camera.h

  • 2025-06-12
  • 浏览 (4)

camera.h

Overview

The camera.h file declares the basic concepts of the camera.

Library: libohcamera.so

File to include: <ohcamera/camera.h>

System capability: SystemCapability.Multimedia.Camera.Core

Since: 11

Related module: OH_Camera

Summary

Structs

Name Description
struct Camera_Size Describes the parameters related to the size.
struct Camera_Profile Describes the profile of a camera stream.
struct Camera_FrameRateRange Describes the frame rate range.
struct Camera_VideoProfile Describes the video profile.
struct Camera_OutputCapability Describes the camera output capability.
struct Camera_Device Describes the camera device.
struct Camera_StatusInfo Describes the camera status information.
struct Camera_Point Describes the parameters related to a point.
struct Camera_Location Describes the location where the photo is taken.
struct Camera_PhotoCaptureSetting Describes the parameters related to photo capture.
struct Camera_FrameShutterInfo Describes the frame shutter information.
struct Camera_CaptureEndInfo Describes the capture end information.
struct Camera_Rect Defines the rectangle.
struct Camera_MetadataObject Describes the camera metadata.
struct Camera_TorchStatusInfo Describes the flashlight status information.
struct Camera_SmoothZoomInfo Describes the smooth zoom information.
struct Camera_CaptureStartInfo Describes the capture start information.
struct Camera_FrameShutterEndInfo Describes the frame shutter end information during capture.
struct Camera_ConcurrentInfo Describes the camera’s concurrency information.

Types

Name Description
typedef struct Camera_Manager Camera_Manager Defines a struct for the camera manager.
typedef enum Camera_ErrorCode Camera_ErrorCode Defines an enum for the camera error codes.
typedef enum Camera_Status Camera_Status Defines an enum for the camera statuses.
typedef enum Camera_SceneMode Camera_SceneMode Defines an enum for the camera scene modes.
typedef enum Camera_Position Camera_Position Defines an enum for the camera positions.
typedef enum Camera_Type Camera_Type Defines an enum for the camera types.
typedef enum Camera_Connection Camera_Connection Defines an enum for the camera connection types.
typedef enum Camera_Format Camera_Format Defines an enum for the camera output formats.
typedef enum Camera_FlashMode Camera_FlashMode Defines an enum for the flash modes.
typedef enum Camera_ExposureMode Camera_ExposureMode Defines an enum for the exposure modes.
typedef enum Camera_FocusMode Camera_FocusMode Defines an enum for the focus modes.
typedef enum Camera_FocusState Camera_FocusState Defines an enum for the focus states.
typedef enum Camera_VideoStabilizationMode Camera_VideoStabilizationMode Defines an enum for the video stabilization modes.
typedef enum Camera_ImageRotation Camera_ImageRotation Defines an enum for the image rotation angles.
typedef enum Camera_QualityLevel Camera_QualityLevel Defines an enum for the image quality levels.
typedef enum Camera_MetadataObjectType Camera_MetadataObjectType Defines an enum for the metadata object types.
typedef enum Camera_TorchMode Camera_TorchMode Defines an enum for the flashlight modes.
typedef enum Camera_SmoothZoomMode Camera_SmoothZoomMode Defines an enum for the smooth zoom modes.
typedef enum Camera_PreconfigType Camera_PreconfigType Defines an enum for the preconfigured photo resolution types.
typedef enum Camera_PreconfigRatio Camera_PreconfigRatio Defines an enum for the preconfigured photo aspect ratios.
typedef enum Camera_HostDeviceType Camera_HostDeviceType Defines an enum for the remote device types.
typedef struct Camera_Size Camera_Size Defines a struct for the parameters related to the size.
typedef struct Camera_Profile Camera_Profile Defines a struct for the profile of the camera stream.
typedef struct Camera_FrameRateRange Camera_FrameRateRange Defines a struct for the frame rate range.
typedef struct Camera_VideoProfile Camera_VideoProfile Defines a struct for the video profile.
typedef struct Camera_OutputCapability Camera_OutputCapability Defines a struct for the camera output capability.
typedef struct Camera_Device Camera_Device Defines a struct for the camera device.
typedef struct Camera_StatusInfo Camera_StatusInfo Defines a struct for the camera status information.
typedef struct Camera_Point Camera_Point Defines a struct for the parameters related to a point.
typedef struct Camera_Location Camera_Location Defines a struct for the location where the photo is taken.
typedef struct Camera_PhotoCaptureSetting Camera_PhotoCaptureSetting Defines a struct for the parameters related to photo capture.
typedef struct Camera_FrameShutterInfo Camera_FrameShutterInfo Defines a struct for the frame shutter information.
typedef struct Camera_CaptureEndInfo Camera_CaptureEndInfo Defines a struct for the capture end information.
typedef struct Camera_Rect Camera_Rect Defines a struct for the rectangle.
typedef struct Camera_MetadataObject Camera_MetadataObject Defines a struct for the camera metadata.
typedef struct Camera_TorchStatusInfo Camera_TorchStatusInfo Defines a struct for the flashlight status information.
typedef struct Camera_SmoothZoomInfo Camera_SmoothZoomInfo Defines a struct for the smooth zoom information.
typedef struct Camera_CaptureStartInfo Camera_CaptureStartInfo Defines a struct for the capture start information.
typedef struct Camera_FrameShutterEndInfo Camera_FrameShutterEndInfo Defines a struct for the frame shutter end information during capture.
typedef enum Camera_ConcurrentType Camera_ConcurrentType Defines an enum for the camera’s concurrency types.
typedef struct Camera_ConcurrentInfo Camera_ConcurrentInfo Defines a struct for the camera’s concurrency information.

Enums

Name Description
Camera_ErrorCode {
CAMERA_OK = 0,
CAMERA_INVALID_ARGUMENT = 7400101,
CAMERA_OPERATION_NOT_ALLOWED = 7400102,
CAMERA_SESSION_NOT_CONFIG = 7400103,
CAMERA_SESSION_NOT_RUNNING = 7400104,
CAMERA_SESSION_CONFIG_LOCKED = 7400105,
CAMERA_DEVICE_SETTING_LOCKED = 7400106,
CAMERA_CONFLICT_CAMERA = 7400107,
CAMERA_DEVICE_DISABLED = 7400108,
CAMERA_DEVICE_PREEMPTED = 7400109,
CAMERA_UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS = 7400110,
CAMERA_SERVICE_FATAL_ERROR = 7400201}
Enumerates the camera error codes.
Camera_Status {
CAMERA_STATUS_APPEAR = 0,
CAMERA_STATUS_DISAPPEAR = 1,
CAMERA_STATUS_AVAILABLE = 2,
CAMERA_STATUS_UNAVAILABLE = 3 }
Enumerates the camera statuses.
Camera_SceneMode {
NORMAL_PHOTO = 1,
NORMAL_VIDEO = 2,
SECURE_PHOTO = 12 }
Enumerates the camera scene modes.
Camera_Position {
CAMERA_POSITION_UNSPECIFIED = 0,
CAMERA_POSITION_BACK = 1,
CAMERA_POSITION_FRONT = 2 }
Enumerates the camera positions.
Camera_Type {
CAMERA_TYPE_DEFAULT = 0,
CAMERA_TYPE_WIDE_ANGLE = 1,
CAMERA_TYPE_ULTRA_WIDE = 2,
CAMERA_TYPE_TELEPHOTO = 3,
CAMERA_TYPE_TRUE_DEPTH = 4
}
Enumerates the camera types.
Camera_Connection {
CAMERA_CONNECTION_BUILT_IN = 0,
CAMERA_CONNECTION_USB_PLUGIN = 1,
CAMERA_CONNECTION_REMOTE = 2 }
Enumerates the camera connection types.
Camera_Format {
CAMERA_FORMAT_RGBA_8888 = 3,
CAMERA_FORMAT_YUV_420_SP = 1003,
CAMERA_FORMAT_JPEG = 2000,
CAMERA_FORMAT_YCBCR_P010 = 2001,
CAMERA_FORMAT_YCRCB_P010 = 2002
}
Enumerates the camera output formats.
Camera_FlashMode {
FLASH_MODE_CLOSE = 0,
FLASH_MODE_OPEN = 1,
FLASH_MODE_AUTO = 2,
FLASH_MODE_ALWAYS_OPEN = 3 }
Enumerates the flash modes.
Camera_ExposureMode {
EXPOSURE_MODE_LOCKED = 0,
EXPOSURE_MODE_AUTO = 1,
EXPOSURE_MODE_CONTINUOUS_AUTO = 2 }
Enumerates the exposure modes.
Camera_FocusMode {
FOCUS_MODE_MANUAL = 0,
FOCUS_MODE_CONTINUOUS_AUTO = 1,
FOCUS_MODE_AUTO = 2,
FOCUS_MODE_LOCKED = 3 }
Enumerates the focus modes.
Camera_FocusState {
FOCUS_STATE_SCAN = 0,
FOCUS_STATE_FOCUSED = 1,
FOCUS_STATE_UNFOCUSED = 2 }
Enumerates the focus states.
Camera_VideoStabilizationMode {
STABILIZATION_MODE_OFF = 0,
STABILIZATION_MODE_LOW = 1,
STABILIZATION_MODE_MIDDLE = 2,
STABILIZATION_MODE_HIGH = 3,
STABILIZATION_MODE_AUTO = 4
}
Enumerates the video stabilization modes.
Camera_ImageRotation {
IAMGE_ROTATION_0 = 0,
IAMGE_ROTATION_90 = 90,
IAMGE_ROTATION_180 = 180,
IAMGE_ROTATION_270 = 270 }
Enumerates the image rotation angles.
Camera_QualityLevel {
QUALITY_LEVEL_HIGH = 0,
QUALITY_LEVEL_MEDIUM = 1,
QUALITY_LEVEL_LOW = 2 }
Enumerates the image quality levels.
Camera_MetadataObjectType { FACE_DETECTION = 0 } Enumerates the metadata object types.
Camera_TorchMode { OFF = 0, ON = 1, AUTO = 2 } Enumerates the flashlight modes.
Camera_SmoothZoomMode { NORMAL = 0 } Enumerates the smooth zoom modes.
Camera_PreconfigType {
PRECONFIG_720P = 0,
PRECONFIG_1080P = 1,
PRECONFIG_4K = 2,
PRECONFIG_HIGH_QUALITY = 3 }
Enumerates the preconfigured photo resolution types.
Camera_PreconfigRatio {
PRECONFIG_RATIO_1_1 = 0,
PRECONFIG_RATIO_4_3 = 1,
PRECONFIG_RATIO_16_9 = 2 }
Enumerates the preconfigured photo aspect ratios.
Camera_HostDeviceType {
HOST_DEVICE_TYPE_UNKNOWN_TYPE = 0,
HOST_DEVICE_TYPE_PHONE = 0x0E,
HOST_DEVICE_TYPE_TABLET = 0x11 }
Enumerates the remote device types.
Camera_QualityPrioritization { HIGH_QUALITY = 0, POWER_BALANCE = 1 } Enumerates the priority levels for video recording quality.
Camera_ConcurrentType {
CAMERA_CONCURRENT_TYPE_LIMITED_CAPABILITY = 0,
CAMERA_CONCURRENT_TYPE_FULL_CAPABILITY = 1 }
Enumerates the camera’s concurrency types.

Functions

Name Description
Camera_ErrorCode OH_Camera_GetCameraManager (Camera_Manager **cameraManager) Obtains a CameraManager instance.
Camera_ErrorCode OH_Camera_DeleteCameraManager (Camera_Manager *cameraManager) Deletes a CameraManager instance.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Camera Kit

harmony 鸿蒙Camera_CaptureEndInfo

harmony 鸿蒙Camera_CaptureStartInfo

harmony 鸿蒙Camera_ConcurrentInfo

harmony 鸿蒙Camera_Device

harmony 鸿蒙Camera_FrameRateRange

harmony 鸿蒙Camera_FrameShutterEndInfo

harmony 鸿蒙Camera_FrameShutterInfo

harmony 鸿蒙Camera_Location

harmony 鸿蒙Camera_MetadataObject

0  赞