diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2020-06-23 16:07:46 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2020-06-23 16:41:57 +0900 |
commit | eb0a7accbea76943e51e3b5c2d6c7a4e4d45fed7 (patch) | |
tree | d398ef2ba0f78ee6e8c534405d8fbe8add1d5cf0 | |
parent | bb5962716df8450973f921400e3d30dae104e127 (diff) | |
download | camera-eb0a7accbea76943e51e3b5c2d6c7a4e4d45fed7.tar.gz camera-eb0a7accbea76943e51e3b5c2d6c7a4e4d45fed7.tar.bz2 camera-eb0a7accbea76943e51e3b5c2d6c7a4e4d45fed7.zip |
Add new internal API for Ecore_Wl2_Windowsubmit/tizen/20200624.034306accepted/tizen/unified/20200625.110556
- int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window);
[Version] 0.4.35
[Profile] Common
[Issue Type] New feature
Change-Id: If3abec72b083952afb28d1fb2df09ac1509af1a6
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | include/camera_internal.h | 24 | ||||
-rw-r--r-- | include/camera_private.h | 1 | ||||
-rw-r--r-- | packaging/capi-media-camera.spec | 2 | ||||
-rw-r--r-- | src/camera.c | 22 | ||||
-rw-r--r-- | src/camera_internal.c | 5 |
5 files changed, 46 insertions, 8 deletions
diff --git a/include/camera_internal.h b/include/camera_internal.h index f1728d4..18740ef 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -64,6 +64,30 @@ int camera_start_evas_rendering(camera_h camera); int camera_stop_evas_rendering(camera_h camera, bool keep_screen); /** + * @brief Sets the ecore wayland video display. + * @since_tizen 6.0 + * @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. + * @param[in] camera The handle to the camera + * @param[in] ecore_wl_window The ecore wayland window handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_INVALID_STATE Invalid state + * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation + * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected + * @pre The camera state must be set to #CAMERA_STATE_CREATED. + * @see camera_start_preview() + * @see ecore_thread_main_loop_begin() + * @see ecore_thread_main_loop_end() + */ +int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window); + +/** * @} */ #ifdef __cplusplus diff --git a/include/camera_private.h b/include/camera_private.h index 0b79381..b863bbc 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -229,6 +229,7 @@ int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user int _camera_start_evas_rendering(camera_h camera); int _camera_stop_evas_rendering(camera_h camera, bool keep_screen); int _camera_independent_request(int api, int device_type, const char *key, int *value); +int _camera_set_display(camera_h camera, mm_display_type_e type, void *display); typedef bool (*camera_supported_cb_param1)(int param, void *user_data); typedef bool (*camera_supported_cb_param2)(int param1, int param2, void *user_data); diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index a17a973..fb1c103 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.34 +Version: 0.4.35 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 6878d5f..34ff1f6 100644 --- a/src/camera.c +++ b/src/camera.c @@ -3122,7 +3122,8 @@ int camera_cancel_focusing(camera_h camera) return ret; } -int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display) + +int _camera_set_display(camera_h camera, mm_display_type_e type, void *display) { int mm_ret = MM_ERROR_NONE; int ret = CAMERA_ERROR_NONE; @@ -3138,12 +3139,12 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ return CAMERA_ERROR_INVALID_PARAMETER; } - if (type < CAMERA_DISPLAY_TYPE_OVERLAY || type > CAMERA_DISPLAY_TYPE_NONE) { + if (type > MM_DISPLAY_TYPE_OVERLAY_EXT) { LOGE("invalid type %d", type); return CAMERA_ERROR_INVALID_PARAMETER; } - if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) { + if (type != MM_DISPLAY_TYPE_NONE && display == NULL) { LOGE("display type[%d] is not NONE, but display handle is NULL", type); return CAMERA_ERROR_INVALID_PARAMETER; } @@ -3164,7 +3165,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ LOGD("Enter - type : %d, display : %p", type, display); - if (type != CAMERA_DISPLAY_TYPE_NONE) { + if (type != MM_DISPLAY_TYPE_NONE) { /* check display interface handle */ if (!cb_info->dp_interface) { LOGE("display interface not supported"); @@ -3180,13 +3181,13 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ return CAMERA_ERROR_INVALID_OPERATION; } - if (type == CAMERA_DISPLAY_TYPE_OVERLAY) { + if (type == MM_DISPLAY_TYPE_OVERLAY) { mm_ret = mm_display_interface_get_window_rect(cb_info->dp_interface, &dp_info->window_rect); LOGD("ret 0x%x, parent_id %d, window rect %d,%d,%dx%d", ret, dp_info->parent_id, dp_info->window_rect.x, dp_info->window_rect.y, dp_info->window_rect.width, dp_info->window_rect.height); - } else if (type == CAMERA_DISPLAY_TYPE_EVAS) { + } else if (type == MM_DISPLAY_TYPE_EVAS) { //LCOV_EXCL_START camera_flip_e flip = CAMERA_FLIP_NONE; camera_display_mode_e mode = CAMERA_DISPLAY_MODE_LETTER_BOX; @@ -3229,7 +3230,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ _camera_msg_send_param1(api, cb_info, &ret, ¶m, CAMERA_CB_TIMEOUT); if (ret == CAMERA_ERROR_NONE) { - if (type == CAMERA_DISPLAY_TYPE_EVAS) + if (type == MM_DISPLAY_TYPE_EVAS) SET_PREVIEW_CB_TYPE(cb_info, PREVIEW_CB_TYPE_EVAS); } @@ -3237,6 +3238,13 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ } +int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display) +{ + LOGD("type %d, display %p", type, display); + return _camera_set_display(camera, (mm_display_type_e)type, display); +} + + int camera_set_preview_resolution(camera_h camera, int width, int height) { int ret = CAMERA_ERROR_NONE; diff --git a/src/camera_internal.c b/src/camera_internal.c index ebc96d2..aa8d898 100644 --- a/src/camera_internal.c +++ b/src/camera_internal.c @@ -39,4 +39,9 @@ int camera_stop_evas_rendering(camera_h camera, bool keep_screen) { return _camera_stop_evas_rendering(camera, keep_screen); } + +int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window) +{ + return _camera_set_display(camera, MM_DISPLAY_TYPE_OVERLAY_EXT, ecore_wl_window); +} //LCOV_EXCL_STOP |