summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2018-07-26 11:11:19 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2018-07-26 11:11:19 +0900
commit57dd37427f0ce7b2fcc62530a8c06e3f9e689cee (patch)
tree7b798f9d7392a0fdc6ad58127c68cd25ad2d148e
parent994bad1b9cbd974ed8efb0dad18ed3a45c4184bf (diff)
parentac1b407783d9d954d4bf51b041d1a52489b2605b (diff)
downloadcamera-57dd37427f0ce7b2fcc62530a8c06e3f9e689cee.tar.gz
camera-57dd37427f0ce7b2fcc62530a8c06e3f9e689cee.tar.bz2
camera-57dd37427f0ce7b2fcc62530a8c06e3f9e689cee.zip
Merge branch 'tizen' into tizen_line_coverage
Change-Id: I073f09876144c1404ce1e8f5906a9b1bc0bdf81e Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--include/camera.h17
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c60
3 files changed, 25 insertions, 54 deletions
diff --git a/include/camera.h b/include/camera.h
index e795032..21e6610 100644
--- a/include/camera.h
+++ b/include/camera.h
@@ -48,12 +48,9 @@ typedef enum {
CAMERA_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
CAMERA_ERROR_DEVICE = CAMERA_ERROR_CLASS | 0x04, /**< Device error */
CAMERA_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Internal error */
- CAMERA_ERROR_SOUND_POLICY = CAMERA_ERROR_CLASS | 0x06, /**< Blocked by Audio Session Manager (Deprecated since 3.0) */
CAMERA_ERROR_SECURITY_RESTRICTED = CAMERA_ERROR_CLASS | 0x07, /**< Restricted by security system policy */
CAMERA_ERROR_DEVICE_BUSY = CAMERA_ERROR_CLASS | 0x08, /**< The device is using another application or working on some operation */
CAMERA_ERROR_DEVICE_NOT_FOUND = CAMERA_ERROR_CLASS | 0x09, /**< No camera device */
- CAMERA_ERROR_SOUND_POLICY_BY_CALL = CAMERA_ERROR_CLASS | 0x0a, /**< Blocked by Audio Session Manager - CALL (Deprecated since 3.0) */
- CAMERA_ERROR_SOUND_POLICY_BY_ALARM = CAMERA_ERROR_CLASS | 0x0b, /**< Blocked by Audio Session Manager - ALARM (Deprecated since 3.0) */
CAMERA_ERROR_ESD = CAMERA_ERROR_CLASS | 0x0c, /**< ESD situation */
CAMERA_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< The access to the resources can not be granted*/
CAMERA_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< The feature is not supported */
@@ -139,10 +136,7 @@ typedef enum {
*/
typedef enum {
CAMERA_POLICY_NONE = 0, /**< None */
- CAMERA_POLICY_SOUND, /**< Sound policy (Deprecated since 3.0) */
- CAMERA_POLICY_SOUND_BY_CALL, /**< Sound policy by CALL (Deprecated since 3.0) */
- CAMERA_POLICY_SOUND_BY_ALARM, /**< Sound policy by ALARM (Deprecated since 3.0) */
- CAMERA_POLICY_SECURITY, /**< Security policy */
+ CAMERA_POLICY_SECURITY = 4, /**< Security policy */
CAMERA_POLICY_RESOURCE_CONFLICT /**< Resource conflict (Since 3.0) */
} camera_policy_e;
@@ -771,7 +765,6 @@ typedef bool (*camera_supported_preview_format_cb)(camera_pixel_format_e format,
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #CAMERA_ERROR_SOUND_POLICY Sound policy error
* @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
* @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
* @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
@@ -833,7 +826,6 @@ int camera_destroy(camera_h camera);
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CAMERA_ERROR_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_SOUND_POLICY Sound policy error
* @retval #CAMERA_ERROR_RESOURCE_CONFLICT Resource conflict error
* @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
* @retval #CAMERA_ERROR_DEVICE_BUSY The device is being used in another application or is performing other operations
@@ -1057,6 +1049,11 @@ int camera_cancel_focusing(camera_h camera);
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks This function must be called before previewing (see camera_start_preview()).
* In Custom ROI display mode, camera_attr_set_display_roi_area() function must be called before calling this function.
+ * @remarks This function must be called in main thread of the application.
+ * Otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION by internal restriction.
+ * To avoid #CAMERA_ERROR_INVALID_OPERATION in sub thread, ecore_thread_main_loop_begin() and
+ * ecore_thread_main_loop_end() can be used, but deadlock can occur if the main thread is busy.
+ * So, it's not recommended to use them. (Since 5.0)
* @param[in] camera The handle to the camera
* @param[in] type The display type
* @param[in] display The display handle from #GET_DISPLAY
@@ -1072,6 +1069,8 @@ int camera_cancel_focusing(camera_h camera);
*
* @see camera_start_preview()
* @see #GET_DISPLAY
+ * @see ecore_thread_main_loop_begin()
+ * @see ecore_thread_main_loop_end()
*/
int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display);
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index c519c31..69ec2c5 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,6 +1,6 @@
Name: capi-media-camera
Summary: A Camera API
-Version: 0.4.6
+Version: 0.4.9
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index 1fb69a9..1c3ffac 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -537,17 +537,9 @@ static int _camera_client_wait_for_cb_return(muse_camera_api_e api, camera_cb_in
g_mutex_unlock(&(cb_info->api_mutex[api]));
- if (ret != CAMERA_ERROR_NONE) {
+ if (ret != CAMERA_ERROR_NONE)
LOGE("api %d : error 0x%x", api, ret);
- if (ret == CAMERA_ERROR_SOUND_POLICY)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY is deprecated and will be removed from next release.");
- else if (ret == CAMERA_ERROR_SOUND_POLICY_BY_CALL)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY_BY_CALL is deprecated and will be removed from next release.");
- else if (ret == CAMERA_ERROR_SOUND_POLICY_BY_ALARM)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY_BY_ALARM is deprecated and will be removed from next release.");
- }
-
return ret;
}
@@ -1299,15 +1291,7 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
muse_camera_msg_get(previous, recv_msg);
muse_camera_msg_get(current, recv_msg);
- LOGW("INTERRUPTED - policy %d, state previous %d, current %d",
- policy, previous, current);
-
- if (policy == CAMERA_POLICY_SOUND)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND is deprecated and will be removed from next release.");
- else if (policy == CAMERA_POLICY_SOUND_BY_CALL)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND_BY_CALL is deprecated and will be removed from next release.");
- else if (policy == CAMERA_POLICY_SOUND_BY_ALARM)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND_BY_ALARM is deprecated and will be removed from next release.");
+ LOGW("INTERRUPTED - policy %d, state %d -> %d", policy, previous, current);
((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)policy,
(camera_state_e)previous, (camera_state_e)current, cb_info->user_data[event]);
@@ -1323,13 +1307,6 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
LOGW("INTERRUPT_STARTED - policy %d, state %d", policy, state);
- if (policy == CAMERA_POLICY_SOUND)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND is deprecated and will be removed from next release.");
- else if (policy == CAMERA_POLICY_SOUND_BY_CALL)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND_BY_CALL is deprecated and will be removed from next release.");
- else if (policy == CAMERA_POLICY_SOUND_BY_ALARM)
- LOGW("DEPRECATION WARNING: CAMERA_POLICY_SOUND_BY_ALARM is deprecated and will be removed from next release.");
-
((camera_interrupt_started_cb)cb_info->user_cb[event])((camera_policy_e)policy,
(camera_state_e)state, cb_info->user_data[event]);
}
@@ -1347,13 +1324,6 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
LOGE("ERROR - error 0x%x, current_state %d", error, current_state);
- if (error == CAMERA_ERROR_SOUND_POLICY)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY is deprecated and will be removed from next release.");
- else if (error == CAMERA_ERROR_SOUND_POLICY_BY_CALL)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY_BY_CALL is deprecated and will be removed from next release.");
- else if (error == CAMERA_ERROR_SOUND_POLICY_BY_ALARM)
- LOGW("DEPRECATION WARNING: CAMERA_ERROR_SOUND_POLICY_BY_ALARM is deprecated and will be removed from next release.");
-
((camera_error_cb)cb_info->user_cb[event])((camera_error_e)error,
(camera_state_e)current_state, cb_info->user_data[event]);
}
@@ -2093,12 +2063,6 @@ static camera_cb_info_s *_camera_client_callback_new(gint sockfd)
goto ErrorExit;
}
- /* display interface handle */
- if (mm_display_interface_init(&cb_info->dp_interface) != MM_ERROR_NONE) {
- LOGE("display interface init failed");
- goto ErrorExit;
- }
-
cb_info->api_waiting[MUSE_CAMERA_API_CREATE] = 1;
for (i = 0 ; i < MUSE_CAMERA_API_MAX ; i++) {
@@ -2170,11 +2134,6 @@ ErrorExit:
g_cond_clear(&cb_info->api_cond[i]);
}
- if (cb_info->dp_interface) {
- mm_display_interface_deinit(cb_info->dp_interface);
- cb_info->dp_interface = NULL;
- }
-
g_free(cb_info);
cb_info = NULL;
}
@@ -3017,8 +2976,21 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
if (type == CAMERA_DISPLAY_TYPE_NONE) {
LOGD("display type NONE");
} else {
+ /* display interface handle */
+ if (!cb_info->dp_interface) {
+ if (mm_display_interface_init(&cb_info->dp_interface) != MM_ERROR_NONE) {
+ LOGE("display interface init failed");
+ return CAMERA_ERROR_NOT_SUPPORTED;
+ }
+ }
+
ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &cb_info->parent_id);
- if (ret == MM_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_EVAS) {
+ if (ret != MM_ERROR_NONE) {
+ LOGE("[INVALID_OPERATION] set display failed[0x%x]", ret);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+
+ if (type == CAMERA_DISPLAY_TYPE_EVAS) {
//LCOV_EXCL_START
camera_flip_e flip = CAMERA_FLIP_NONE;
camera_display_mode_e mode = CAMERA_DISPLAY_MODE_LETTER_BOX;