OH_Camera
Overview
The OH_Camera module provides C APIs for the camera service.
System capability: SystemCapability.Multimedia.Camera.Core
Since: 11
Summary
File
Name | Description |
---|---|
camera.h | Declares the basic concepts of the camera. Library: libohcamera.so File to include: <ohcamera/camera.h> |
camera_input.h | Declares the camera input concepts. Library: libohcamera.so File to include: <ohcamera/camera_input.h> |
camera_manager.h | Declares the camera manager concepts. Library: libohcamera.so File to include: <ohcamera/camera_manager.h> |
capture_session.h | Declares the session capture concepts. Library: libohcamera.so File to include: <ohcamera/capture_session.h> |
metadata_output.h | Declares the metadata output concepts. Library: libohcamera.so File to include: <ohcamera/metadata_output.h> |
photo_output.h | Declares the photo output concepts. Library: libohcamera.so File to include: <ohcamera/photo_output.h> |
preview_output.h | Declares the preview output concepts. Library: libohcamera.so File to include: <ohcamera/preview_output.h> |
video_output.h | Declares the video output concepts. Library: libohcamera.so File to include: <ohcamera/video_output.h> |
Structs
Name | Description |
---|---|
struct Camera_Size | Defines the parameters that describe the size. |
struct Camera_Profile | Defines the profile of the camera stream. |
struct Camera_FrameRateRange | Defines the frame rate range. |
struct Camera_VideoProfile | Defines the video profile. |
struct Camera_OutputCapability | Defines the camera output capability. |
struct Camera_Device | Defines the camera device. |
struct Camera_StatusInfo | Defines the camera status information. |
struct Camera_Point | Defines the parameters that describe a point. |
struct Camera_Location | Defines the location where the photo is taken. |
struct Camera_PhotoCaptureSetting | Defines the photographing parameters. |
struct Camera_FrameShutterInfo | Defines the frame shutter callback. |
struct Camera_CaptureEndInfo | Defines the capture end information. |
struct Camera_Rect | Defines the rectangle. |
struct Camera_MetadataObject | Defines the camera metadata. |
struct CameraInput_Callbacks | Defines the callbacks used to listen for camera input errors. |
struct CameraManager_Callbacks | Defines the callbacks used to listen for camera status changes. |
struct CaptureSession_Callbacks | Defines the callbacks used for session capture. |
struct MetadataOutput_Callbacks | Defines the callback functions of metadata output. |
struct PhotoOutput_Callbacks | Defines the callbacks used for photo output. |
struct PreviewOutput_Callbacks | Defines the callbacks used for preview output. |
struct VideoOutput_Callbacks | Defines the callbacks used for video output. |
Types
Name | Description |
---|---|
typedef struct Camera_Manager Camera_Manager | Defines the camera manager. |
typedef enum Camera_ErrorCode Camera_ErrorCode | Defines an enum for camera error codes. |
typedef enum Camera_Status Camera_Status | Defines an enum for camera statuses. |
typedef enum Camera_Position Camera_Position | Defines an enum for camera positions. |
typedef enum Camera_Type Camera_Type | Defines an enum for camera types. |
typedef enum Camera_Connection Camera_Connection | Defines an enum for camera connection types. |
typedef enum Camera_Format Camera_Format | Defines an enum for camera output formats. |
typedef enum Camera_FlashMode Camera_FlashMode | Defines an enum for flash modes. |
typedef enum Camera_ExposureMode Camera_ExposureMode | Defines an enum for exposure modes. |
typedef enum Camera_FocusMode Camera_FocusMode | Defines an enum for focus modes. |
typedef enum Camera_FocusState Camera_FocusState | Defines an enum for focus states. |
typedef enum Camera_VideoStabilizationMode Camera_VideoStabilizationMode | Defines an enum for video stabilization modes. |
typedef enum Camera_ImageRotation Camera_ImageRotation | Defines an enum for image rotation angles. |
typedef enum Camera_QualityLevel Camera_QualityLevel | Defines an enum for image quality levels. |
typedef enum Camera_MetadataObjectType Camera_MetadataObjectType | Defines an enum for metadata object types. |
typedef struct Camera_Size Camera_Size | Defines the parameters that describe the size. |
typedef struct Camera_Profile Camera_Profile | Defines the profile of the camera stream. |
typedef struct Camera_FrameRateRange Camera_FrameRateRange | Defines the frame rate range. |
typedef struct Camera_VideoProfile Camera_VideoProfile | Defines the video profile. |
typedef struct Camera_OutputCapability Camera_OutputCapability | Defines the camera output capability. |
typedef struct Camera_Device Camera_Device | Defines the camera device. |
typedef struct Camera_StatusInfo Camera_StatusInfo | Defines the camera status information. |
typedef struct Camera_Point Camera_Point | Defines the parameters that describe a point. |
typedef struct Camera_Location Camera_Location | Defines the location where the photo is taken. |
typedef struct Camera_PhotoCaptureSetting Camera_PhotoCaptureSetting | Defines the photographing parameters. |
typedef struct Camera_FrameShutterInfo Camera_FrameShutterInfo | Defines the frame shutter callback. |
typedef struct Camera_CaptureEndInfo Camera_CaptureEndInfo | Defines the capture end information. |
typedef struct Camera_Rect Camera_Rect | Defines the rectangle. |
typedef struct Camera_MetadataObject Camera_MetadataObject | Defines the camera metadata. |
typedef struct Camera_Input Camera_Input | Defines the camera input object. |
typedef void(* OH_CameraInput_OnError) (const Camera_Input *cameraInput, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the CameraInput_Callbacks struct and used to report camera input errors. |
typedef struct CameraInput_Callbacks CameraInput_Callbacks | Defines the callbacks used to listen for camera input errors. |
typedef void(* OH_CameraManager_StatusCallback) (Camera_Manager *cameraManager, Camera_StatusInfo *status) | Defines the pointer to the callback defined in the CameraManager_Callbacks struct and used to report the camera manager status. |
typedef struct CameraManager_Callbacks CameraManager_Callbacks | Defines the callbacks used to listen for camera status changes. |
typedef struct Camera_CaptureSession Camera_CaptureSession | Defines the session capture object. |
typedef void(* OH_CaptureSession_OnFocusStateChange) (Camera_CaptureSession *session, Camera_FocusState focusState) | Defines the pointer to the callback defined in the CaptureSession_Callbacks struct and used to report session capture focus status changes. |
typedef void(* OH_CaptureSession_OnError) (Camera_CaptureSession *session, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the CaptureSession_Callbacks struct and used to report capture session errors. |
typedef struct CaptureSession_Callbacks CaptureSession_Callbacks | Defines the callbacks used for session capture. |
typedef struct Camera_MetadataOutput Camera_MetadataOutput | Defines the metadata output object. |
typedef void(* OH_MetadataOutput_OnMetadataObjectAvailable) (Camera_MetadataOutput *metadataOutput, Camera_MetadataObject *metadataObject, uint32_t size) | Defines the pointer to the callback defined in the MetadataOutput_Callbacks struct and used to report metadata output data. |
typedef void(* OH_MetadataOutput_OnError) (Camera_MetadataOutput *metadataOutput, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the MetadataOutput_Callbacks struct and used to report metadata output errors. |
typedef struct MetadataOutput_Callbacks MetadataOutput_Callbacks | Defines the callback functions of metadata output. |
typedef struct Camera_PhotoOutput Camera_PhotoOutput | Defines the photo output object. |
typedef void(* OH_PhotoOutput_OnFrameStart) (Camera_PhotoOutput *photoOutput) | Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame start events. |
typedef void(* OH_PhotoOutput_OnFrameShutter) (Camera_PhotoOutput *photoOutput, Camera_FrameShutterInfo *info) | Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report frame shutter events. |
typedef void(* OH_PhotoOutput_OnFrameEnd) (Camera_PhotoOutput *photoOutput, int32_t frameCount) | Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame end events. |
typedef void(* OH_PhotoOutput_OnError) (Camera_PhotoOutput *photoOutput, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output errors. |
typedef struct PhotoOutput_Callbacks PhotoOutput_Callbacks | Defines the callbacks used for photo output. |
typedef struct Camera_PreviewOutput Camera_PreviewOutput | Defines the preview output object. |
typedef void(* OH_PreviewOutput_OnFrameStart) (Camera_PreviewOutput *previewOutput) | Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used to report preview output frame start events. |
typedef void(* OH_PreviewOutput_OnFrameEnd) (Camera_PreviewOutput *previewOutput, int32_t frameCount) | Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used to report preview output frame end events. |
typedef void(* OH_PreviewOutput_OnError) (Camera_PreviewOutput *previewOutput, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used to report preview output errors. |
typedef struct PreviewOutput_Callbacks PreviewOutput_Callbacks | Defines the callbacks used for preview output. |
typedef struct Camera_VideoOutput Camera_VideoOutput | Defines the video output object. |
typedef void(* OH_VideoOutput_OnFrameStart) (Camera_VideoOutput *videoOutput) | Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output frame start events. |
typedef void(* OH_VideoOutput_OnFrameEnd) (Camera_VideoOutput *videoOutput, int32_t frameCount) | Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output frame end events. |
typedef void(* OH_VideoOutput_OnError) (Camera_VideoOutput *videoOutput, Camera_ErrorCode errorCode) | Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output errors. |
typedef struct VideoOutput_Callbacks VideoOutput_Callbacks | Defines the callbacks used for video output. |
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_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_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 } |
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. |
Functions
Type Description
Camera_CaptureEndInfo
typedef struct Camera_CaptureEndInfo Camera_CaptureEndInfo
Description
Defines the capture end information.
Since: 11
Camera_CaptureSession
typedef struct Camera_CaptureSession Camera_CaptureSession
Description
Defines the session capture object.
You can call OH_CameraManager_CreateCaptureSession to create such an object.
Since: 11
Camera_Connection
typedef enum Camera_Connection Camera_Connection
Description
Defines an enum for camera connection types.
Since: 11
Camera_Device
typedef struct Camera_Device Camera_Device
Description
Defines the camera device.
Since: 11
Camera_ErrorCode
typedef enum Camera_ErrorCode Camera_ErrorCode
Description
Defines an enum for camera error codes.
Since: 11
Camera_ExposureMode
typedef enum Camera_ExposureMode Camera_ExposureMode
Description
Defines an enum for exposure modes.
Since: 11
Camera_FlashMode
typedef enum Camera_FlashMode Camera_FlashMode
Description
Defines an enum forflash modes.
Since: 11
Camera_FocusMode
typedef enum Camera_FocusMode Camera_FocusMode
Description
Defines an enum for focus modes.
Since: 11
Camera_FocusState
typedef enum Camera_FocusState Camera_FocusState
Description
Defines an enum for focus states.
Since: 11
Camera_Format
typedef enum Camera_Format Camera_Format
Description
Defines an enum for camera output formats.
Since: 11
Camera_FrameRateRange
typedef struct Camera_FrameRateRange Camera_FrameRateRange
Description
Defines the frame rate range.
Since: 11
Camera_FrameShutterInfo
typedef struct Camera_FrameShutterInfo Camera_FrameShutterInfo
Description
Defines the frame shutter callback.
Since: 11
Camera_ImageRotation
typedef enum Camera_ImageRotation Camera_ImageRotation
Description
Defines an enum for image rotation angles.
Since: 11
Camera_Input
typedef struct Camera_Input Camera_Input
Description
Defines the camera input object.
You can call OH_CameraManager_CreateCameraInput to create such an object.
Since: 11
Camera_Location
typedef struct Camera_Location Camera_Location
Description
Defines the location where the photo is taken.
Since: 11
Camera_Manager
typedef struct Camera_Manager Camera_Manager
Description
Defines the camera manager.
You can call OH_Camera_GetCameraManager to create such an object.
Since: 11
Camera_MetadataObject
typedef struct Camera_MetadataObject Camera_MetadataObject
Description
Defines the camera metadata.
Since: 11
Camera_MetadataObjectType
typedef enum Camera_MetadataObjectType Camera_MetadataObjectType
Description
Defines an enum for metadata object types.
Since: 11
Camera_MetadataOutput
typedef struct Camera_MetadataOutput Camera_MetadataOutput
Description
Defines the metadata output object.
You can call OH_CameraManager_CreateMetadataOutput to create such an object.
Since: 11
Camera_OutputCapability
typedef struct Camera_OutputCapability Camera_OutputCapability
Description
Defines the camera output capability.
Since: 11
Camera_PhotoCaptureSetting
typedef struct Camera_PhotoCaptureSetting Camera_PhotoCaptureSetting
Description
Defines the photographing parameters.
Since: 11
Camera_PhotoOutput
typedef struct Camera_PhotoOutput Camera_PhotoOutput
Description
Defines the photo output object.
You can call OH_CameraManager_CreatePhotoOutput to create such an object.
Since: 11
Camera_Point
typedef struct Camera_Point Camera_Point
Description
Defines the parameters that describe a point.
Since: 11
Camera_Position
typedef enum Camera_Position Camera_Position
Description
Defines an enum for camera positions.
Since: 11
Camera_PreviewOutput
typedef struct Camera_PreviewOutput Camera_PreviewOutput
Description
Defines the preview output object.
You can call OH_CameraManager_CreatePreviewOutput to create such an object.
Since: 11
Camera_Profile
typedef struct Camera_Profile Camera_Profile
Description
Defines the profile of the camera stream.
Since: 11
Camera_QualityLevel
typedef enum Camera_QualityLevel Camera_QualityLevel
Description
Defines an enum for image quality levels.
Since: 11
Camera_Rect
typedef struct Camera_Rect Camera_Rect
Description
Defines the rectangle.
Since: 11
Camera_Size
typedef struct Camera_Size Camera_Size
Description
Defines the parameters that describe the size.
Since: 11
Camera_Status
typedef enum Camera_Status Camera_Status
Description
Defines an enum for camera statuses.
Since: 11
Camera_StatusInfo
typedef struct Camera_StatusInfo Camera_StatusInfo
Description
Defines the camera status information.
Since: 11
Camera_Type
typedef enum Camera_Type Camera_Type
Description
Defines an enum for camera types.
Since: 11
Camera_VideoOutput
typedef struct Camera_VideoOutput Camera_VideoOutput
Description
Defines the video output object.
You can call OH_CameraManager_CreateVideoOutput to create such an object.
Since: 11
Camera_VideoProfile
typedef struct Camera_VideoProfile Camera_VideoProfile
Description
Defines the video profile.
Since: 11
Camera_VideoStabilizationMode
typedef enum Camera_VideoStabilizationMode Camera_VideoStabilizationMode
Description
Defines an enum for video stabilization modes.
Since: 11
CameraInput_Callbacks
typedef struct CameraInput_Callbacks CameraInput_Callbacks
Description
Defines the callbacks used to listen for camera input errors.
Since: 11
See
OH_CameraInput_RegisterCallback
CameraManager_Callbacks
typedef struct CameraManager_Callbacks CameraManager_Callbacks
Description
Defines the callbacks used to listen for camera status changes.
Since: 11
See
OH_CameraManager_RegisterCallback
CaptureSession_Callbacks
typedef struct CaptureSession_Callbacks CaptureSession_Callbacks
Description
Defines the callbacks used for session capture.
Since: 11
See
OH_CaptureSession_RegisterCallback
MetadataOutput_Callbacks
typedef struct MetadataOutput_Callbacks MetadataOutput_Callbacks
Description
Defines the callback functions of metadata output.
Since: 11
See
OH_MetadataOutput_RegisterCallback
OH_CameraInput_OnError
typedef void(* OH_CameraInput_OnError) (const Camera_Input *cameraInput, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the CameraInput_Callbacks struct and used to report camera input errors.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to the Camera_Input instance that transfers the callback. |
errorCode | Error code reported during camera input and defined in Camera_ErrorCode. |
See
In Camera_ErrorCode:
CAMERA_CONFLICT_CAMERA
CAMERA_DEVICE_DISABLED
CAMERA_DEVICE_PREEMPTED
CAMERA_SERVICE_FATAL_ERROR
OH_CameraManager_StatusCallback
typedef void(* OH_CameraManager_StatusCallback) (Camera_Manager *cameraManager, Camera_StatusInfo *status)
Description
Defines the pointer to the callback defined in the CameraManager_Callbacks struct and used to report the camera manager status.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to the Camera_Manager instance that transfers the callback. |
status | Pointer to the camera manager status, which is defined in the Camera_StatusInfo struct. |
OH_CaptureSession_OnError
typedef void(* OH_CaptureSession_OnError) (Camera_CaptureSession *session, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the CaptureSession_Callbacks struct and used to report capture session errors.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
errorCode | Error code reported during session capture and defined in Camera_ErrorCode. |
See
CAMERA_SERVICE_FATAL_ERROR in Camera_ErrorCode
OH_CaptureSession_OnFocusStateChange
typedef void(* OH_CaptureSession_OnFocusStateChange) (Camera_CaptureSession *session, Camera_FocusState focusState)
Description
Defines the pointer to the callback defined in the CaptureSession_Callbacks struct and used to report session capture focus status changes.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the Camera_CaptureSession instance that transfers the callback. |
focusState | Focus state, which is defined in Camera_FocusState. |
OH_MetadataOutput_OnError
typedef void(* OH_MetadataOutput_OnError) (Camera_MetadataOutput *metadataOutput, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the MetadataOutput_Callbacks struct and used to report metadata output errors.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the Camera_MetadataOutput instance that transfers the callback. |
errorCode | Error code reported during metadata output and defined in Camera_ErrorCode. |
See
CAMERA_SERVICE_FATAL_ERROR in Camera_ErrorCode
OH_MetadataOutput_OnMetadataObjectAvailable
typedef void(* OH_MetadataOutput_OnMetadataObjectAvailable) (Camera_MetadataOutput *metadataOutput, Camera_MetadataObject *metadataObject, uint32_t size)
Description
Defines the pointer to the callback defined in the MetadataOutput_Callbacks struct and used to report metadata output data.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the Camera_MetadataOutput instance that transfers the callback. |
metadataObject | Pointer to the metadata output data, which is defined in the Camera_MetadataObject struct. |
size | Size of the metadata object. |
OH_PhotoOutput_OnError
typedef void(* OH_PhotoOutput_OnError) (Camera_PhotoOutput *photoOutput, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output errors.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the Camera_PhotoOutput instance that transfers the callback. |
errorCode | Error code reported during photo output and defined in Camera_ErrorCode. |
See
CAMERA_SERVICE_FATAL_ERROR in Camera_ErrorCode
OH_PhotoOutput_OnFrameEnd
typedef void(* OH_PhotoOutput_OnFrameEnd) (Camera_PhotoOutput *photoOutput, int32_t frameCount)
Description
Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame end events.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the Camera_PhotoOutput instance that transfers the callback. |
frameCount | Number of frames to be included in the callback. |
OH_PhotoOutput_OnFrameShutter
typedef void(* OH_PhotoOutput_OnFrameShutter) (Camera_PhotoOutput *photoOutput, Camera_FrameShutterInfo *info)
Description
Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report frame shutter events.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the Camera_PhotoOutput instance that transfers the callback. |
info | Pointer to the frame shutter information, which is defined in the Camera_FrameShutterInfo struct. |
OH_PhotoOutput_OnFrameStart
typedef void(* OH_PhotoOutput_OnFrameStart) (Camera_PhotoOutput *photoOutput)
Description
Defines the pointer to the callback defined in the PhotoOutput_Callbacks struct and used to report photo output frame start events.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the Camera_PhotoOutput instance that transfers the callback. |
OH_PreviewOutput_OnError
typedef void(* OH_PreviewOutput_OnError) (Camera_PreviewOutput *previewOutput, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used to report preview output errors.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the Camera_PreviewOutput instance that transfers the callback. |
errorCode | Error code reported during preview output and defined in Camera_ErrorCode. |
See
CAMERA_SERVICE_FATAL_ERROR in Camera_ErrorCode
OH_PreviewOutput_OnFrameEnd
typedef void(* OH_PreviewOutput_OnFrameEnd) (Camera_PreviewOutput *previewOutput, int32_t frameCount)
Description
Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used report preview output frame end events.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the Camera_PreviewOutput instance that transfers the callback. |
frameCount | Number of frames to be included in the callback. |
OH_PreviewOutput_OnFrameStart
typedef void(* OH_PreviewOutput_OnFrameStart) (Camera_PreviewOutput *previewOutput)
Description
Defines the pointer to the callback defined in the PreviewOutput_Callbacks struct and used to report preview output frame start events.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the Camera_PreviewOutput instance that transfers the callback. |
OH_VideoOutput_OnError
typedef void(* OH_VideoOutput_OnError) (Camera_VideoOutput *videoOutput, Camera_ErrorCode errorCode)
Description
Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output errors.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the Camera_VideoOutput instance that transfers the callback. |
errorCode | Error code reported during video output and defined in Camera_ErrorCode. |
See
CAMERA_SERVICE_FATAL_ERROR in Camera_ErrorCode
OH_VideoOutput_OnFrameEnd
typedef void(* OH_VideoOutput_OnFrameEnd) (Camera_VideoOutput *videoOutput, int32_t frameCount)
Description
Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output frame end events.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the Camera_VideoOutput instance that transfers the callback. |
frameCount | Number of frames to be included in the callback. |
OH_VideoOutput_OnFrameStart
typedef void(* OH_VideoOutput_OnFrameStart) (Camera_VideoOutput *videoOutput)
Description
Defines the pointer to the callback defined in the VideoOutput_Callbacks struct and used to report video output frame start events.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the Camera_VideoOutput instance that transfers the callback. |
PhotoOutput_Callbacks
typedef struct PhotoOutput_CallbacksPhotoOutput_Callbacks
Description
Defines the callbacks used for photo output.
Since: 11
See
OH_PhotoOutput_RegisterCallback
PreviewOutput_Callbacks
typedef struct PreviewOutput_CallbacksPreviewOutput_Callbacks
Description
Defines the callbacks used for preview output.
Since: 11
See
OH_PreviewOutput_RegisterCallback
VideoOutput_Callbacks
typedef struct VideoOutput_CallbacksVideoOutput_Callbacks
Description
Defines the callbacks used for video output.
Since: 11
See
OH_VideoOutput_RegisterCallback
Enum Description
Camera_Connection
enum Camera_Connection
Description
Enumerates the camera connection types.
Since: 11
Value | Description |
---|---|
CAMERA_CONNECTION_BUILT_IN | Built-in camera. |
CAMERA_CONNECTION_USB_PLUGIN | Camera connected using USB. |
CAMERA_CONNECTION_REMOTE | Remote camera. |
Camera_ErrorCode
enum Camera_ErrorCode
Description
Enumerates the camera error codes.
Since: 11
Value | Description |
---|---|
CAMERA_OK | The camera is normal. |
CAMERA_INVALID_ARGUMENT | A parameter is missing or the parameter type is incorrect. |
CAMERA_OPERATION_NOT_ALLOWED | The operation is not allowed. |
CAMERA_SESSION_NOT_CONFIG | The session is not configured. |
CAMERA_SESSION_NOT_RUNNING | The session is not running. |
CAMERA_SESSION_CONFIG_LOCKED | The session configuration is locked. |
CAMERA_DEVICE_SETTING_LOCKED | The device setting is locked. |
CAMERA_CONFLICT_CAMERA | The device is already started. |
CAMERA_DEVICE_DISABLED | The camera is disabled for security reasons. |
CAMERA_DEVICE_PREEMPTED | The camera is preempted. |
CAMERA_SERVICE_FATAL_ERROR | A fatal error occurs in the camera service. |
Camera_ExposureMode
enum Camera_ExposureMode
Description
Enumerates the exposure modes.
Since: 11
Value | Description |
---|---|
EXPOSURE_MODE_LOCKED | Exposure locked. |
EXPOSURE_MODE_AUTO | Auto exposure. |
EXPOSURE_MODE_CONTINUOUS_AUTO | Continuous auto exposure. |
Camera_FlashMode
enum Camera_FlashMode
Description
Enumerates the flash modes.
Since: 11
Value | Description |
---|---|
FLASH_MODE_CLOSE | The flash is off. |
FLASH_MODE_OPEN | The flash is on. |
FLASH_MODE_AUTO | The flash mode is auto. |
FLASH_MODE_ALWAYS_OPEN | The flash is steady on. |
Camera_FocusMode
enum Camera_FocusMode
Description
Enumerates the focus modes.
Since: 11
Value | Description |
---|---|
FOCUS_MODE_MANUAL | Manual focus. |
FOCUS_MODE_CONTINUOUS_AUTO | Continuous auto focus. |
FOCUS_MODE_AUTO | Auto focus. |
FOCUS_MODE_LOCKED | Focus locked. |
Camera_FocusState
enum Camera_FocusState
Description
Enumerates the focus states.
Since: 11
Value | Description |
---|---|
FOCUS_STATE_SCAN | Focusing. |
FOCUS_STATE_FOCUSED | Focused. |
FOCUS_STATE_UNFOCUSED | Unfocused. |
Camera_Format
enum Camera_Format
Description
Enumerates the camera output formats.
Since: 11
Value | Description |
---|---|
CAMERA_FORMAT_RGBA_8888 | RGBA 8888. |
CAMERA_FORMAT_YUV_420_SP | YUV 420 SP. |
CAMERA_FORMAT_JPEG | JPEG. |
Camera_ImageRotation
enum Camera_ImageRotation
Description
Enumerates the image rotation angles.
Since: 11
Value | Description |
---|---|
IAMGE_ROTATION_0 | The image rotates 0 degrees. |
IAMGE_ROTATION_90 | The image rotates 90 degrees. |
IAMGE_ROTATION_180 | The image rotates 180 degrees. |
IAMGE_ROTATION_270 | The image rotates 270 degrees. |
Camera_MetadataObjectType
enum Camera_MetadataObjectType
Description
Enumerates the metadata object types.
Since: 11
Value | Description |
---|---|
FACE_DETECTION | Face detection. |
Camera_Position
enum Camera_Position
Description
Enumerates the camera positions.
Since: 11
Value | Description |
---|---|
CAMERA_POSITION_UNSPECIFIED | Unspecified position. |
CAMERA_POSITION_BACK | Rear camera. |
CAMERA_POSITION_FRONT | Front camera. |
Camera_QualityLevel
enum Camera_QualityLevel
Description
Enumerates the image quality levels.
Since: 11
Value | Description |
---|---|
QUALITY_LEVEL_HIGH | High image quality. |
QUALITY_LEVEL_MEDIUM | Medium image quality. |
QUALITY_LEVEL_LOW | Low image quality. |
Camera_Status
enum Camera_Status
Description
Enumerates the camera statuses.
Since: 11
Value | Description |
---|---|
CAMERA_STATUS_APPEAR | A camera appears. |
CAMERA_STATUS_DISAPPEAR | The camera disappears. |
CAMERA_STATUS_AVAILABLE | The camera is available. |
CAMERA_STATUS_UNAVAILABLE | The camera is unavailable. |
Camera_Type
enum Camera_Type
Description
Enumerates the camera types.
Since: 11
Value | Description |
---|---|
CAMERA_TYPE_DEFAULT | Default camera type. |
CAMERA_TYPE_WIDE_ANGLE | Wide camera. |
CAMERA_TYPE_ULTRA_WIDE | Ultra wide camera. |
CAMERA_TYPE_TELEPHOTO | Telephone camera. |
CAMERA_TYPE_TRUE_DEPTH | Camera with depth of field information. |
Camera_VideoStabilizationMode
enum Camera_VideoStabilizationMode
Description
Enumerates the video stabilization modes.
Since: 11
Value | Description |
---|---|
STABILIZATION_MODE_OFF | Video stabilization is disabled. |
STABILIZATION_MODE_LOW | The basic video stabilization algorithm is used. |
STABILIZATION_MODE_MIDDLE | A video stabilization algorithm with a stabilization effect better than that of the LOW type is used. |
STABILIZATION_MODE_HIGH | A video stabilization algorithm with a stabilization effect better than that of the MIDDLE type is used. |
STABILIZATION_MODE_AUTO | Automatic video stabilization is used. This value is available for HDF cameras. |
Function Description
OH_Camera_DeleteCameraManager()
Camera_ErrorCode OH_Camera_DeleteCameraManager (Camera_Manager * cameraManager)
Description
Deletes a CameraManager instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to the target Camera_Manager instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_Camera_GetCameraManager()
Camera_ErrorCode OH_Camera_GetCameraManager (Camera_Manager ** cameraManager)
Description
Obtains a CameraManager instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Double pointer to the Camera_Manager instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraInput_Close()
Camera_ErrorCode OH_CameraInput_Close (Camera_Input * cameraInput)
Description
Closes a camera.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to the target Camera_Input instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraInput_Open()
Camera_ErrorCode OH_CameraInput_Open (Camera_Input * cameraInput)
Description
Opens a camera.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to the target Camera_Input instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_CONFLICT_CAMERA if the camera device is already started; returns CAMERA_DEVICE_DISABLED if the camera is disabled for security reasons; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraInput_RegisterCallback()
Camera_ErrorCode OH_CameraInput_RegisterCallback (Camera_Input * cameraInput, CameraInput_Callbacks * callback )
Description
Registers a callback to listen for camera input events.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to a Camera_Input instance. |
callback | Pointer to the target callback, which is defined in the CameraInput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraInput_Release()
Camera_ErrorCode OH_CameraInput_Release (Camera_Input * cameraInput)
Description
Releases a CameraInput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to the target Camera_Input instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraInput_UnregisterCallback()
Camera_ErrorCode OH_CameraInput_UnregisterCallback (Camera_Input * cameraInput, CameraInput_Callbacks * callback )
Description
Unregisters the callback used to listen for camera input events.
Since: 11
Parameters
Name | Description |
---|---|
cameraInput | Pointer to a Camera_Input instance. |
callback | Pointer to the target callback, which is defined in the CameraInput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_CreateCameraInput()
Camera_ErrorCode OH_CameraManager_CreateCameraInput (Camera_Manager * cameraManager, const Camera_Device * camera, Camera_Input ** cameraInput )
Description
Creates a CameraInput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
camera | Pointer to the target camera, which is defined in the Camera_Device struct. |
cameraInput | Double pointer to the Camera_Input instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
Required Permissions
ohos.permission.CAMERA
OH_CameraManager_CreateCameraInput_WithPositionAndType()
Camera_ErrorCode OH_CameraManager_CreateCameraInput_WithPositionAndType (Camera_Manager * cameraManager, Camera_Position position, Camera_Type type, Camera_Input ** cameraInput )
Description
Creates a CameraInput instance with the specified location and type.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
position | Camera position, which is defined in the Camera_Position struct. |
type | Camera type, which is defined in the Camera_Type struct. |
cameraInput | Double pointer to the Camera_Input instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
Required Permissions
ohos.permission.CAMERA
OH_CameraManager_CreateCaptureSession()
Camera_ErrorCode OH_CameraManager_CreateCaptureSession (Camera_Manager * cameraManager, Camera_CaptureSession ** captureSession )
Description
Creates a CaptureSession instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
captureSession | Double pointer to the Camera_CaptureSession instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraManager_CreateMetadataOutput()
Camera_ErrorCode OH_CameraManager_CreateMetadataOutput (Camera_Manager * cameraManager, const Camera_MetadataObjectType * profile, Camera_MetadataOutput ** metadataOutput )
Description
Creates a MetadataOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
profile | Pointer to the profile, which is defined in Camera_MetadataObjectType. |
metadataOutput | Double pointer to the Camera_MetadataOutput instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraManager_CreatePhotoOutput()
Camera_ErrorCode OH_CameraManager_CreatePhotoOutput (Camera_Manager * cameraManager, const Camera_Profile * profile, const char * surfaceId, Camera_PhotoOutput ** photoOutput )
Description
Creates a PhotoOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
profile | Pointer to the profile, which is defined in the Camera_Profile struct. |
surfaceId | Pointer to the surface ID. |
photoOutput | Double pointer to the Camera_PhotoOutput instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraManager_CreatePreviewOutput()
Camera_ErrorCode OH_CameraManager_CreatePreviewOutput (Camera_Manager * cameraManager, const Camera_Profile * profile, const char * surfaceId, Camera_PreviewOutput ** previewOutput )
Description
Creates a PreviewOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
profile | Pointer to the profile, which is defined in the Camera_Profile struct. |
surfaceId | Pointer to the surface ID. |
previewOutput | Double pointer to the Camera_PreviewOutput instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraManager_CreateVideoOutput()
Camera_ErrorCode OH_CameraManager_CreateVideoOutput (Camera_Manager * cameraManager, const Camera_VideoProfile * profile, const char * surfaceId, Camera_VideoOutput ** videoOutput )
Description
Creates a VideoOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
profile | Pointer to the profile, which is defined in the Camera_VideoProfile struct. |
surfaceId | Pointer to the surface ID. |
videoOutput | Double pointer to the Camera_VideoOutput instance if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CameraManager_DeleteSupportedCameraOutputCapability()
Camera_ErrorCode OH_CameraManager_DeleteSupportedCameraOutputCapability (Camera_Manager * cameraManager, Camera_OutputCapability * cameraOutputCapability )
Description
Deletes the output capability supported by a camera.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
cameraOutputCapability | Pointer to the output capability, which is defined in the Camera_OutputCapability struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_DeleteSupportedCameras()
Camera_ErrorCode OH_CameraManager_DeleteSupportedCameras (Camera_Manager * cameraManager, Camera_Device * cameras, uint32_t size )
Description
Deletes supported cameras.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
cameras | Pointer to the list of cameras, which is defined in the Camera_Device struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_GetSupportedCameraOutputCapability()
Camera_ErrorCode OH_CameraManager_GetSupportedCameraOutputCapability (Camera_Manager * cameraManager, const Camera_Device * camera, Camera_OutputCapability ** cameraOutputCapability )
Description
Obtains the output capability supported by a camera in the specified mode.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
cameras | Pointer to the list of cameras, which is defined in the Camera_Device struct. |
cameraOutputCapability | Double pointer to the Camera_OutputCapability struct if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_GetSupportedCameras()
Camera_ErrorCode OH_CameraManager_GetSupportedCameras (Camera_Manager * cameraManager, Camera_Device ** cameras, uint32_t * size )
Description
Obtains supported cameras.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
cameras | Double pointer to the list of cameras, which is defined in the Camera_Device struct, if the function is successfully called. |
size | Pointer to the size of the list of cameras. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_IsCameraMuted()
Camera_ErrorCode OH_CameraManager_IsCameraMuted (Camera_Manager * cameraManager, bool * isCameraMuted )
Description
Checks whether a camera is muted.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
isCameraMuted | Pointer to the result that specifies whether the camera is muted if the function is successfully called. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_RegisterCallback()
Camera_ErrorCode OH_CameraManager_RegisterCallback (Camera_Manager * cameraManager, CameraManager_Callbacks * callback )
Description
Registers a callback to listen for camera status changes.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
callback | Pointer to the target callback, which is defined in the CameraManager_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CameraManager_UnregisterCallback()
Camera_ErrorCode OH_CameraManager_UnregisterCallback (Camera_Manager * cameraManager, CameraManager_Callbacks * callback )
Description
Unregisters the callback used to listen for camera status changes.
Since: 11
Parameters
Name | Description |
---|---|
cameraManager | Pointer to a Camera_Manager instance. |
callback | Pointer to the target callback, which is defined in the CameraManager_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CaptureSession_AddInput()
Camera_ErrorCode OH_CaptureSession_AddInput (Camera_CaptureSession * session, Camera_Input * cameraInput )
Description
Adds a CameraInput instance to a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
cameraInput | Pointer to the target Camera_Input instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_AddMetadataOutput()
Camera_ErrorCode OH_CaptureSession_AddMetadataOutput (Camera_CaptureSession * session, Camera_MetadataOutput * metadataOutput )
Description
Adds a MetadataOutput instance to a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_AddPhotoOutput()
Camera_ErrorCode OH_CaptureSession_AddPhotoOutput (Camera_CaptureSession * session, Camera_PhotoOutput * photoOutput )
Description
Adds a PhotoOutput instance to a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_AddPreviewOutput()
Camera_ErrorCode OH_CaptureSession_AddPreviewOutput (Camera_CaptureSession * session, Camera_PreviewOutput * previewOutput )
Description
Adds a PreviewOutput instance to a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_AddVideoOutput()
Camera_ErrorCode OH_CaptureSession_AddVideoOutput (Camera_CaptureSession * session, Camera_VideoOutput * videoOutput )
Description
Adds a VideoOutput instance to a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
videoOutput | Pointer to the target Camera_VideoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_BeginConfig()
Camera_ErrorCode OH_CaptureSession_BeginConfig (Camera_CaptureSession * session)
Description
Starts the configuration for session capture.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_CONFIG_LOCKED if the session configuration is locked. For details, see Camera_ErrorCode.
OH_CaptureSession_CommitConfig()
Camera_ErrorCode OH_CaptureSession_CommitConfig (Camera_CaptureSession * session)
Description
Commits the configuration for session capture.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CaptureSession_GetExposureBias()
Camera_ErrorCode OH_CaptureSession_GetExposureBias (Camera_CaptureSession * session, float * exposureBias )
Description
Obtains the exposure compensation value in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureBias | Pointer to the exposure compensation value. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetExposureBiasRange()
Camera_ErrorCode OH_CaptureSession_GetExposureBiasRange (Camera_CaptureSession * session, float * minExposureBias, float * maxExposureBias, float * step )
Description
Obtains the exposure compensation values of the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
minExposureBias | Pointer to the minimum exposure compensation value. |
maxExposureBias | Pointer to the maximum exposure compensation value. |
step | Pointer to the exposure compensation step. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetExposureMode()
Camera_ErrorCode OH_CaptureSession_GetExposureMode (Camera_CaptureSession * session, Camera_ExposureMode * exposureMode )
Description
Obtains the exposure mode in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureMode | Pointer to the exposure mode, which is defined in the Camera_ExposureMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetFlashMode()
Camera_ErrorCode OH_CaptureSession_GetFlashMode (Camera_CaptureSession * session, Camera_FlashMode * flashMode )
Description
Obtains the flash mode in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
flashMode | Pointer to the flash mode, which is defined in the Camera_FlashMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetFocusMode()
Camera_ErrorCode OH_CaptureSession_GetFocusMode (Camera_CaptureSession * session, Camera_FocusMode * focusMode )
Description
Obtains the focus mode in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureBias | Pointer to the focus mode, which is defined in the Camera_FocusMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetFocusPoint()
Camera_ErrorCode OH_CaptureSession_GetFocusPoint (Camera_CaptureSession * session, Camera_Point * focusPoint )
Description
Obtains the focal point in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
focusPoint | Pointer to the focal point, which is defined in the Camera_Point struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetMeteringPoint()
Camera_ErrorCode OH_CaptureSession_GetMeteringPoint (Camera_CaptureSession * session, Camera_Point * point )
Description
Obtains the metering point in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
point | Pointer to the metering point, which is defined in the Camera_Point struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetVideoStabilizationMode()
Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode (Camera_CaptureSession * session, Camera_VideoStabilizationMode * mode )
Description
Obtains the video stabilization mode in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
mode | Pointer to the video stabilization mode, which is defined in the Camera_VideoStabilizationMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetZoomRatio()
Camera_ErrorCode OH_CaptureSession_GetZoomRatio (Camera_CaptureSession * session, float * zoom )
Description
Obtains the zoom ratio in use.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
zoom | Pointer to the zoom ratio. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_GetZoomRatioRange()
Camera_ErrorCode OH_CaptureSession_GetZoomRatioRange (Camera_CaptureSession * session, float * minZoom, float * maxZoom )
Description
Obtains the supported zoom ratio range.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
minZoom | Pointer to the minimum zoom ratio. |
maxZoom | Pointer to the maximum zoom ratio. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_HasFlash()
Camera_ErrorCode OH_CaptureSession_HasFlash (Camera_CaptureSession * session, bool * hasFlash )
Description
Checks whether the device has flash.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
hasFlash | Pointer to the result that specifies whether the device has flash. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_IsExposureModeSupported()
Camera_ErrorCode OH_CaptureSession_IsExposureModeSupported (Camera_CaptureSession * session, Camera_ExposureMode exposureMode, bool * isSupported )
Description
Checks whether an exposure mode is supported.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureMode | Target exposure mode, which is defined in the Camera_ExposureMode struct. |
isSupported | Pointer to the result that specifies whether the exposure mode is supported. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_IsFlashModeSupported()
Camera_ErrorCode OH_CaptureSession_IsFlashModeSupported (Camera_CaptureSession * session, Camera_FlashMode flashMode, bool * isSupported )
Description
Checks whether a flash mode is supported.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
flashMode | Target flash mode, which is defined in the Camera_FlashMode struct. |
isSupported | Pointer to the result that specifies whether the flash mode is supported. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_IsFocusModeSupported()
Camera_ErrorCode OH_CaptureSession_IsFocusModeSupported (Camera_CaptureSession * session, Camera_FocusMode focusMode, bool * isSupported )
Description
Checks whether a focus mode is supported.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
focusMode | Target focus mode, which is defined in the Camera_FocusMode struct. |
isSupported | Pointer to the result that specifies whether the focus mode is supported. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_IsVideoStabilizationModeSupported()
Camera_ErrorCode OH_CaptureSession_IsVideoStabilizationModeSupported (Camera_CaptureSession * session, Camera_VideoStabilizationMode mode, bool * isSupported )
Description
Checks whether a video stabilization mode is supported.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
mode | Target video stabilization mode, which is defined in the Camera_VideoStabilizationMode struct. |
isSupported | Pointer to the result that specifies whether the video stabilization mode is supported. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_RegisterCallback()
Camera_ErrorCode OH_CaptureSession_RegisterCallback (Camera_CaptureSession * session, CaptureSession_Callbacks * callback )
Description
Registers a callback to listen for session capture events.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
callback | Pointer to the target callback, which is defined in the CaptureSession_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_CaptureSession_Release()
Camera_ErrorCode OH_CaptureSession_Release (Camera_CaptureSession * session)
Description
Releases a CaptureSession instance.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CaptureSession_RemoveInput()
Camera_ErrorCode OH_CaptureSession_RemoveInput (Camera_CaptureSession * session, Camera_Input * cameraInput )
Description
Removes a CameraInput instance from a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
cameraInput | Pointer to the target Camera_Input instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_RemoveMetadataOutput()
Camera_ErrorCode OH_CaptureSession_RemoveMetadataOutput (Camera_CaptureSession * session, Camera_MetadataOutput * metadataOutput )
Description
Removes a MetadataOutput instance from a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_RemovePhotoOutput()
Camera_ErrorCode OH_CaptureSession_RemovePhotoOutput (Camera_CaptureSession * session, Camera_PhotoOutput * photoOutput )
Description
Removes a PhotoOutput instance from a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_RemovePreviewOutput()
Camera_ErrorCode OH_CaptureSession_RemovePreviewOutput (Camera_CaptureSession * session, Camera_PreviewOutput * previewOutput )
Description
Removes a PreviewOutput instance from a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_RemoveVideoOutput()
Camera_ErrorCode OH_CaptureSession_RemoveVideoOutput (Camera_CaptureSession * session, Camera_VideoOutput * videoOutput )
Description
Removes a VideoOutput instance from a session.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
videoOutput | Pointer to the target Camera_VideoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_OPERATION_NOT_ALLOWED if the operation is not allowed. For details, see Camera_ErrorCode.
OH_CaptureSession_SetExposureBias()
Camera_ErrorCode OH_CaptureSession_SetExposureBias (Camera_CaptureSession * session, float exposureBias )
Description
Sets an exposure compensation value for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureBias | Target exposure compensation value. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetExposureMode()
Camera_ErrorCode OH_CaptureSession_SetExposureMode (Camera_CaptureSession * session, Camera_ExposureMode exposureMode )
Description
Sets an Camera_VideoOutput for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
exposureMode | Target exposure mode, which is defined in the Camera_ExposureMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetFlashMode()
Camera_ErrorCode OH_CaptureSession_SetFlashMode (Camera_CaptureSession * session, Camera_FlashMode flashMode )
Description
Sets a flash mode for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
flashMode | Target flash mode, which is defined in the Camera_FlashMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetFocusMode()
Camera_ErrorCode OH_CaptureSession_SetFocusMode (Camera_CaptureSession * session, Camera_FocusMode focusMode )
Description
Sets a focus mode for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
focusMode | Target focus mode, which is defined in the Camera_FocusMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetFocusPoint()
Camera_ErrorCode OH_CaptureSession_SetFocusPoint (Camera_CaptureSession * session, Camera_Point focusPoint )
Description
Sets a focal point for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
focusPoint | Target focal point, which is defined in the Camera_Point struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetMeteringPoint()
Camera_ErrorCode OH_CaptureSession_SetMeteringPoint (Camera_CaptureSession * session, Camera_Point point )
Description
Sets the metering point, which is the center point of the metering rectangle.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
point | Target metering point, which is defined in the Camera_Point struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetVideoStabilizationMode()
Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode (Camera_CaptureSession * session, Camera_VideoStabilizationMode mode )
Description
Sets a video stabilization mode for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
mode | Target video stabilization mode, which is defined in the Camera_VideoStabilizationMode struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_SetZoomRatio()
Camera_ErrorCode OH_CaptureSession_SetZoomRatio (Camera_CaptureSession * session, float zoom )
Description
Sets a zoom ratio for the device.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
zoom | Target zoom ratio. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured. For details, see Camera_ErrorCode.
OH_CaptureSession_Start()
Camera_ErrorCode OH_CaptureSession_Start (Camera_CaptureSession * session)
Description
Starts session capture.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CaptureSession_Stop()
Camera_ErrorCode OH_CaptureSession_Stop (Camera_CaptureSession * session)
Description
Stops session capture.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_CaptureSession_UnregisterCallback()
Camera_ErrorCode OH_CaptureSession_UnregisterCallback (Camera_CaptureSession * session, CaptureSession_Callbacks * callback )
Description
Unregisters the callback used to listen for session capture events.
Since: 11
Parameters
Name | Description |
---|---|
session | Pointer to the target Camera_CaptureSession instance. |
callback | Pointer to the target callback, which is defined in the CaptureSession_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_MetadataOutput_RegisterCallback()
Camera_ErrorCode OH_MetadataOutput_RegisterCallback (Camera_MetadataOutput * metadataOutput, MetadataOutput_Callbacks * callback )
Description
Registers a callback to listen for metadata output events.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
callback | Pointer to the target callback, which is defined in the MetadataOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_MetadataOutput_Release()
Camera_ErrorCode OH_MetadataOutput_Release (Camera_MetadataOutput * metadataOutput)
Description
Releases a MetadataOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_MetadataOutput_Start()
Camera_ErrorCode OH_MetadataOutput_Start (Camera_MetadataOutput * metadataOutput)
Description
Starts metadata output.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_MetadataOutput_Stop()
Camera_ErrorCode OH_MetadataOutput_Stop (Camera_MetadataOutput * metadataOutput)
Description
Stops metadata output.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_MetadataOutput_UnregisterCallback()
Camera_ErrorCode OH_MetadataOutput_UnregisterCallback (Camera_MetadataOutput * metadataOutput, MetadataOutput_Callbacks * callback )
Description
Unregisters the callback used to listen for metadata output events.
Since: 11
Parameters
Name | Description |
---|---|
metadataOutput | Pointer to the target Camera_MetadataOutput instance. |
callback | Pointer to the target callback, which is defined in the MetadataOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_PhotoOutput_Capture()
Camera_ErrorCode OH_PhotoOutput_Capture (Camera_PhotoOutput * photoOutput)
Description
Captures a photo.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PhotoOutput_Capture_WithCaptureSetting()
Camera_ErrorCode OH_PhotoOutput_Capture_WithCaptureSetting (Camera_PhotoOutput * photoOutput, Camera_PhotoCaptureSetting setting )
Description
Captures a photo with the photographing parameters.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
setting | Photographing parameters, which are defined in the Camera_PhotoCaptureSetting struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PhotoOutput_IsMirrorSupported()
Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported (Camera_PhotoOutput * photoOutput, bool * isSupported )
Description
Checks whether mirroring is supported.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the Camera_PhotoOutput instance, which is used to check whether mirroring is supported. |
isSupported | Pointer to the result that specifies whether mirroring is supported. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PhotoOutput_RegisterCallback()
Camera_ErrorCode OH_PhotoOutput_RegisterCallback (Camera_PhotoOutput * photoOutput, PhotoOutput_Callbacks * callback )
Description
Registers a callback to listen for photo output events.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
callback | Pointer to the target callback, which is defined in the PhotoOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_PhotoOutput_Release()
Camera_ErrorCode OH_PhotoOutput_Release (Camera_PhotoOutput * photoOutput)
Description
Releases a PhotoOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PhotoOutput_UnregisterCallback()
Camera_ErrorCode OH_PhotoOutput_UnregisterCallback (Camera_PhotoOutput * photoOutput, PhotoOutput_Callbacks * callback )
Description
Unregisters the callback used to listen for photo output events.
Since: 11
Parameters
Name | Description |
---|---|
photoOutput | Pointer to the target Camera_PhotoOutput instance. |
callback | Pointer to the target callback, which is defined in the PhotoOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_PreviewOutput_RegisterCallback()
Camera_ErrorCode OH_PreviewOutput_RegisterCallback (Camera_PreviewOutput * previewOutput, PreviewOutput_Callbacks * callback )
Description
Registers a callback to listen for preview output events.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
callback | Pointer to the target callback, which is defined in the PreviewOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_PreviewOutput_Release()
Camera_ErrorCode OH_PreviewOutput_Release (Camera_PreviewOutput * previewOutput)
Description
Releases a PreviewOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PreviewOutput_Start()
Camera_ErrorCode OH_PreviewOutput_Start (Camera_PreviewOutput * previewOutput)
Description
Starts preview output.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PreviewOutput_Stop()
Camera_ErrorCode OH_PreviewOutput_Stop (Camera_PreviewOutput * previewOutput)
Description
Stops preview output.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_PreviewOutput_UnregisterCallback()
Camera_ErrorCode OH_PreviewOutput_UnregisterCallback (Camera_PreviewOutput * previewOutput, PreviewOutput_Callbacks * callback )
Description
Unregisters the callback used to listen for preview output events.
Since: 11
Parameters
Name | Description |
---|---|
previewOutput | Pointer to the target Camera_PreviewOutput instance. |
callback | Pointer to the target callback, which is defined in the PreviewOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_VideoOutput_RegisterCallback()
Camera_ErrorCode OH_VideoOutput_RegisterCallback (Camera_VideoOutput * videoOutput, VideoOutput_Callbacks * callback )
Description
Registers a callback to listen for video output events.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to a Camera_VideoOutput instance. |
callback | Pointer to the target callback, which is defined in the VideoOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.
OH_VideoOutput_Release()
Camera_ErrorCode OH_VideoOutput_Release (Camera_VideoOutput * videoOutput)
Description
Releases a VideoOutput instance.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the target Camera_VideoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_VideoOutput_Start()
Camera_ErrorCode OH_VideoOutput_Start (Camera_VideoOutput * videoOutput)
Description
Starts video output.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the target Camera_VideoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SESSION_NOT_CONFIG if the session is not configured; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_VideoOutput_Stop()
Camera_ErrorCode OH_VideoOutput_Stop (Camera_VideoOutput * videoOutput)
Description
Stops video output.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to the target Camera_VideoOutput instance. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect; returns CAMERA_SERVICE_FATAL_ERROR if a fatal error occurs in the camera service. For details, see Camera_ErrorCode.
OH_VideoOutput_UnregisterCallback()
Camera_ErrorCode OH_VideoOutput_UnregisterCallback (Camera_VideoOutput * videoOutput, VideoOutput_Callbacks * callback )
Description
Unregisters the callback used to listen for video output events.
Since: 11
Parameters
Name | Description |
---|---|
videoOutput | Pointer to a Camera_VideoOutput instance. |
callback | Pointer to the target callback, which is defined in the VideoOutput_Callbacks struct. |
Returns
Returns CAMERA_OK if the function is successfully called; returns INVALID_ARGUMENT if a parameter is missing or the parameter type is incorrect. For details, see Camera_ErrorCode.