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)
-
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
*/
int legacy_camera_get_display_mode(camera_h camera, camera_display_mode_e *mode);
+
+int legacy_camera_set_display_reuse_hint(camera_h camera, int hint);
+
+int legacy_camera_get_display_reuse_hint(camera_h camera, int *hint);
+
/**
* @brief Sets the resolution of the captured image.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
void* user_cb[_CAMERA_EVENT_TYPE_NUM];
void* user_data[_CAMERA_EVENT_TYPE_NUM];
void* display_handle;
-#ifdef HAVE_WAYLAND
MMCamWaylandInfo *wl_info;
-#endif /* #ifdef HAVE_WAYLAND */
camera_display_type_e display_type;
unsigned int state;
GList *cb_data_list;
GMutex idle_cb_lock;
+
+ void *reuse_element;
} camera_s;
int _camera_get_mm_handle(camera_h camera , MMHandleType *handle);
#include <gst/gst.h>
#include <Evas.h>
#include <Ecore.h>
-#ifdef HAVE_WAYLAND
#include <Ecore_Wayland.h>
-#endif /* HAVE_WAYLAND */
#include <Elementary.h>
#ifdef LOG_TAG
default:
ret = CAMERA_ERROR_INVALID_OPERATION;
errorstr = "INVALID_OPERATION";
+ break;
}
if (code != MM_ERROR_NONE) {
break;
}
- previous_state = handle->state;
- handle->state = __camera_state_convert(m->state.current );
-
if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM) {
switch (m->state.code) {
case MM_MSG_CODE_INTERRUPTED_BY_CALL_START:
LOGW("CAMERA_POLICY_RESOURCE_CONFLICT");
}
+ if (policy != CAMERA_POLICY_NONE &&
+ handle->state == CAMERA_STATE_CAPTURING) {
+ handle->state = CAMERA_STATE_CAPTURED;
+ if (handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
+ ((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(CAMERA_STATE_CAPTURING,
+ handle->state, policy, handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
+ }
+
+ if (handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]) {
+ ((camera_capture_completed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE])(handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]);
+ }
+ }
+
+ previous_state = handle->state;
+ handle->state = __camera_state_convert(m->state.current);
+
if (previous_state != handle->state && handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(previous_state,
- handle->state,
- policy,
- handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
+ handle->state, policy, handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
}
/* should change intermediate state MM_CAMCORDER_STATE_READY is not valid in capi , change to NULL state */
m->state.current == MM_CAMCORDER_STATE_NULL) {
if (handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED]) {
((camera_interrupted_cb)handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED])(policy,
- previous_state,
- handle->state,
- handle->user_data[_CAMERA_EVENT_TYPE_INTERRUPTED]);
+ previous_state, handle->state, handle->user_data[_CAMERA_EVENT_TYPE_INTERRUPTED]);
} else {
LOGW("_CAMERA_EVENT_TYPE_INTERRUPTED cb is NULL");
}
if (ret == MM_ERROR_NONE) {
_camera_remove_cb_message(handle);
g_mutex_clear(&handle->idle_cb_lock);
-#ifdef HAVE_WAYLAND
+
if (handle->wl_info) {
free(handle->wl_info);
handle->wl_info = NULL;
}
-#endif /* HAVE_WAYLAND */
+
free(handle);
}
}
+int legacy_camera_set_display_reuse_hint(camera_h camera, int hint)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_s *handle = (camera_s *)camera;
+
+ if (!handle) {
+ LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_DISPLAY_REUSE_HINT, hint,
+ NULL);
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_display_reuse_hint(camera_h camera, int *hint)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_s *handle = (camera_s *)camera;
+
+ if (!handle || !hint) {
+ LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+ MMCAM_DISPLAY_REUSE_HINT, hint,
+ NULL);
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+
int legacy_camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb, void *user_data)
{
if (camera == NULL || foreach_cb == NULL) {
int ret;
camera_s *handle = (camera_s *)camera;
-#ifdef HAVE_WAYLAND
ret = mm_camcorder_get_video_caps(handle->mm_handle, caps);
- if(ret != MM_ERROR_NONE) {
+ if (ret != MM_ERROR_NONE) {
return __convert_camera_error_code(__func__, ret);
}
-#endif /* HAVE_WAYLAND */
return CAMERA_ERROR_NONE;
}
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)
-
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DTIZEN_DEBUG")
MUSE_CAMERA_API_GET_DISPLAY_ROI_AREA,
MUSE_CAMERA_API_RETURN_BUFFER,
MUSE_CAMERA_API_PREVIEW_CB_RETURN, //145
+ MUSE_CAMERA_API_SET_DISPLAY_REUSE_HINT,
+ MUSE_CAMERA_API_GET_DISPLAY_REUSE_HINT,
MUSE_CAMERA_API_MAX
} muse_camera_api_e;
GMutex preview_cb_lock;
GCond preview_cb_cond;
guint preview_cb_flag;
-#ifdef HAVE_WAYLAND
MMCamWaylandInfo wl_info;
-#endif /* HAVE_WAYLAND */
} muse_camera_handle_s;
muse_camera_handle_s *muse_camera = NULL;
muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
-#ifdef HAVE_WAYLAND
MMCamWaylandInfo *wl_info = NULL;
-#endif /* HAVE_WAYLAND */
camera_display_type_e type = CAMERA_DISPLAY_TYPE_NONE;
camera_h camera = NULL;;
muse_camera_msg_get(type, muse_core_client_get_msg(module));
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));
muse_camera_msg_return(api, class, ret, module);
} else {
-#endif /* HAVE_WAYLAND */
LOGD("NOT overlay type. set NONE type.");
if (type == CAMERA_DISPLAY_TYPE_EVAS) {
ret = legacy_camera_set_display(muse_camera->camera_handle, CAMERA_DISPLAY_TYPE_NONE, NULL);
muse_camera_msg_return(api, class, ret, module);
-#ifdef HAVE_WAYLAND
}
-#endif /* HAVE_WAYLAND */
return MUSE_CAMERA_ERROR_NONE;
}
return MUSE_CAMERA_ERROR_NONE;
}
+int camera_dispatcher_set_display_reuse_hint(muse_module_h module)
+{
+ int ret = CAMERA_ERROR_NONE;
+ int set_hint = 0;
+ muse_camera_handle_s *muse_camera = NULL;
+ muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_REUSE_HINT;
+ muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
+
+ muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
+
+ muse_camera_msg_get(set_hint, muse_core_client_get_msg(module));
+
+ LOGD("set hint : %d", set_hint);
+
+ ret = legacy_camera_set_display_reuse_hint(muse_camera->camera_handle, (bool)set_hint);
+
+ muse_camera_msg_return(api, class, ret, module);
+
+ return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_display_reuse_hint(muse_module_h module)
+{
+ int ret = CAMERA_ERROR_NONE;
+ int get_hint = 0;
+ muse_camera_handle_s *muse_camera = NULL;
+ muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_REUSE_HINT;
+ muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
+
+ muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
+
+ ret = legacy_camera_get_display_reuse_hint(muse_camera->camera_handle, &get_hint);
+ if (ret == CAMERA_ERROR_NONE) {
+ LOGD("get hint : %d", get_hint);
+ muse_camera_msg_return1(api, class, ret, module, INT, get_hint);
+ } else {
+ muse_camera_msg_return(api, class, ret, module);
+ }
+
+ return MUSE_CAMERA_ERROR_NONE;
+}
int (*dispatcher[MUSE_CAMERA_API_MAX]) (muse_module_h module) = {
camera_dispatcher_create, /* MUSE_CAMERA_API_CREATE */
camera_dispatcher_attr_get_display_roi_area, /* MUSE_CAMERA_API_GET_DISPLAY_ROI_AREA */
camera_dispatcher_return_buffer, /* MUSE_CAMERA_API_RETURN_BUFFER, */
camera_dispatcher_preview_cb_return, /* MUSE_CAMERA_API_PREVIEW_CB_RETURN, */
+ camera_dispatcher_set_display_reuse_hint, /* MUSE_CAMERA_API_SET_DISPLAY_REUSE_HINT, */
+ camera_dispatcher_get_display_reuse_hint, /* MUSE_CAMERA_API_GET_DISPLAY_REUSE_HINT, */
};
-%bcond_with wayland
-%bcond_with x
-
Name: mmsvc-camera
Summary: A Camera module for muse server
-Version: 0.2.40
+Version: 0.2.41
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
BuildRequires: pkgconfig(mused)
BuildRequires: pkgconfig(mm-camcorder)
BuildRequires: pkgconfig(capi-base-common)
-%if %{with x}
-BuildRequires: pkgconfig(ecore-x)
-%endif
-%if %{with wayland}
BuildRequires: pkgconfig(ecore-wayland)
-%endif
BuildRequires: pkgconfig(libtbm)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(ecore)
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 %{with x}
- -DX11_SUPPORT=On
-%else
- -DX11_SUPPORT=Off
-%endif
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
make %{?jobs:-j%jobs}