Tizen Native API
5.0
|
The Camera API provides functions for camera preview, capture, and focusing.
#include <camera.h>
The Camera API allows application developers to support using the camera. It includes functions that capture photos and support setting up notifications for state changes of capturing, previewing, focusing, information about resolution and binary data format, and functions for artistic picture manipulations like sepia, negative, sketch, and many more.
The Camera API allows creation of components required in taking pictures including:
The Camera API also notifies you (by callback mechanism) when a significant picture parameter changes e.g. focus.
FUNCTION | PRE-STATE | POST-STATE | SYNC TYPE |
---|---|---|---|
camera_create() | NONE | CREATED | SYNC |
camera_destroy() | CREATED | NONE | SYNC |
camera_start_preview() | CREATED/CAPTURED | PREVIEW | SYNC |
camera_stop_preview() | PREVIEW | CREATED | SYNC |
camera_start_capture() | PREVIEW | CAPTURING -> CAPTURED* | SYNC |
(*) The transition from the CAPTURING state to the CAPTURED state will be processed automatically.
The callback mechanism is used to notify the application about significant camera events.
REGISTER | UNREGISTER | CALLBACK | DESCRIPTION |
---|---|---|---|
camera_set_preview_cb() | camera_unset_preview_cb() | camera_preview_cb() | This callback is used to display the preview (it delivers copies of previous frames) |
camera_set_state_changed_cb() | camera_unset_state_changed_cb() | camera_state_changed_cb() | This callback is used to notify that the camera state has changed. Not executed in the recorder mode |
camera_set_focus_changed_cb() | camera_unset_focus_changed_cb() | camera_focus_changed_cb() | This callback is used to notify that the camera has changed focus (and it is ready to shoot) |
camera_set_error_cb() | camera_unset_error_cb() | camera_error_cb() | This callback is used to notify that an error has occurred |
FOREACH | CALLBACK | DESCRIPTION |
---|---|---|
camera_foreach_supported_preview_resolution() | camera_supported_preview_resolution_cb() | Supported preview resolutions |
camera_foreach_supported_capture_resolution() | camera_supported_capture_resolution_cb() | Supported camera capture resolutions |
camera_foreach_supported_capture_format() | camera_supported_capture_format_cb() | Supported camera capture formats |
camera_foreach_supported_preview_format() | camera_supported_preview_format_cb() | Supported camera preview format |
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | camera_create (camera_device_e device, camera_h *camera) |
Creates a new camera handle for controlling a camera. | |
int | camera_change_device (camera_h camera, camera_device_e device) |
Changes the camera device. | |
int | camera_destroy (camera_h camera) |
Destroys the camera handle and releases all its resources. | |
int | camera_start_preview (camera_h camera) |
Starts capturing and drawing preview frames on the screen. | |
int | camera_stop_preview (camera_h camera) |
Stops capturing and drawing preview frames. | |
int | camera_start_capture (camera_h camera, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data) |
Starts capturing of still images. | |
int | camera_start_continuous_capture (camera_h camera, int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data) |
Starts continuously capturing still images. | |
int | camera_stop_continuous_capture (camera_h camera) |
Aborts continuous capturing. | |
int | camera_get_state (camera_h camera, camera_state_e *state) |
Gets the state of the camera. | |
int | camera_start_focusing (camera_h camera, bool continuous) |
Starts camera auto-focusing, asynchronously. | |
int | camera_cancel_focusing (camera_h camera) |
Stops camera auto focusing. | |
int | camera_set_display (camera_h camera, camera_display_type_e type, camera_display_h display) |
Sets the display handle to show preview images. | |
int | camera_set_preview_resolution (camera_h camera, int width, int height) |
Sets the resolution of the preview. | |
int | camera_get_preview_resolution (camera_h camera, int *width, int *height) |
Gets the resolution of the preview. | |
int | camera_get_recommended_preview_resolution (camera_h camera, int *width, int *height) |
Gets the recommended preview resolution. | |
int | camera_start_face_detection (camera_h camera, camera_face_detected_cb callback, void *user_data) |
Starts face detection. | |
int | camera_stop_face_detection (camera_h camera) |
Stops face detection. | |
int | camera_set_display_reuse_hint (camera_h camera, bool hint) |
Sets the hint for display reuse. | |
int | camera_get_display_reuse_hint (camera_h camera, bool *hint) |
Gets the hint for display reuse. | |
int | camera_set_capture_resolution (camera_h camera, int width, int height) |
Sets the resolution of the captured image. | |
int | camera_get_capture_resolution (camera_h camera, int *width, int *height) |
Gets the resolution of the captured image. | |
int | camera_set_capture_format (camera_h camera, camera_pixel_format_e format) |
Sets the format of an image to be captured. | |
int | camera_get_capture_format (camera_h camera, camera_pixel_format_e *format) |
Gets the format of the image to be captured. | |
int | camera_set_preview_format (camera_h camera, camera_pixel_format_e format) |
Sets the preview data format. | |
int | camera_get_preview_format (camera_h camera, camera_pixel_format_e *format) |
Gets the format of the preview stream. | |
int | camera_get_facing_direction (camera_h camera, camera_facing_direction_e *facing_direction) |
Gets the facing direction of camera module. | |
int | camera_get_flash_state (camera_device_e device, camera_flash_state_e *state) |
Gets the camera's flash state. | |
int | camera_set_preview_cb (camera_h camera, camera_preview_cb callback, void *user_data) |
Registers a callback function to be called once per frame when previewing. | |
int | camera_unset_preview_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_set_media_packet_preview_cb (camera_h camera, camera_media_packet_preview_cb callback, void *user_data) |
Registers a media packet callback function to be called once per frame when previewing. | |
int | camera_unset_media_packet_preview_cb (camera_h camera) |
Unregisters the media packet callback function. | |
int | camera_set_state_changed_cb (camera_h camera, camera_state_changed_cb callback, void *user_data) |
Registers a callback function to be called when the camera state changes. | |
int | camera_unset_state_changed_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_set_interrupted_cb (camera_h camera, camera_interrupted_cb callback, void *user_data) |
Registers a callback function to be called when the camera is interrupted by policy. | |
int | camera_unset_interrupted_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_set_interrupt_started_cb (camera_h camera, camera_interrupt_started_cb callback, void *user_data) |
Registers a callback function to be called when the camera interrupt is started by policy. | |
int | camera_unset_interrupt_started_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_set_focus_changed_cb (camera_h camera, camera_focus_changed_cb callback, void *user_data) |
Registers a callback function to be called when the auto-focus state changes. | |
int | camera_unset_focus_changed_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_set_error_cb (camera_h camera, camera_error_cb callback, void *user_data) |
Registers a callback function to be called when an asynchronous operation error occurs. | |
int | camera_unset_error_cb (camera_h camera) |
Unregisters the callback function. | |
int | camera_get_device_state (camera_device_e device, camera_device_state_e *state) |
Gets the state of camera device. | |
int | camera_add_device_state_changed_cb (camera_device_state_changed_cb callback, void *user_data, int *cb_id) |
Registers a callback function to be called when the camera device state changes. | |
int | camera_remove_device_state_changed_cb (int cb_id) |
Unregisters the callback function. | |
Typedefs | |
typedef struct camera_cli_s * | camera_h |
The Camera handle. | |
typedef void * | camera_display_h |
The Camera display handle. | |
typedef void(* | camera_state_changed_cb )(camera_state_e previous, camera_state_e current, bool by_policy, void *user_data) |
Called when the camera state is changed. | |
typedef void(* | camera_device_state_changed_cb )(camera_device_e device, camera_device_state_e state, void *user_data) |
Called when the camera device state is changed. | |
typedef void(* | camera_interrupted_cb )(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *user_data) |
Called when the camera is interrupted by policy. | |
typedef void(* | camera_interrupt_started_cb )(camera_policy_e policy, camera_state_e state, void *user_data) |
Called when the camera interrupt is started by policy. | |
typedef void(* | camera_focus_changed_cb )(camera_focus_state_e state, void *user_data) |
Called when the camera focus state is changed. | |
typedef void(* | camera_preview_cb )(camera_preview_data_s *frame, void *user_data) |
Called to register for notifications about delivering a copy of the new preview frame when every preview frame is displayed. | |
typedef void(* | camera_media_packet_preview_cb )(media_packet_h pkt, void *user_data) |
Called to register for notifications about delivering media packet when every preview frame is displayed. | |
typedef void(* | camera_capturing_cb )(camera_image_data_s *image, camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data) |
Called to get information about image data taken by the camera once per frame while capturing. | |
typedef void(* | camera_capture_completed_cb )(void *user_data) |
Called when the camera capturing completes. | |
typedef void(* | camera_error_cb )(camera_error_e error, camera_state_e current_state, void *user_data) |
Called when an error occurs. | |
typedef void(* | camera_face_detected_cb )(camera_detected_face_s *faces, int count, void *user_data) |
Called when a face is detected in the preview frame. | |
Defines | |
#define | GET_DISPLAY(x) (void*)(x) |
Gets a display handle. |
#define GET_DISPLAY | ( | x | ) | (void*)(x) |
Gets a display handle.
typedef void(* camera_capture_completed_cb)(void *user_data) |
Called when the camera capturing completes.
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_capturing_cb)(camera_image_data_s *image, camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data) |
Called to get information about image data taken by the camera once per frame while capturing.
[in] | image | The image data of the captured picture |
[in] | postview | The image data of the postview |
[in] | thumbnail | The image data of the thumbnail (it should be NULL if the available thumbnail data does not exist) |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_device_state_changed_cb)(camera_device_e device, camera_device_state_e state, void *user_data) |
Called when the camera device state is changed.
[in] | device | The hardware camera type |
[in] | state | The state of the camera device |
[in] | user_data | The user data passed from the callback registration function |
typedef void* camera_display_h |
The Camera display handle.
typedef void(* camera_error_cb)(camera_error_e error, camera_state_e current_state, void *user_data) |
Called when an error occurs.
[in] | error | The error code |
[in] | current_state | The current state of the camera |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_face_detected_cb)(camera_detected_face_s *faces, int count, void *user_data) |
Called when a face is detected in the preview frame.
[in] | faces | The detected face array |
[in] | count | The length of the array |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_focus_changed_cb)(camera_focus_state_e state, void *user_data) |
Called when the camera focus state is changed.
When the camera auto focus completes or a change to the focus state occurs, this callback is invoked.
Changes of focus state are as follows:
CAMERA_FOCUS_STATE_RELEASED -> start focusing -> CAMERA_FOCUS_STATE_ONGOING -> working -> CAMERA_FOCUS_STATE_FOCUSED or CAMERA_FOCUS_STATE_FAILED.
[in] | state | The current state of the auto-focus |
[in] | user_data | The user data passed from the callback registration function |
typedef struct camera_cli_s* camera_h |
typedef void(* camera_interrupt_started_cb)(camera_policy_e policy, camera_state_e state, void *user_data) |
Called when the camera interrupt is started by policy.
[in] | policy | The policy that is interrupting the camera |
[in] | state | The current state of the camera |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_interrupted_cb)(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *user_data) |
Called when the camera is interrupted by policy.
[in] | policy | The policy that interrupted the camera |
[in] | previous | The previous state of the camera |
[in] | current | The current state of the camera |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_media_packet_preview_cb)(media_packet_h pkt, void *user_data) |
Called to register for notifications about delivering media packet when every preview frame is displayed.
[in] | pkt | Reference pointer to media packet |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_preview_cb)(camera_preview_data_s *frame, void *user_data) |
Called to register for notifications about delivering a copy of the new preview frame when every preview frame is displayed.
[in] | frame | The reference pointer to preview stream data |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* camera_state_changed_cb)(camera_state_e previous, camera_state_e current, bool by_policy, void *user_data) |
Called when the camera state is changed.
[in] | previous | The previous state of the camera |
[in] | current | The current state of the camera |
[in] | by_policy | If true the state is changed by policy, otherwise false |
[in] | user_data | The user data passed from the callback registration function |
enum camera_device_e |
Enumeration for the camera device.
enum camera_error_e |
Enumeration for the error codes of Camera.
enum camera_flash_state_e |
enum camera_flip_e |
enum camera_focus_state_e |
Enumeration for the camera pixel format.
enum camera_policy_e |
enum camera_rotation_e |
enum camera_state_e |
int camera_add_device_state_changed_cb | ( | camera_device_state_changed_cb | callback, |
void * | user_data, | ||
int * | cb_id | ||
) |
Registers a callback function to be called when the camera device state changes.
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
[out] | cb_id | The id of registered callback |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_OUT_OF_MEMORY | Out of memory |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_cancel_focusing | ( | camera_h | camera | ) |
Stops camera auto focusing.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_change_device | ( | camera_h | camera, |
camera_device_e | device | ||
) |
Changes the camera device.
[in] | camera | The handle to the camera |
[in] | device | The hardware camera to access |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_OUT_OF_MEMORY | Out of memory |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_create | ( | camera_device_e | device, |
camera_h * | camera | ||
) |
Creates a new camera handle for controlling a camera.
[in] | device | The hardware camera to access |
[out] | camera | A newly returned handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_OUT_OF_MEMORY | Out of memory |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_destroy | ( | camera_h | camera | ) |
Destroys the camera handle and releases all its resources.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_get_capture_format | ( | camera_h | camera, |
camera_pixel_format_e * | format | ||
) |
Gets the format of the image to be captured.
[in] | camera | The handle to the camera |
[out] | format | The format of the image to be captured |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_capture_resolution | ( | camera_h | camera, |
int * | width, | ||
int * | height | ||
) |
Gets the resolution of the captured image.
[in] | camera | The handle to the camera |
[out] | width | The capture width |
[out] | height | The capture height |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_device_state | ( | camera_device_e | device, |
camera_device_state_e * | state | ||
) |
Gets the state of camera device.
[in] | device | The hardware camera type |
[out] | state | The current state of the device |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_get_display_reuse_hint | ( | camera_h | camera, |
bool * | hint | ||
) |
Gets the hint for display reuse.
[in] | camera | The handle to the camera |
[out] | hint | The hint for display reuse; true - reuse the display, false - do not reuse |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_OPERATION | Internal error |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_facing_direction | ( | camera_h | camera, |
camera_facing_direction_e * | facing_direction | ||
) |
Gets the facing direction of camera module.
[in] | camera | The handle to the camera |
[out] | facing_direction | The facing direction of camera module |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_OPERATION | Internal error |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_flash_state | ( | camera_device_e | device, |
camera_flash_state_e * | state | ||
) |
Gets the camera's flash state.
[in] | device | The hardware camera to access |
[out] | state | The current flash state |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_OPERATION | Internal error |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_get_preview_format | ( | camera_h | camera, |
camera_pixel_format_e * | format | ||
) |
Gets the format of the preview stream.
[in] | camera | The handle to the camera |
[out] | format | The preview data format |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_preview_resolution | ( | camera_h | camera, |
int * | width, | ||
int * | height | ||
) |
Gets the resolution of the preview.
[in] | camera | The handle to the camera |
[out] | width | The preview width |
[out] | height | The preview height |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_recommended_preview_resolution | ( | camera_h | camera, |
int * | width, | ||
int * | height | ||
) |
Gets the recommended preview resolution.
[in] | camera | The handle to the camera |
[out] | width | The preview width |
[out] | height | The preview height |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_get_state | ( | camera_h | camera, |
camera_state_e * | state | ||
) |
Gets the state of the camera.
[in] | camera | The handle to the camera |
[out] | state | The current state of the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_remove_device_state_changed_cb | ( | int | cb_id | ) |
Unregisters the callback function.
[in] | cb_id | The id of registered callback |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
int camera_set_capture_format | ( | camera_h | camera, |
camera_pixel_format_e | format | ||
) |
Sets the format of an image to be captured.
[in] | camera | The handle to the camera |
[out] | format | The format of the image to be captured |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_capture_resolution | ( | camera_h | camera, |
int | width, | ||
int | height | ||
) |
Sets the resolution of the captured image.
[in] | camera | The handle to the camera |
[in] | width | The capture width |
[in] | height | The capture height |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_display | ( | camera_h | camera, |
camera_display_type_e | type, | ||
camera_display_h | display | ||
) |
Sets the display handle to show preview images.
[in] | camera | The handle to the camera |
[in] | type | The display type |
[in] | display | The display handle from GET_DISPLAY |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_display_reuse_hint | ( | camera_h | camera, |
bool | hint | ||
) |
Sets the hint for display reuse.
If the hint is set to true, the display will be reused when the camera device is changed with camera_change_device().
[in] | camera | The handle to the camera |
[in] | hint | The hint for display reuse; true - reuse the display, false - do not reuse |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Internal error |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_error_cb | ( | camera_h | camera, |
camera_error_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called when an asynchronous operation error occurs.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_focus_changed_cb | ( | camera_h | camera, |
camera_focus_changed_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called when the auto-focus state changes.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_interrupt_started_cb | ( | camera_h | camera, |
camera_interrupt_started_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called when the camera interrupt is started by policy.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
int camera_set_interrupted_cb | ( | camera_h | camera, |
camera_interrupted_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called when the camera is interrupted by policy.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_media_packet_preview_cb | ( | camera_h | camera, |
camera_media_packet_preview_cb | callback, | ||
void * | user_data | ||
) |
Registers a media packet callback function to be called once per frame when previewing.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to be registered |
[in] | user_data | The user data to be passed to the callback function |
CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_preview_cb | ( | camera_h | camera, |
camera_preview_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called once per frame when previewing.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to be registered |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_preview_format | ( | camera_h | camera, |
camera_pixel_format_e | format | ||
) |
Sets the preview data format.
[in] | camera | The handle to the camera |
[in] | format | The preview data format |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_preview_resolution | ( | camera_h | camera, |
int | width, | ||
int | height | ||
) |
Sets the resolution of the preview.
[in] | camera | The handle to the camera |
[in] | width | The preview width |
[in] | height | The preview height |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_set_state_changed_cb | ( | camera_h | camera, |
camera_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be called when the camera state changes.
[in] | camera | The handle to the camera |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_start_capture | ( | camera_h | camera, |
camera_capturing_cb | capturing_cb, | ||
camera_capture_completed_cb | completed_cb, | ||
void * | user_data | ||
) |
Starts capturing of still images.
[in] | camera | The handle to the camera |
[in] | capturing_cb | The callback for capturing data |
[in] | completed_cb | The callback for notification of completion |
[in] | user_data | The user data |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_start_continuous_capture | ( | camera_h | camera, |
int | count, | ||
int | interval, | ||
camera_capturing_cb | capturing_cb, | ||
camera_capture_completed_cb | completed_cb, | ||
void * | user_data | ||
) |
Starts continuously capturing still images.
[in] | camera | The handle to the camera |
[in] | count | The number of still images |
[in] | interval | The interval of the capture (millisecond) |
[in] | capturing_cb | The callback for capturing data |
[in] | completed_cb | The callback for notification of completion |
[in] | user_data | The user data |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_start_face_detection | ( | camera_h | camera, |
camera_face_detected_cb | callback, | ||
void * | user_data | ||
) |
Starts face detection.
[in] | camera | The handle to the camera |
[in] | callback | The callback to notify face detection |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Not preview state |
CAMERA_ERROR_INVALID_OPERATION | Not supported this feature |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_start_focusing | ( | camera_h | camera, |
bool | continuous | ||
) |
Starts camera auto-focusing, asynchronously.
true
, the camera continuously tries to focus. [in] | camera | The handle to the camera |
[in] | continuous | The status of continuous focusing |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_start_preview | ( | camera_h | camera | ) |
Starts capturing and drawing preview frames on the screen.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_RESOURCE_CONFLICT | Resource conflict error |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_DEVICE_BUSY | The device is being used in another application or is performing other operations |
CAMERA_ERROR_DEVICE_NOT_FOUND | No camera device |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_stop_continuous_capture | ( | camera_h | camera | ) |
Aborts continuous capturing.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_stop_face_detection | ( | camera_h | camera | ) |
Stops face detection.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_stop_preview | ( | camera_h | camera | ) |
Stops capturing and drawing preview frames.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_INVALID_STATE | Invalid state |
CAMERA_ERROR_INVALID_OPERATION | Invalid operation |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_error_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_focus_changed_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_interrupt_started_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
int camera_unset_interrupted_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_media_packet_preview_cb | ( | camera_h | camera | ) |
Unregisters the media packet callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_preview_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |
int camera_unset_state_changed_cb | ( | camera_h | camera | ) |
Unregisters the callback function.
[in] | camera | The handle to the camera |
0
on success, otherwise a negative error value CAMERA_ERROR_NONE | Successful |
CAMERA_ERROR_INVALID_PARAMETER | Invalid parameter |
CAMERA_ERROR_PERMISSION_DENIED | The access to the resources can not be granted |
CAMERA_ERROR_NOT_SUPPORTED | The feature is not supported |
CAMERA_ERROR_SERVICE_DISCONNECTED | The socket to multimedia server is disconnected |