#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
#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)
{
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)
{
/* 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) {
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 */
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]);
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",
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);
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");
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;
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 */
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;
}
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 */
}
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;
}
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;
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");
}
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) {
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;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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));