Tizen HAL API  1.0
Camera

The Camera provides functions for camera devices.

Required Header

#include <hal-camera.h>

Overview

The camera devices have various specifications, so it's hard to control them using single code. The camera HAL provides common abstraction interfaces to control camera devices which are different.

The Camera HAL allows creation of components required in taking pictures including:

State Diagram

hal_camera_state_diagram.png

State Transitions

FUNCTION PRE-STATE POST-STATE SYNC TYPE
hal_camera_init() N/A INITIALIZED SYNC
hal_camera_deinit() INITIALIZED N/A SYNC
hal_camera_open_device() INITIALIZED OPENED SYNC
hal_camera_close_device() OPENED INITIALIZED SYNC
hal_camera_start_preview() OPENED PREVIEWING SYNC
hal_camera_stop_preview() PREVIEWING OPENED SYNC
hal_camera_start_capture() PREVIEWING CAPTURING SYNC
hal_camera_stop_capture() CAPTURING PREVIEWING SYNC
hal_camera_start_record() PREVIEWING RECORDING SYNC
hal_camera_stop_record() RECORDING PREVIEWING SYNC
hal_camera_start_capture() RECORDING RECORDING_SNAPSHOT SYNC
hal_camera_stop_capture() RECORDING_SNAPSHOT RECORDING SYNC

For more information on the Camera features and the macros, see HAL Camera programming guides and tutorials.

Typedefs

typedef enum camera_error camera_error_e
 Enumeration for the camera error.
typedef enum camera_state camera_state_e
 Enumeration for the camera state.
typedef enum camera_network_state camera_network_state_e
 Enumeration for the camera network state.
typedef struct camera_resolution camera_resolution_s
 The structure type of the resolution.
typedef struct camera_fraction camera_fraction_s
 The structure type of the fraction.
typedef struct camera_rectangle camera_rectangle_s
 The structure type of the rectangle.
typedef enum camera_pixel_format camera_pixel_format_e
 Enumeration for the camera pixel format.
typedef enum camera_focus_state camera_focus_state_e
 Enumeration for the focus state.
typedef enum
camera_facing_direction 
camera_facing_direction_e
 Enumeration for the facing direction of camera device.
typedef enum camera_rotation camera_rotation_e
 Enumeration for the camera rotation.
typedef enum
camera_status_auto_exposure 
camera_status_auto_exposure_e
 Enumeration for the auto exposure status.
typedef enum
camera_status_auto_white_balance 
camera_status_auto_white_balance_e
 Enumeration for the auto white balance status.
typedef enum camera_flip camera_flip_e
 Enumeration for the camera flip.
typedef struct camera_plane camera_plane_s
 The structure type of the camera plane.
typedef struct camera_buffer camera_buffer_s
 The structure type of the camera buffer.
typedef struct camera_metadata camera_metadata_s
 The structure type of the camera metadata.
typedef struct camera_format camera_format_s
 The structure type of the camera format.
typedef enum camera_focus_mode camera_focus_mode_e
 Enumeration for the focus mode.
typedef enum camera_focus_range camera_focus_range_e
 Enumeration for the focus range.
typedef enum camera_white_balance camera_white_balance_e
 Enumeration for the white balance.
typedef enum camera_effect camera_effect_e
 Enumeration for the effect.
typedef enum camera_scene_mode camera_scene_mode_e
 Enumeration for the scene mode.
typedef enum camera_exposure_mode camera_exposure_mode_e
 Enumeration for the exposure mode.
typedef enum camera_shot_mode camera_shot_mode_e
 Enumeration for the shot mode.
typedef enum camera_flash_mode camera_flash_mode_e
 Enumeration for the flash mode.
typedef enum camera_face_detection camera_face_detection_e
 Enumeration for the face detection.
typedef enum camera_ptz_type camera_ptz_type_e
 Enumeration for the PTZ(Pan Tilt Zoom) type.
typedef enum camera_command camera_command_e
 Enumeration for the camera command.
typedef struct
camera_batch_command_control 
camera_batch_command_control_s
 The structure type of batch command.
typedef struct
camera_pixel_format_list 
camera_format_list_s
 The structure type of the format list.
typedef struct
camera_resolution_list 
camera_resolution_list_s
 The structure type of the resolution list.
typedef struct camera_fps_list camera_fps_list_s
 The structure type of the fps list.
typedef struct camera_device_info camera_device_info_s
 The structure type of the camera device information.
typedef struct
camera_device_info_list 
camera_device_info_list_s
 The structure type of the camera device information list.
typedef struct
camera_device_capability_resolution 
camera_device_capability_resolution_s
 The structure type of the camera device capability resolution.
typedef struct
camera_device_capability_format 
camera_device_capability_format_s
 The structure type of the camera device capability format.
typedef struct
camera_device_capability 
camera_device_capability_s
 The structure type of the camera device capability.
typedef struct
camera_device_capability_list 
camera_device_capability_list_s
 The structure type of the camera device capability list.
typedef enum camera_message_type camera_message_type_e
 Enumeration for the camera message type.
typedef struct camera_message camera_message_s
 The structure type of the camera message.
typedef int(* hal_camera_message_cb )(camera_message_s *message, void *user_data)
 Callback function for notification from camera HAL.
typedef int(* hal_camera_preview_frame_cb )(camera_buffer_s *buffer, camera_metadata_s *meta, void *user_data)
 Callback function for captured preview frame from camera device.
typedef int(* hal_camera_extra_preview_frame_cb )(camera_buffer_s *buffer, camera_metadata_s *meta, int stream_id, void *user_data)
 Callback function for extra preview frame from camera device.
typedef int(* hal_camera_video_frame_cb )(camera_buffer_s *buffer, camera_metadata_s *meta, void *user_data)
 Callback function for captured video buffer from camera device.
typedef int(* hal_camera_capture_cb )(camera_buffer_s *main, camera_buffer_s *postview, camera_buffer_s *thumbnail, void *user_data)
 Callback function for captured still image from camera device.
typedef struct
_hal_backend_media_camera_funcs 
hal_backend_camera_funcs
 The structure type of the camera HAL functions.

Defines

#define BUFFER_PLANE_MAX   4
 The maximum number of planes in buffer.
#define DEVICE_COUNT_MAX   16
 The maximum number of device count.
#define RESOLUTION_COUNT_MAX   32
 The maximum number of resolution count.
#define FPS_COUNT_MAX   16
 The maximum number of FPS count.
#define DEVICE_NAME_LENGTH_MAX   16
 The maximum length of device name.
#define DEVICE_NODE_PATH_LENGTH_MAX   16
 The maximum length of device node path.

Data Structure Documentation

struct camera_resolution

The structure type of the resolution.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t width
uint32_t height

Field Documentation

The height of resolution

The width of resolution

struct camera_fraction

The structure type of the fraction.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

int numerator
int denominator

Field Documentation

The denominator of fraction

The numerator of fraction

struct camera_rectangle

The structure type of the rectangle.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

int x
int y
uint32_t width
uint32_t height

Field Documentation

The height of rectangle

The width of rectangle

The x coordinate of rectangle

The y coordinate of rectangle

struct camera_plane

The structure type of the camera plane.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

unsigned char * data
uint32_t align_width
uint32_t align_height
uint32_t size
uint32_t bytesused

Field Documentation

The aligned height of plane

The aligned width of plane

The number of bytes occupied by data

unsigned char* camera_plane::data

The data pointer of plane

The size of plane

struct camera_buffer

The structure type of the camera buffer.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

int index
camera_pixel_format_e format
camera_resolution_s resolution
uint32_t total_size
uint32_t num_planes
camera_plane_s planes [4]
uint32_t num_bos
void * bos [4]

Field Documentation

The bo(buffer object for TBM) array

The index of buffer

The number of bo(buffer object for TBM)

The number of planes in buffer

The planes of buffer

The total size of buffer

struct camera_metadata

The structure type of the camera metadata.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

int is_flashed
camera_fraction_s focal_length
camera_fraction_s aperture_f_number
camera_fraction_s shutter_speed
camera_fraction_s exposure_time
camera_fraction_s brightness
camera_resolution_s exif_image
int iso
int metering_mode
int color_space
int component_configuration
int aperture_in_apex
int is_delta_frame
camera_focus_state_e focus_state
camera_facing_direction_e facing_direction
camera_flip_e flip
camera_rotation_e rotation
camera_status_auto_exposure_e status_ae
camera_status_auto_white_balance_e status_awb

Field Documentation

The APEX for aperture

The color space

The component configuration

The resolution of EXIF image

The flag which indicates whether it's delta frame or not

The flag which indicates whether it's flashed or not

The ISO

The metering mode

struct camera_format

The structure type of the camera format.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

camera_pixel_format_e stream_format
camera_resolution_s stream_resolution
uint32_t stream_fps
camera_rotation_e stream_rotation
camera_pixel_format_e capture_format
camera_resolution_s capture_resolution
uint32_t capture_quality
uint32_t stream_bitrate

Field Documentation

The quality of captured image

The resolution of capture stream

The bitrate of stream

The FPS of stream

struct camera_batch_command_control

The structure type of batch command.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint64_t command_set_flag
camera_white_balance_e white_balance
int iso
int contrast
int saturation
int hue
int sharpness
camera_effect_e effect
camera_scene_mode_e scene_mode
camera_exposure_mode_e exposure_mode
int exposure
camera_rotation_e rotation
camera_flip_e flip
camera_focus_mode_e focus_mode
camera_focus_range_e focus_range
camera_exposure_mode_e shot_mode
int anti_shake
camera_rectangle_s focus_area
int digital_zoom
int optical_zoom
int recording_hint
int wdr
camera_fraction_s shutter_speed
camera_flash_mode_e flash_mode
camera_face_detection_e face_detection
int bitrate
int ptz_type
int pan
int tilt
int brightness
int gop_interval
int capture_count
int capture_interval
int flash_brightness
int focus_level

Field Documentation

value for anti shake

value for brightness

value for capture count of continuous capture

value for capture interval of continuous capture

flag for updating commands

value for digital zoom

value for brightness of flash

value for level of manual focus

value for GOP(Group Of Pictures) interval

value for optical zoom

value for PTZ(Pan Tilt Zoom) type

value for recording hint

value for saturation

value for sharpness

value for WDR(Wide Dynamic Range)

struct camera_pixel_format_list

The structure type of the format list.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t count
camera_pixel_format_e formats [CAMERA_PIXEL_FORMAT_MAX]

Field Documentation

The count of format

The format list

struct camera_resolution_list

The structure type of the resolution list.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t count
camera_resolution_s resolutions [32]

Field Documentation

The count of resolution

struct camera_fps_list

The structure type of the fps list.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t count
int fps [16]

Field Documentation

The count of FPS

The FPS list

struct camera_device_info

The structure type of the camera device information.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t index
char name [16]
char node_path [16]
camera_facing_direction_e facing_direction
camera_format_list_s format_list
camera_resolution_list_s preview_list
camera_resolution_list_s capture_list
camera_resolution_list_s video_list
camera_fps_list_s preview_fps_list [32]
camera_fps_list_s video_fps_list [32]

Field Documentation

The supported capture resolution list of device

The supported format list of device

The index of device

The name of device

The node path of device

The supported preview FPS list of device

The supported preview resolution list of device

The supported video FPS list of device

The supported video resolution list of device

struct camera_device_info_list

The structure type of the camera device information list.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

uint32_t count
camera_device_info_s device_info [16]

Field Documentation

The count of devices

struct camera_device_capability_resolution

The structure type of the camera device capability resolution.

Since:
HAL_MODULE_CAMERA 1.1

Data Fields

uint32_t width
uint32_t height
int default_fps_index
camera_fps_list_s fps_list

Field Documentation

The default index of FPS list

The supported FPS list with width and height

The height of resolution

The width of resolution

struct camera_device_capability_format

The structure type of the camera device capability format.

Since:
HAL_MODULE_CAMERA 1.1

Data Fields

camera_pixel_format_e pixel_format
uint32_t resolution_count
int default_resolution_index
camera_device_capability_resolution_sresolution [32]

Field Documentation

The default index of capability resolution list

The supported capability resolution list with pixel_format

The supported capability resolution count

struct camera_device_capability

The structure type of the camera device capability.

Since:
HAL_MODULE_CAMERA 1.1

Data Fields

int device_index
uint32_t format_count
int default_format_index
camera_device_capability_format_sformat [CAMERA_PIXEL_FORMAT_MAX]

Field Documentation

The default index of supported format list

The index of device

The supported capability format list with device_index

The count of supported format

struct camera_device_capability_list

The structure type of the camera device capability list.

Since:
HAL_MODULE_CAMERA 1.1

Data Fields

uint32_t device_count
camera_device_capability_scapability [16]

Field Documentation

The count of devices

struct camera_message

The structure type of the camera message.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

camera_message_type_e type
camera_focus_state_e focus_state
uint32_t hdr_progress
camera_error_e error_code
camera_network_state_e network_state

Field Documentation

The progress of HDR

struct _hal_backend_media_camera_funcs

The structure type of the camera HAL functions.

Since:
HAL_MODULE_CAMERA 1.0

Data Fields

int(* init )(void **camera_handle)
int(* deinit )(void *camera_handle)
int(* get_device_info_list )(camera_device_info_list_s *device_info_list)
int(* open_device )(void *camera_handle, int device_index)
int(* open_device_ext )(void *camera_handle, const char *device_name)
int(* close_device )(void *camera_handle)
int(* add_message_callback )(void *camera_handle, hal_camera_message_cb callback, void *user_data, uint32_t *cb_id)
int(* remove_message_callback )(void *camera_handle, uint32_t cb_id)
int(* set_preview_stream_format )(void *camera_handle, camera_format_s *format)
int(* get_preview_stream_format )(void *camera_handle, camera_format_s *format)
int(* set_user_buffer_fd )(void *camera_handle, int *fds, int number)
int(* start_preview )(void *camera_handle, hal_camera_preview_frame_cb callback, void *user_data)
int(* release_preview_buffer )(void *camera_handle, int buffer_index)
int(* stop_preview )(void *camera_handle)
int(* start_auto_focus )(void *camera_handle)
int(* stop_auto_focus )(void *camera_handle)
int(* start_capture )(void *camera_handle, hal_camera_capture_cb callback, void *user_data)
int(* stop_capture )(void *camera_handle)
int(* set_video_stream_format )(void *camera_handle, camera_format_s *format)
int(* get_video_stream_format )(void *camera_handle, camera_format_s *format)
int(* start_record )(void *camera_handle, hal_camera_video_frame_cb callback, void *user_data)
int(* release_video_buffer )(void *camera_handle, int buffer_index)
int(* stop_record )(void *camera_handle)
int(* set_command )(void *camera_handle, camera_command_e command, void *value)
int(* get_command )(void *camera_handle, camera_command_e command, void **value)
int(* set_batch_command )(void *camera_handle, camera_batch_command_control_s *batch_command, uint64_t *error_command)
int(* set_extra_preview_frame_cb )(void *camera_handle, hal_camera_extra_preview_frame_cb callback, void *user_data)
int(* unset_extra_preview_frame_cb )(void *camera_handle)
int(* release_extra_preview_buffer )(void *camera_handle, int stream_id, int buffer_index)
int(* set_extra_preview_stream_format )(void *camera_handle, int stream_id, camera_format_s *format)
int(* get_extra_preview_stream_format )(void *camera_handle, int stream_id, camera_format_s *format)
int(* set_extra_preview_bitrate )(void *camera_handle, int stream_id, int bitrate)
int(* get_extra_preview_bitrate )(void *camera_handle, int stream_id, int *bitrate)
int(* set_extra_preview_gop_interval )(void *camera_handle, int stream_id, int interval)
int(* get_extra_preview_gop_interval )(void *camera_handle, int stream_id, int *interval)

Field Documentation

int(* _hal_backend_media_camera_funcs::add_message_callback)(void *camera_handle, hal_camera_message_cb callback, void *user_data, uint32_t *cb_id)

Remove message callback

int(* _hal_backend_media_camera_funcs::close_device)(void *camera_handle)

Add message callback

int(* _hal_backend_media_camera_funcs::deinit)(void *camera_handle)

Get list of device information

int(* _hal_backend_media_camera_funcs::get_command)(void *camera_handle, camera_command_e command, void **value)

Set batch command for multiple settings

int(* _hal_backend_media_camera_funcs::get_extra_preview_bitrate)(void *camera_handle, int stream_id, int *bitrate)

Set GOP(Group Of Pictures) interval for extra preview stream

int(* _hal_backend_media_camera_funcs::get_extra_preview_gop_interval)(void *camera_handle, int stream_id, int *interval)

Get list of device capability (

Since:
HAL_MODULE_CAMERA 1.1)
int(* _hal_backend_media_camera_funcs::get_extra_preview_stream_format)(void *camera_handle, int stream_id, camera_format_s *format)

Set bitrate for extra preview stream

Set buffer fd which is allocated by user

Start record

int(* _hal_backend_media_camera_funcs::init)(void **camera_handle)

< Initialize HAL backend handle Deinitialize HAL backend handle

int(* _hal_backend_media_camera_funcs::open_device)(void *camera_handle, int device_index)

Open device for extension

int(* _hal_backend_media_camera_funcs::open_device_ext)(void *camera_handle, const char *device_name)

Close device

int(* _hal_backend_media_camera_funcs::release_extra_preview_buffer)(void *camera_handle, int stream_id, int buffer_index)

Set format for extra preview stream

int(* _hal_backend_media_camera_funcs::release_preview_buffer)(void *camera_handle, int buffer_index)

Stop preview

int(* _hal_backend_media_camera_funcs::release_video_buffer)(void *camera_handle, int buffer_index)

Stop record

int(* _hal_backend_media_camera_funcs::remove_message_callback)(void *camera_handle, uint32_t cb_id)

Set format for preview stream

int(* _hal_backend_media_camera_funcs::set_batch_command)(void *camera_handle, camera_batch_command_control_s *batch_command, uint64_t *error_command)

Set preview callback for extra stream

int(* _hal_backend_media_camera_funcs::set_command)(void *camera_handle, camera_command_e command, void *value)

Get command for various settings

int(* _hal_backend_media_camera_funcs::set_extra_preview_bitrate)(void *camera_handle, int stream_id, int bitrate)

Get bitrate for extra preview stream

Unset preview callback for extra stream

int(* _hal_backend_media_camera_funcs::set_extra_preview_gop_interval)(void *camera_handle, int stream_id, int interval)

Get GOP(Group Of Pictures) interval for extra preview stream

int(* _hal_backend_media_camera_funcs::set_extra_preview_stream_format)(void *camera_handle, int stream_id, camera_format_s *format)

Get format for extra preview stream

Get format for preview stream

int(* _hal_backend_media_camera_funcs::set_user_buffer_fd)(void *camera_handle, int *fds, int number)

Start preview

Get format for video stream

Stop auto focusing

int(* _hal_backend_media_camera_funcs::start_capture)(void *camera_handle, hal_camera_capture_cb callback, void *user_data)

Stop capture

int(* _hal_backend_media_camera_funcs::start_preview)(void *camera_handle, hal_camera_preview_frame_cb callback, void *user_data)

Release preview buffer

int(* _hal_backend_media_camera_funcs::start_record)(void *camera_handle, hal_camera_video_frame_cb callback, void *user_data)

Release video buffer

Start capture

int(* _hal_backend_media_camera_funcs::stop_capture)(void *camera_handle)

Set format for video stream

int(* _hal_backend_media_camera_funcs::stop_preview)(void *camera_handle)

Start auto focusing

int(* _hal_backend_media_camera_funcs::stop_record)(void *camera_handle)

Set command for various settings

Release preview buffer for extra stream


Define Documentation

#define BUFFER_PLANE_MAX   4

The maximum number of planes in buffer.

Since:
HAL_MODULE_CAMERA 1.0
#define DEVICE_COUNT_MAX   16

The maximum number of device count.

Since:
HAL_MODULE_CAMERA 1.0
#define DEVICE_NAME_LENGTH_MAX   16

The maximum length of device name.

Since:
HAL_MODULE_CAMERA 1.0
#define DEVICE_NODE_PATH_LENGTH_MAX   16

The maximum length of device node path.

Since:
HAL_MODULE_CAMERA 1.0
#define FPS_COUNT_MAX   16

The maximum number of FPS count.

Since:
HAL_MODULE_CAMERA 1.0
#define RESOLUTION_COUNT_MAX   32

The maximum number of resolution count.

Since:
HAL_MODULE_CAMERA 1.0

Typedef Documentation

The structure type of batch command.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera buffer.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera command.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera device capability format.

Since:
HAL_MODULE_CAMERA 1.1

The structure type of the camera device capability list.

Since:
HAL_MODULE_CAMERA 1.1

The structure type of the camera device capability resolution.

Since:
HAL_MODULE_CAMERA 1.1

The structure type of the camera device capability.

Since:
HAL_MODULE_CAMERA 1.1

The structure type of the camera device information list.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera device information.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the effect.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera error.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the exposure mode.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the face detection.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the facing direction of camera device.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the flash mode.

Since:
HAL_MODULE_CAMERA 1.0
typedef enum camera_flip camera_flip_e

Enumeration for the camera flip.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the focus mode.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the focus range.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the focus state.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the format list.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera format.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the fps list.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the fraction.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera message.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera message type.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera metadata.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera network state.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera pixel format.

Since:
HAL_MODULE_CAMERA 1.0
typedef struct camera_plane camera_plane_s

The structure type of the camera plane.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the PTZ(Pan Tilt Zoom) type.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the rectangle.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the resolution list.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the resolution.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera rotation.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the scene mode.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the shot mode.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the camera state.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the auto exposure status.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the auto white balance status.

Since:
HAL_MODULE_CAMERA 1.0

Enumeration for the white balance.

Since:
HAL_MODULE_CAMERA 1.0

The structure type of the camera HAL functions.

Since:
HAL_MODULE_CAMERA 1.0
typedef int(* hal_camera_capture_cb)(camera_buffer_s *main, camera_buffer_s *postview, camera_buffer_s *thumbnail, void *user_data)

Callback function for captured still image from camera device.

Since:
HAL_MODULE_CAMERA 1.0
Parameters:
[in]mainThe main image data
[in]postviewThe image data of the postview (it could be NULL if the available data does not exist)
[in]thumbnailThe image data of the thumbnail (it could be NULL if the available data does not exist)
[in]user_dataThe user data passed from the callback registration function
Precondition:
hal_camera_start_capture() will invoke this callback function.
See also:
hal_camera_start_capture()
hal_camera_stop_capture()
typedef int(* hal_camera_extra_preview_frame_cb)(camera_buffer_s *buffer, camera_metadata_s *meta, int stream_id, void *user_data)

Callback function for extra preview frame from camera device.

Since:
HAL_MODULE_CAMERA 1.0
Parameters:
[in]bufferThe extra preview frame
[in]metaThe meta data for the extra preview frame
[in]stream_idThe id of extra preview stream
[in]user_dataThe user data for callback
Precondition:
hal_camera_start_preview() will invoke this callback.
See also:
hal_camera_start_preview()
hal_camera_stop_preview()
typedef int(* hal_camera_message_cb)(camera_message_s *message, void *user_data)

Callback function for notification from camera HAL.

Since:
HAL_MODULE_CAMERA 1.0
Parameters:
[in]messageThe message from camera HAL
[in]user_dataThe user data for callback
See also:
hal_camera_add_message_callback()
hal_camera_remove_message_callback()
typedef int(* hal_camera_preview_frame_cb)(camera_buffer_s *buffer, camera_metadata_s *meta, void *user_data)

Callback function for captured preview frame from camera device.

Since:
HAL_MODULE_CAMERA 1.0
Parameters:
[in]bufferThe preview frame
[in]metaThe meta data for the preview frame
[in]user_dataThe user data for callback
Precondition:
hal_camera_start_preview() will invoke this callback.
See also:
hal_camera_start_preview()
hal_camera_stop_preview()
typedef int(* hal_camera_video_frame_cb)(camera_buffer_s *buffer, camera_metadata_s *meta, void *user_data)

Callback function for captured video buffer from camera device.

Since:
HAL_MODULE_CAMERA 1.0
Parameters:
[in]bufferThe video buffer
[in]metaThe meta data for the video frame
[in]user_dataThe user data for callback
Precondition:
hal_camera_start_record() will invoke this callback.
See also:
hal_camera_start_record()
hal_camera_stop_record()

Enumeration Type Documentation

Enumeration for the camera command.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_COMMAND_BASE 

Base of command

CAMERA_COMMAND_WHITE_BALANCE 

White balance

CAMERA_COMMAND_ISO 

ISO

CAMERA_COMMAND_CONTRAST 

Contrast

CAMERA_COMMAND_SATURATION 

Saturation

CAMERA_COMMAND_HUE 

Hue

CAMERA_COMMAND_SHARPNESS 

Sharpness

CAMERA_COMMAND_EFFECT 

Effect

CAMERA_COMMAND_SCENE_MODE 

Scene mode

CAMERA_COMMAND_EXPOSURE_MODE 

Exposure mode

CAMERA_COMMAND_EXPOSURE 

Exposure

CAMERA_COMMAND_ROTATION 

Rotation

CAMERA_COMMAND_FLIP 

Flip

CAMERA_COMMAND_FOCUS_MODE 

Focus mode

CAMERA_COMMAND_FOCUS_RANGE 

Focus range

CAMERA_COMMAND_SHOT_MODE 

Shot mode

CAMERA_COMMAND_ANTI_SHAKE 

Anti shake

CAMERA_COMMAND_FOCUS_AREA 

Focus area

CAMERA_COMMAND_DIGITAL_ZOOM 

Digital zoom

CAMERA_COMMAND_OPTICAL_ZOOM 

Optical zoom

CAMERA_COMMAND_RECORDING_HINT 

Recording hint

CAMERA_COMMAND_WDR 

Wide dynamic range

CAMERA_COMMAND_SHUTTER_SPEED 

Shutter speed

CAMERA_COMMAND_FLASH_MODE 

Flash mode

CAMERA_COMMAND_FACE_DETECTION 

Face detection

CAMERA_COMMAND_BITRATE 

Bitrate

CAMERA_COMMAND_PTZ_TYPE 

PTZ(Pan Tilt Zoom) type

CAMERA_COMMAND_PAN 

Pan

CAMERA_COMMAND_TILT 

Tilt

CAMERA_COMMAND_BRIGHTNESS 

Brightness

CAMERA_COMMAND_GOP_INTERVAL 

GOP(Group Of Pictures) interval

CAMERA_COMMAND_CAPTURE_COUNT 

Capture count

CAMERA_COMMAND_CAPTURE_INTERVAL 

Capture interval for continuous capture

CAMERA_COMMAND_FLASH_BRIGHTNESS 

Brightness of flash

CAMERA_COMMAND_FOCUS_LEVEL 

Level of manual focus

CAMERA_COMMAND_DEVICE_BUS 

Device bus name

CAMERA_COMMAND_DEVICE_PORT 

Device port name

CAMERA_COMMAND_WHITE_BALANCE_TEMPERATURE 

White balance temperature

CAMERA_COMMAND_GAIN 

Gain

CAMERA_COMMAND_SWITCH_DEVICE 

Switch device (Since 1.2)

Enumeration for the effect.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_EFFECT_NONE 

None

CAMERA_EFFECT_MONO 

Mono

CAMERA_EFFECT_SEPIA 

Sepia

CAMERA_EFFECT_NEGATIVE 

Negative

CAMERA_EFFECT_RED 

Red

CAMERA_EFFECT_GREEN 

Green

CAMERA_EFFECT_BLUE 

Blue

CAMERA_EFFECT_AQUA 

Aqua

CAMERA_EFFECT_ANTIQUE 

Antique

CAMERA_EFFECT_WARM 

Warm

CAMERA_EFFECT_EMBOSS 

Emboss

CAMERA_EFFECT_SKETCH 

Sketch

CAMERA_EFFECT_SOLARIZATION 

Solarization

CAMERA_EFFECT_POSTERIZATION 

Posterization

CAMERA_EFFECT_CARTOON 

Cartoon

Enumeration for the camera error.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_ERROR_NONE 

Error none

CAMERA_ERROR_INVALID_PARAMETER 

Invalid parameter

CAMERA_ERROR_INVALID_STATE 

Invalid state

CAMERA_ERROR_PERMISSION_DENIED 

Permission denied

CAMERA_ERROR_OUT_OF_MEMORY 

Out of memory

CAMERA_ERROR_DEVICE_OPEN 

Device open

CAMERA_ERROR_DEVICE_NOT_FOUND 

Device not found

CAMERA_ERROR_DEVICE_UNAVAILABLE 

Device unavailable

CAMERA_ERROR_DEVICE_NOT_SUPPORTED 

Device not supported

CAMERA_ERROR_DEVICE_READ 

Device read

CAMERA_ERROR_DEVICE_WRITE 

Device write

CAMERA_ERROR_DEVICE_BUSY 

Device busy

CAMERA_ERROR_DEVICE_TIME_OUT 

Device time out

CAMERA_ERROR_DEVICE_ESD 

Device ESD(Electro Static Discharge)

CAMERA_ERROR_INTERNAL 

Internal

CAMERA_ERROR_NOT_IMPLEMENTED 

Not implemented

CAMERA_ERROR_UNKNOWN 

Unknown

Enumeration for the exposure mode.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_EXPOSURE_MODE_OFF 

Off

CAMERA_EXPOSURE_MODE_ALL 

All mode

CAMERA_EXPOSURE_MODE_CENTER 

Center mode

CAMERA_EXPOSURE_MODE_SPOT 

Spot mode

CAMERA_EXPOSURE_MODE_CUSTOM 

Custom mode

CAMERA_EXPOSURE_MODE_SHUTTER_PRIORITY 

Shutter priority mode

CAMERA_EXPOSURE_MODE_APERTURE_PRIORITY 

Aperture priority mode

Enumeration for the face detection.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FACE_DETECTION_OFF 

Face detection off

CAMERA_FACE_DETECTION_ON 

Face detection on

Enumeration for the facing direction of camera device.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FACING_DIRECTION_REAR 

Rear facing direction

CAMERA_FACING_DIRECTION_FRONT 

Front facing direction

CAMERA_FACING_DIRECTION_EXTERNAL 

External

Enumeration for the flash mode.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FLASH_MODE_OFF 

Always off

CAMERA_FLASH_MODE_ON 

Always splashes

CAMERA_FLASH_MODE_AUTO 

Depending on intensity of light, strobe starts to flash

CAMERA_FLASH_MODE_REDEYE_REDUCTION 

Red eye reduction. Multiple flash before capturing

CAMERA_FLASH_MODE_SLOW_SYNC 

Slow sync curtain synchronization

CAMERA_FLASH_MODE_FRONT_CURTAIN 

Front curtain synchronization

CAMERA_FLASH_MODE_REAR_CURTAIN 

Rear curtain synchronization

CAMERA_FLASH_MODE_PERMANENT 

Keep turned on until turning off

Enumeration for the camera flip.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FLIP_NONE 

None

CAMERA_FLIP_HORIZONTAL 

Horizontal flip

CAMERA_FLIP_VERTICAL 

Vertical flip

CAMERA_FLIP_BOTH 

Both

Enumeration for the focus mode.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FOCUS_MODE_NONE 

None

CAMERA_FOCUS_MODE_PAN 

Pan mode

CAMERA_FOCUS_MODE_AUTO 

Auto mode

CAMERA_FOCUS_MODE_CONTINUOUS_AUTO 

Continuous auto mode

Enumeration for the focus range.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FOCUS_RANGE_NONE 

None

CAMERA_FOCUS_RANGE_NORMAL 

Normal range

CAMERA_FOCUS_RANGE_MACRO 

Macro range

CAMERA_FOCUS_RANGE_FULL 

Full range

Enumeration for the focus state.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_FOCUS_STATE_RELEASED 

Released state for auto focus

CAMERA_FOCUS_STATE_ONGOING 

Ongoing state for auto focus

CAMERA_FOCUS_STATE_FOCUSED 

Focused state for auto focus

CAMERA_FOCUS_STATE_FAILED 

Failed state for auto focus

Enumeration for the camera message type.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_MESSAGE_TYPE_FOCUS_CHANGED 

The focus state changed

CAMERA_MESSAGE_TYPE_CAPTURED 

The snapshot captured

CAMERA_MESSAGE_TYPE_HDR_PROGRESS 

The progress of HDR

CAMERA_MESSAGE_TYPE_ERROR 

The error

CAMERA_MESSAGE_TYPE_NETWORK_STATE 

The state of network camera

Enumeration for the camera network state.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_NETWORK_STATE_PLAYING 

Playing state for network camera

CAMERA_NETWORK_STATE_PAUSED 

Paused state for network camera

Enumeration for the camera pixel format.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_PIXEL_FORMAT_NV12 

Raw - NV12

CAMERA_PIXEL_FORMAT_NV21 

Raw - NV21

CAMERA_PIXEL_FORMAT_I420 

Raw - I420

CAMERA_PIXEL_FORMAT_YV12 

Raw - YV12

CAMERA_PIXEL_FORMAT_YUYV 

Raw - YUYV

CAMERA_PIXEL_FORMAT_UYVY 

Raw - UYVY

CAMERA_PIXEL_FORMAT_BGRA8888 

Raw - BGRA8888

CAMERA_PIXEL_FORMAT_ARGB8888 

Raw - ARGB8888

CAMERA_PIXEL_FORMAT_JPEG 

Encoded - JPEG

CAMERA_PIXEL_FORMAT_H264 

Encoded - H.264

CAMERA_PIXEL_FORMAT_MJPEG 

Encoded - MJPEG

CAMERA_PIXEL_FORMAT_VP8 

Encoded - VP8

CAMERA_PIXEL_FORMAT_VP9 

Encoded - VP9

CAMERA_PIXEL_FORMAT_DEPTH 

Depth

Enumeration for the PTZ(Pan Tilt Zoom) type.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_PTZ_TYPE_MECHANICAL 

Move the camera device physically

CAMERA_PTZ_TYPE_ELECTRONIC 

Zoom digitally and move into portion of the image

Enumeration for the camera rotation.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_ROTATION_0 

0 degree

CAMERA_ROTATION_90 

90 degree

CAMERA_ROTATION_180 

180 degree

CAMERA_ROTATION_270 

270 degree

Enumeration for the scene mode.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_SCENE_MODE_NORMAL 

Normal

CAMERA_SCENE_MODE_PORTRAIT 

Portrait

CAMERA_SCENE_MODE_LANDSCAPE 

Landscape

CAMERA_SCENE_MODE_SPORTS 

Sports

CAMERA_SCENE_MODE_PARTY_N_INDOOR 

Party & indoor

CAMERA_SCENE_MODE_BEACH_N_INDOOR 

Beach & indoor

CAMERA_SCENE_MODE_SUNSET 

Sunset

CAMERA_SCENE_MODE_DUSK_N_DAWN 

Dusk & dawn

CAMERA_SCENE_MODE_FALL_COLOR 

Fall

CAMERA_SCENE_MODE_NIGHT_SCENE 

Night scene

CAMERA_SCENE_MODE_FIREWORK 

Firework

CAMERA_SCENE_MODE_TEXT 

Text

CAMERA_SCENE_MODE_SHOW_WINDOW 

Show window

CAMERA_SCENE_MODE_CANDLE_LIGHT 

Candle light

CAMERA_SCENE_MODE_BACKLIGHT 

Backlight

CAMERA_SCENE_MODE_AQUA 

Aqua

Enumeration for the shot mode.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_SHOT_MODE_NORMAL 

Normal

CAMERA_SHOT_MODE_CONTINUOUS 

Continuous

CAMERA_SHOT_MODE_HDR 

HDR

CAMERA_SHOT_MODE_NIGHT 

Night

Enumeration for the camera state.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_STATE_INITIALIZED 

Initialized state for camera device

CAMERA_STATE_OPENED 

Opened state for camera device

CAMERA_STATE_PREVIEWING 

Previewing state for camera device

CAMERA_STATE_CAPTURING 

Capturing state for camera device

CAMERA_STATE_RECORDING 

Recording state for camera device

CAMERA_STATE_RECORDING_SNAPSHOT 

Capturing state while recording for camera device

Enumeration for the auto exposure status.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_STATUS_AUTO_EXPOSURE_NONE 

None

CAMERA_STATUS_AUTO_EXPOSURE_UNSTABLE 

Unstable status for auto exposure

CAMERA_STATUS_AUTO_EXPOSURE_STABLE 

Stable status for auto exposure

Enumeration for the auto white balance status.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_STATUS_AUTO_WHITE_BALANCE_NONE 

None

CAMERA_STATUS_AUTO_WHITE_BALANCE_UNSTABLE 

Unstable status for auto white balance

CAMERA_STATUS_AUTO_WHITE_BALANCE_STABLE 

Stable status for auto white balance

Enumeration for the white balance.

Since:
HAL_MODULE_CAMERA 1.0
Enumerator:
CAMERA_WHITE_BALANCE_AUTO 

Automatic

CAMERA_WHITE_BALANCE_DAYLIGHT 

Daylight

CAMERA_WHITE_BALANCE_CLOUDY 

Cloudy

CAMERA_WHITE_BALANCE_FLUORESCENT 

Fluorescent

CAMERA_WHITE_BALANCE_INCANDESCENT 

Incandescent

CAMERA_WHITE_BALANCE_SHADE 

Shade

CAMERA_WHITE_BALANCE_HORIZON 

Horizon

CAMERA_WHITE_BALANCE_FLASH 

Flash