summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2016-06-30 16:21:11 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2016-06-30 16:33:21 +0900
commit6b15e7b9ab39e633dada3ee8254571b9646ca754 (patch)
tree7ab834c61fcf26e041d6c084a953347ddac3b460
parentaeb83a58908dc93436f439bc41eb1d370d2800fb (diff)
downloadcamera-6b15e7b9ab39e633dada3ee8254571b9646ca754.tar.gz
camera-6b15e7b9ab39e633dada3ee8254571b9646ca754.tar.bz2
camera-6b15e7b9ab39e633dada3ee8254571b9646ca754.zip
Change-Id: Ic639212381ca9a2a1ead4fb3de3e70c3f29615a2 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--CMakeLists.txt18
-rw-r--r--include/camera_private.h8
-rw-r--r--packaging/capi-media-camera.spec19
-rw-r--r--src/camera.c87
-rw-r--r--test/camera_test.c2
5 files changed, 45 insertions, 89 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87ac7fe..a8d9ab0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,11 +9,11 @@ SET(service "media")
SET(submodule "camera")
# for package file
-IF(EVAS_RENDERER_SUPPORT)
+IF(TIZEN_FEATURE_EVAS_RENDERER)
SET(dependents "libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client mm-evas-renderer")
-ELSE(EVAS_RENDERER_SUPPORT)
+ELSE(TIZEN_FEATURE_EVAS_RENDERER)
SET(dependents "libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client")
-ENDIF(EVAS_RENDERER_SUPPORT)
+ENDIF(TIZEN_FEATURE_EVAS_RENDERER)
SET(pc_dependents "capi-base-common capi-media-tool libtbm evas ecore elementary")
SET(fw_name "${project_prefix}-${service}-${submodule}")
@@ -38,15 +38,9 @@ IF("${ARCH}" STREQUAL "arm")
ADD_DEFINITIONS("-DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
-IF(WAYLAND_SUPPORT)
- ADD_DEFINITIONS("-DHAVE_WAYLAND")
-ENDIF(WAYLAND_SUPPORT)
-IF(X11_SUPPORT)
- ADD_DEFINITIONS("-DHAVE_X11")
-ENDIF(X11_SUPPORT)
-IF(EVAS_RENDERER_SUPPORT)
- ADD_DEFINITIONS("-DEVAS_RENDERER_SUPPORT")
-ENDIF(EVAS_RENDERER_SUPPORT)
+IF(TIZEN_FEATURE_EVAS_RENDERER)
+ ADD_DEFINITIONS("-DTIZEN_FEATURE_EVAS_RENDERER")
+ENDIF(TIZEN_FEATURE_EVAS_RENDERER)
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
diff --git a/include/camera_private.h b/include/camera_private.h
index c4b389c..56e8ad5 100644
--- a/include/camera_private.h
+++ b/include/camera_private.h
@@ -104,10 +104,10 @@ typedef struct _camera_cb_info_s {
media_format_h pkt_fmt;
int preview_cb_flag;
GMutex mp_data_mutex;
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
void *evas_info;
GMutex evas_mutex;
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
gboolean run_evas_render;
} camera_cb_info_s;
@@ -123,7 +123,6 @@ typedef struct _camera_idle_event_s {
GMutex event_mutex;
} camera_idle_event_s;
-#ifdef HAVE_WAYLAND
typedef struct _camera_wl_info_s {
int parent_id;
int window_x;
@@ -132,15 +131,12 @@ typedef struct _camera_wl_info_s {
int window_height;
void *evas_obj;
} camera_wl_info_s;
-#endif /* HAVE_WAYLAND */
typedef struct _camera_cli_s {
intptr_t remote_handle;
intptr_t display_handle;
camera_cb_info_s *cb_info;
-#ifdef HAVE_WAYLAND
camera_wl_info_s wl_info;
-#endif /* HAVE_WAYLAND */
} camera_cli_s;
typedef struct _camera_media_packet_data {
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index c1d53d2..7a7b450 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,9 +1,6 @@
-%bcond_with wayland
-%bcond_with x
-
Name: capi-media-camera
Summary: A Camera API
-Version: 0.2.63
+Version: 0.2.64
Release: 0
Group: Multimedia/API
License: Apache-2.0
@@ -59,20 +56,10 @@ export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
-%if %{with wayland}
- -DWAYLAND_SUPPORT=On \
-%else
- -DWAYLAND_SUPPORT=Off \
-%endif
%if "%{?profile}" != "tv"
- -DEVAS_RENDERER_SUPPORT=On \
-%else
- -DEVAS_RENDERER_SUPPORT=Off \
-%endif
-%if %{with x}
- -DX11_SUPPORT=On
+ -DTIZEN_FEATURE_EVAS_RENDERER=On
%else
- -DX11_SUPPORT=Off
+ -DTIZEN_FEATURE_EVAS_RENDERER=Off
%endif
make %{?jobs:-j%jobs}
diff --git a/src/camera.c b/src/camera.c
index 8c04b5c..765bb93 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -31,16 +31,12 @@
#include <Elementary.h>
#include <tbm_surface_internal.h>
#include <Evas.h>
-#ifdef HAVE_WAYLAND
#include <Ecore_Wayland.h>
#include <wayland-client.h>
#include <tizen-extension-client-protocol.h>
-#else /* HAVE_WAYLAND */
-#include <Ecore.h>
-#endif /* HAVE_WAYLAND */
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
#include <mm_evas_renderer.h>
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
#ifdef LOG_TAG
#undef LOG_TAG
@@ -48,7 +44,6 @@
#define LOG_TAG "TIZEN_N_CAMERA"
-#ifdef HAVE_WAYLAND
static void __global(void *data, struct wl_registry *registry,
uint32_t name, const char *interface, uint32_t version)
{
@@ -230,7 +225,6 @@ _DONE:
return ret;
}
-#endif /* HAVE_WAYLAND */
static int _import_tbm_key(tbm_bufmgr bufmgr, unsigned int tbm_key, tbm_bo *bo, tbm_bo_handle *bo_handle)
{
@@ -997,7 +991,7 @@ static void _client_user_callback(camera_cb_info_s *cb_info, char *recv_msg, mus
/* call evas renderer */
if (CHECK_PREVIEW_CB(cb_info, PREVIEW_CB_TYPE_EVAS)) {
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
ret = _camera_media_packet_data_create(tbm_key, num_buffer_key, bo, buffer_bo, data_bo, &mp_data);
if (ret == CAMERA_ERROR_NONE) {
@@ -1021,9 +1015,9 @@ static void _client_user_callback(camera_cb_info_s *cb_info, char *recv_msg, mus
mp_data = NULL;
}
}
-#else /* EVAS_RENDERER_SUPPORT */
+#else /* TIZEN_FEATURE_EVAS_RENDERER */
LOGW("evas renderer is not supported");
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
}
/* send message for preview callback return */
@@ -1850,9 +1844,9 @@ static camera_cb_info_s *_client_callback_new(gint sockfd)
g_mutex_init(&cb_info->idle_event_mutex);
g_cond_init(&cb_info->idle_event_cond);
g_mutex_init(&cb_info->mp_data_mutex);
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_init(&cb_info->evas_mutex);
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
for (i = 0 ; i < MUSE_CAMERA_API_MAX ; i++) {
g_mutex_init(&cb_info->api_mutex[i]);
@@ -1889,9 +1883,9 @@ static camera_cb_info_s *_client_callback_new(gint sockfd)
cb_info->api_activating = tmp_activating;
cb_info->api_ret = tmp_ret;
cb_info->preview_cb_flag = 0;
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
cb_info->evas_info = NULL;
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
g_atomic_int_set(&cb_info->msg_recv_running, 1);
cb_info->msg_recv_thread = g_thread_try_new("camera_msg_recv",
@@ -1926,9 +1920,9 @@ ErrorExit:
g_mutex_clear(&cb_info->idle_event_mutex);
g_cond_clear(&cb_info->idle_event_cond);
g_mutex_clear(&cb_info->mp_data_mutex);
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_clear(&cb_info->evas_mutex);
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
if (cb_info->msg_queue) {
g_queue_free(cb_info->msg_queue);
@@ -1987,9 +1981,9 @@ static void _client_callback_destroy(camera_cb_info_s *cb_info)
g_mutex_clear(&cb_info->idle_event_mutex);
g_cond_clear(&cb_info->idle_event_cond);
g_mutex_clear(&cb_info->mp_data_mutex);
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_clear(&cb_info->evas_mutex);
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
LOGD("event thread removed");
@@ -2015,10 +2009,10 @@ static void _client_callback_destroy(camera_cb_info_s *cb_info)
cb_info->pkt_fmt = NULL;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (cb_info->evas_info)
mm_evas_renderer_destroy(&cb_info->evas_info);
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
cb_info->preview_cb_flag = 0;
@@ -2051,7 +2045,7 @@ int _camera_start_evas_rendering(camera_h camera)
return CAMERA_ERROR_NONE;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_lock(&pc->cb_info->evas_mutex);
/* set evas render flag as RUN */
@@ -2059,10 +2053,10 @@ int _camera_start_evas_rendering(camera_h camera)
ret = CAMERA_ERROR_NONE;
g_mutex_unlock(&pc->cb_info->evas_mutex);
-#else /* EVAS_RENDERER_SUPPORT */
+#else /* TIZEN_FEATURE_EVAS_RENDERER */
LOGW("evas renderer is not supported");
ret = CAMERA_ERROR_NOT_SUPPORTED;
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
return ret;
}
@@ -2090,7 +2084,7 @@ int _camera_stop_evas_rendering(camera_h camera, bool keep_screen)
return CAMERA_ERROR_NONE;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_lock(&pc->cb_info->evas_mutex);
/* set evas render flag as STOP and release buffers */
@@ -2103,10 +2097,10 @@ int _camera_stop_evas_rendering(camera_h camera, bool keep_screen)
}
g_mutex_unlock(&pc->cb_info->evas_mutex);
-#else /* EVAS_RENDERER_SUPPORT */
+#else /* TIZEN_FEATURE_EVAS_RENDERER */
LOGW("evas renderer is not supported");
ret = CAMERA_ERROR_NOT_SUPPORTED;
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
return ret;
}
@@ -2684,9 +2678,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
void *set_display_handle = NULL;
Evas_Object *obj = NULL;
const char *object_type = NULL;
-#ifdef HAVE_WAYLAND
camera_wl_info_s *wl_info = NULL;
-#endif /* HAVE_WAYLAND */
camera_cli_s *pc = (camera_cli_s *)camera;
camera_cb_info_s *cb_info = NULL;
muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
@@ -2737,7 +2729,6 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
object_type = evas_object_type_get(obj);
if (object_type) {
if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
-#ifdef HAVE_WAYLAND
/* get wayland parent id */
if (_get_wl_info(obj, &pc->wl_info) != CAMERA_ERROR_NONE) {
LOGE("failed to get wayland info");
@@ -2745,17 +2736,13 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
}
set_display_handle = (void *)&pc->wl_info;
-#else /* HAVE_WAYLAND */
- /* x window overlay surface */
- set_display_handle = (void *)elm_win_xwindow_get(obj);
-#endif /* HAVE_WAYLAND */
LOGD("display type OVERLAY : handle %p", set_display_handle);
} else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
/* evas object surface */
set_display_handle = (void *)display;
LOGD("display type EVAS : handle %p", set_display_handle);
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
g_mutex_lock(&cb_info->evas_mutex);
if (cb_info->evas_info) {
@@ -2804,10 +2791,10 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
LOGE("mm_evas_renderer error 0x%x", ret);
return CAMERA_ERROR_INVALID_OPERATION;
}
-#else /* EVAS_RENDERER_SUPPORT */
+#else /* TIZEN_FEATURE_EVAS_RENDERER */
LOGE("EVAS surface is not supported");
return CAMERA_ERROR_NOT_SUPPORTED;
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
} else {
LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
return CAMERA_ERROR_INVALID_PARAMETER;
@@ -2821,7 +2808,6 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
pc->display_handle = (intptr_t)set_display_handle;
if (type == CAMERA_DISPLAY_TYPE_OVERLAY) {
-#ifdef HAVE_WAYLAND
wl_info = &pc->wl_info;
muse_camera_msg_send_array_and_value(api, sock_fd, cb_info, ret,
wl_info, sizeof(camera_wl_info_s), sizeof(int), INT, type);
@@ -2829,11 +2815,6 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
LOGD("wayland parent id : %d, window %d,%d,%dx%d",
wl_info->parent_id, wl_info->window_x, wl_info->window_y,
wl_info->window_width, wl_info->window_height);
-#else /* HAVE_WAYLAND */
- muse_camera_msg_send2(api, sock_fd, cb_info, ret, INT, type, INT, set_display_handle);
-
- LOGD("x id : %d", (int)set_display_handle);
-#endif /* HAVE_WAYLAND */
} else
muse_camera_msg_send1(api, sock_fd, cb_info, ret, INT, type);
@@ -3000,7 +2981,7 @@ int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
return CAMERA_ERROR_INVALID_PARAMETER;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
g_mutex_lock(&pc->cb_info->evas_mutex);
@@ -3013,7 +2994,7 @@ int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
return CAMERA_ERROR_INVALID_OPERATION;
}
}
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
muse_camera_msg_send1(MUSE_CAMERA_API_SET_DISPLAY_ROTATION,
pc->cb_info->fd, pc->cb_info, ret, INT, set_rotation);
@@ -3073,7 +3054,7 @@ int camera_set_display_flip(camera_h camera, camera_flip_e flip)
return CAMERA_ERROR_INVALID_PARAMETER;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
g_mutex_lock(&pc->cb_info->evas_mutex);
@@ -3086,7 +3067,7 @@ int camera_set_display_flip(camera_h camera, camera_flip_e flip)
return CAMERA_ERROR_INVALID_OPERATION;
}
}
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
muse_camera_msg_send1(MUSE_CAMERA_API_SET_DISPLAY_FLIP,
pc->cb_info->fd, pc->cb_info, ret, INT, set_flip);
@@ -3141,7 +3122,7 @@ int camera_set_display_visible(camera_h camera, bool visible)
return CAMERA_ERROR_INVALID_PARAMETER;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
g_mutex_lock(&pc->cb_info->evas_mutex);
@@ -3154,7 +3135,7 @@ int camera_set_display_visible(camera_h camera, bool visible)
return CAMERA_ERROR_INVALID_OPERATION;
}
}
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
muse_camera_msg_send1(MUSE_CAMERA_API_SET_DISPLAY_VISIBLE,
pc->cb_info->fd, pc->cb_info, ret, INT, set_visible);
@@ -3214,7 +3195,7 @@ int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
return CAMERA_ERROR_INVALID_PARAMETER;
}
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
g_mutex_lock(&pc->cb_info->evas_mutex);
@@ -3227,7 +3208,7 @@ int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
return CAMERA_ERROR_INVALID_OPERATION;
}
}
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
muse_camera_msg_send1(MUSE_CAMERA_API_SET_DISPLAY_MODE,
pc->cb_info->fd, pc->cb_info, ret, INT, set_mode);
@@ -6404,7 +6385,7 @@ int camera_attr_set_display_roi_area(camera_h camera, int x, int y, int width, i
LOGD("Enter, remote_handle : %x", pc->remote_handle);
-#ifdef EVAS_RENDERER_SUPPORT
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
g_mutex_lock(&pc->cb_info->evas_mutex);
@@ -6417,7 +6398,7 @@ int camera_attr_set_display_roi_area(camera_h camera, int x, int y, int width, i
return CAMERA_ERROR_INVALID_OPERATION;
}
}
-#endif /* EVAS_RENDERER_SUPPORT */
+#endif /* TIZEN_FEATURE_EVAS_RENDERER */
muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
set_display_roi_area, sizeof(set_display_roi_area), sizeof(int));
diff --git a/test/camera_test.c b/test/camera_test.c
index 30dd1ac..9970843 100644
--- a/test/camera_test.c
+++ b/test/camera_test.c
@@ -1422,9 +1422,7 @@ static int app_create(void *data)
g_print("\n\tscreen size %dx%d\n\n", w, h);
evas_object_resize(win, w, h);
elm_win_autodel_set(win, EINA_TRUE);
-#ifdef HAVE_WAYLAND
elm_win_alpha_set(win, EINA_TRUE);
-#endif /* HAVE_WAYLAND */
} else {
g_print("\n\tfailed to get window\n\n");
return 1;