PROJECT(${fw_name})
-SET(pc_dependents "dlog mm-common mused libtbm")
+SET(pc_dependents "dlog mm-common mused libtbm mm-camcorder")
SET(PC_NAME ${fw_name})
SET(PC_REQUIRED ${pc_dependents})
CAMERA_ATTR_FLASH_MODE_PERMANENT, /**< Keep turned on until turning off */
} camera_attr_flash_mode_e;
-
/**
* @brief Enumeration to preview FPS.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @see camera_start_continuous_capture()
* @see camera_capture_completed_cb()
*/
-typedef void (*camera_capturing_cb)(camera_image_data_s* image, camera_image_data_s* postview, camera_image_data_s* thumbnail, void *user_data);
+typedef void (*camera_capturing_cb)(camera_image_data_s *image, camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data);
/**
* @brief Called when the camera capturing completes.
return __convert_camera_error_code(__func__, ret);
}
+
int legacy_camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void *user_data)
{
if (camera == NULL) {
int ret = MM_ERROR_NONE;
int set_surface = MM_DISPLAY_SURFACE_OVERLAY;
void *set_handle = NULL;
- camera_s *handle = NULL;
-
- Evas_Object *obj = NULL;
- const char *object_type = NULL;
char *socket_path = NULL;
+ camera_s *handle = NULL;
if (camera == NULL) {
LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
switch (type) {
case CAMERA_DISPLAY_TYPE_OVERLAY:
+ handle->display_handle = display;
+ set_surface = MM_DISPLAY_SURFACE_OVERLAY;
+ set_handle = display;
+ break;
case CAMERA_DISPLAY_TYPE_EVAS:
- obj = (Evas_Object *)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
- MMCamWaylandInfo *wl_info = (MMCamWaylandInfo *)malloc(sizeof(MMCamWaylandInfo));
-
- if (wl_info == NULL) {
- LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
- return __convert_camera_error_code(__func__, MM_ERROR_CAMCORDER_LOW_MEMORY);
- }
-
- memset(wl_info, 0x0, sizeof(MMCamWaylandInfo));
-
- wl_info->evas_obj = (void *)obj;
- wl_info->window = (void *)elm_win_wl_window_get(obj);
- wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
- wl_info->display = (void *)ecore_wl_display_get();
-
- if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
- LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
- free(wl_info);
- return __convert_camera_error_code(__func__, MM_ERROR_CAMCORDER_INTERNAL);
- }
-
- evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
- &wl_info->window_width, &wl_info->window_height);
-
- if (handle->wl_info) {
- free(handle->wl_info);
- handle->wl_info = NULL;
- }
-
- /* set wayland info */
- handle->wl_info = (void *)wl_info;
- set_surface = MM_DISPLAY_SURFACE_OVERLAY;
- set_handle = (void *)wl_info;
-
- LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
- wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
- wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
-#else /* HAVE_WAYLAND */
- /* x window overlay surface */
- handle->display_handle = (void *)elm_win_xwindow_get(obj);
- set_surface = MM_DISPLAY_SURFACE_OVERLAY;
- set_handle = &(handle->display_handle);
-
- LOGD("display type OVERLAY : handle %p, %d", set_handle, (int)handle->display_handle);
-#endif /* HAVE_WAYLAND */
- } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
- /* evas object surface */
- handle->display_handle = display;
- set_surface = MM_DISPLAY_SURFACE_EVAS;
- set_handle = display;
-
- LOGD("display type EVAS : handle %p", set_handle);
- } else {
- LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
- } else {
- LOGE("failed to get evas object type from %p", obj);
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
+ handle->display_handle = display;
+ set_surface = MM_DISPLAY_SURFACE_EVAS;
+ set_handle = display;
break;
case CAMERA_DISPLAY_TYPE_REMOTE:
set_surface = MM_DISPLAY_SURFACE_REMOTE;
}
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
- MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
- MMCAM_DISPLAY_SURFACE, set_surface,
- NULL);
+ MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
+ MMCAM_DISPLAY_SURFACE, set_surface,
+ NULL);
if (ret == MM_ERROR_NONE) {
if (type == CAMERA_DISPLAY_TYPE_REMOTE) {
NULL);
} else if (type != CAMERA_DISPLAY_TYPE_NONE) {
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
- MMCAM_DISPLAY_HANDLE, set_handle, sizeof(void *),
- NULL);
+ MMCAM_DISPLAY_HANDLE, set_handle, sizeof(void *),
+ NULL);
}
}
return CAMERA_ERROR_INVALID_PARAMETER;
}
- if (rotation > CAMERA_ROTATION_270) {
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
- if (flip > CAMERA_FLIP_BOTH) {
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
return CAMERA_ERROR_INVALID_PARAMETER;
}
- if (mode > CAMERA_DISPLAY_MODE_CROPPED_FULL) {
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
int ret = MM_ERROR_NONE;
camera_s *handle = (camera_s *)camera;
#include <stdio.h>
#include <tbm_bufmgr.h>
#include "legacy_camera_internal.h"
+#include <mm_camcorder.h>
/**
* @brief Enumeration for the muse camera apis.
GMutex list_lock;
GMutex preview_cb_lock;
GCond preview_cb_cond;
+#ifdef HAVE_WAYLAND
+ MMCamWaylandInfo wl_info;
+#endif /* HAVE_WAYLAND */
} muse_camera_handle_s;
int __len__; \
int *__value__ = (int *)param; \
__sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_INT, #length, length, \
+ MUSE_TYPE_ARRAY, #param, \
+ datum_size == sizeof(int)? length : \
+ length / sizeof(int) + (length % sizeof(int)?1:0), \
+ __value__, \
+ 0); \
+ __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+ if (__len__ <= 0) { \
+ LOGE("sending message failed"); \
+ ret = CAMERA_ERROR_INVALID_OPERATION; \
+ } else \
+ ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+ muse_core_msg_json_factory_free(__sndMsg__); \
+ }while(0)
+
+/**
+ * @brief Send the message from proxy to module via ipc, adding an array data and value.
+ * @param[in] api The enumeration of the corresponding api.
+ * @param[in] fd The socket fd that connected to the module via ipc.
+ * @param[in] cb_info The callback information, waiting for the ack from the module.
+ * @param[out] ret The delivered return value from the module to proxy side.
+ * @param[in] param The array data parameter to be included in the message.
+ * @param[in] length The length of the array.
+ * @param[in] datum_size The size of the array.
+ * @param[in] type The data type of the parameter.
+ * @param[in] param2 The 2rd parameter to be included in the message.
+ */
+#define muse_camera_msg_send_array_and_value(api, fd, cb_info, ret, param, length, datum_size, type, param2) \
+ do{ \
+ char *__sndMsg__; \
+ int __len__; \
+ int *__value__ = (int *)param; \
+ type __value2__ = (type)param2; \
+ __sndMsg__ = muse_core_msg_json_factory_new(api, \
+ MUSE_TYPE_##type, #param2, __value2__, \
MUSE_TYPE_ARRAY, #param, \
datum_size == sizeof(int)? length : \
length / sizeof(int) + (length % sizeof(int)?1:0), \
__sndMsg__ = muse_core_msg_json_factory_new(api, \
MUSE_TYPE_INT, PARAM_API_CLASS, class, \
MUSE_TYPE_INT, PARAM_RET, ret, \
- MUSE_TYPE_INT, #length, length, \
MUSE_TYPE_ARRAY, #param, \
datum_size == sizeof(int)? length : \
length / sizeof(int) + (length % sizeof(int)?1:0), \
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
static guint stream_id = 0;
char socket_path[SOCKET_PATH_LENGTH] = {0,};
- camera_h camera;
+#ifdef HAVE_WAYLAND
+ MMCamWaylandInfo *wl_info = NULL;
+#endif /* HAVE_WAYLAND */
+ camera_display_type_e type = CAMERA_DISPLAY_TYPE_OVERLAY;
+ camera_h camera = NULL;;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
LOGD("handle : 0x%x", muse_camera);
camera = muse_camera->camera_handle;
- stream_id = muse_core_get_atomic_uint();
- snprintf(socket_path, SOCKET_PATH_LENGTH, SOCKET_PATH_BASE, stream_id);
+ muse_camera_msg_get(type, muse_core_client_get_msg(module));
- LOGD("socket_path : %s", socket_path);
+ LOGD("type %d", type);
+#ifdef HAVE_WAYLAND
+ if (type == CAMERA_DISPLAY_TYPE_OVERLAY) {
+ wl_info = &muse_camera->wl_info;
+ muse_camera_msg_get_array(wl_info, muse_core_client_get_msg(module));
+
+ 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);
+
+ ret = legacy_camera_set_display(muse_camera->camera_handle, type, (void *)wl_info);
- ret = legacy_camera_set_display(muse_camera->camera_handle, CAMERA_DISPLAY_TYPE_REMOTE, (void *)socket_path);
- if (ret != CAMERA_ERROR_NONE) {
muse_camera_msg_return(api, class, ret, module);
} else {
- muse_camera_msg_return1(api, class, ret, module,
- STRING, socket_path);
+#endif /* HAVE_WAYLAND */
+ stream_id = muse_core_get_atomic_uint();
+
+ snprintf(socket_path, SOCKET_PATH_LENGTH, SOCKET_PATH_BASE, stream_id);
+
+ LOGD("socket_path : %s", socket_path);
+
+ ret = legacy_camera_set_display(muse_camera->camera_handle, CAMERA_DISPLAY_TYPE_REMOTE, (void *)socket_path);
+ if (ret != CAMERA_ERROR_NONE) {
+ muse_camera_msg_return(api, class, ret, module);
+ } else {
+ muse_camera_msg_return1(api, class, ret, module, STRING, socket_path);
+ }
+#ifdef HAVE_WAYLAND
}
+#endif /* HAVE_WAYLAND */
return MUSE_CAMERA_ERROR_NONE;
}
Name: mmsvc-camera
Summary: A Camera module for muse server
-Version: 0.2.27
+Version: 0.2.28
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0