[Release version 0.10.52] Add featuring for murphy 88/71988/1
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 30 May 2016 06:13:18 +0000 (15:13 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 30 May 2016 06:13:18 +0000 (15:13 +0900)
Change-Id: Ib538daae8f426ff3f03bdbb296dfdaf483d11c1d
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
configure.ac
packaging/libmm-camcorder.spec
src/Makefile.am
src/include/mm_camcorder_internal.h
src/mm_camcorder_internal.c

index 47c88eb..4810d16 100644 (file)
@@ -58,13 +58,23 @@ PKG_CHECK_MODULES(MM_COMMON, mm-common)
 AC_SUBST(MM_COMMON_CFLAGS)
 AC_SUBST(MM_COMMON_LIBS)
 
+AC_ARG_ENABLE(murphy, AC_HELP_STRING([--enable-murphy], [enable murphy]),
+[
+  case "${enableval}" in
+    yes) MURPHY_SUPPORT=yes ;;
+    no)  MURPHY_SUPPORT=no ;;
+    *) AC_MSG_ERROR(bad value ${enableval} for --enable-murphy) ;;
+  esac
+],[MURPHY_SUPPORT=no])
+if test "x$MURPHY_SUPPORT" = "xyes"; then
 PKG_CHECK_MODULES(MURPHY_RESOURCE, murphy-resource)
 AC_SUBST(MURPHY_RESOURCE_CFLAGS)
 AC_SUBST(MURPHY_RESOURCE_LIBS)
-
 PKG_CHECK_MODULES(MURPHY_GLIB, murphy-glib)
 AC_SUBST(MURPHY_GLIB_CFLAGS)
 AC_SUBST(MURPHY_GLIB_LIBS)
+fi
+AM_CONDITIONAL([MURPHY_SUPPORT], [test "x$MURPHY_SUPPORT" = "xyes"])
 
 PKG_CHECK_MODULES(MM_SOUND, mm-sound)
 AC_SUBST(MM_SOUND_CFLAGS)
index 2b4a501..abd6e5c 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.51
+Version:    0.10.52
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
@@ -27,8 +27,10 @@ BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  pkgconfig(storage)
+%if "%{TIZEN_PRODUCT_TV}" != "1"
 BuildRequires:  pkgconfig(murphy-resource)
 BuildRequires:  pkgconfig(murphy-glib)
+%endif
 BuildRequires:  pkgconfig(ttrace)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(dpm)
@@ -61,6 +63,9 @@ export CFLAGS+=" -D_LARGEFILE64_SOURCE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\" -DTZ_
 %if %{with wayland}
        --enable-wayland \
 %endif
+%if "%{TIZEN_PRODUCT_TV}" != "1"
+       --enable-murphy \
+%endif
        --disable-static
 make %{?jobs:-j%jobs}
 
index c511c31..b894f82 100644 (file)
@@ -31,8 +31,7 @@ libmmfcamcorder_la_SOURCES = mm_camcorder.c \
                             mm_camcorder_configure.c \
                             mm_camcorder_util.c \
                             mm_camcorder_exifinfo.c \
-                            mm_camcorder_sound.c \
-                            mm_camcorder_resource.c
+                            mm_camcorder_sound.c
 
 libmmfcamcorder_la_CFLAGS = -I$(srcdir)/include \
                             $(GST_CFLAGS) \
@@ -47,8 +46,6 @@ libmmfcamcorder_la_CFLAGS = -I$(srcdir)/include \
                             $(MMUTIL_JPEG_CFLAGS) \
                             $(TBM_CFLAGS) \
                             $(STORAGE_CFLAGS) \
-                            $(MURPHY_RESOURCE_CFLAGS) \
-                            $(MURPHY_GLIB_CFLAGS) \
                             $(TTRACE_CFLAGS) \
                             $(DPM_CFLAGS) \
                             $(SYSTEMINFO_CFLAGS)
@@ -67,8 +64,6 @@ libmmfcamcorder_la_LIBADD = \
                            $(MMUTIL_IMGP_LIBS) \
                            $(MMUTIL_JPEG_LIBS) \
                            $(TBM_LIBS) \
-                           $(MURPHY_RESOURCE_LIBS) \
-                           $(MURPHY_GLIB_LIBS) \
                            $(TTRACE_LIBS) \
                            $(DPM_LIBS) \
                            $(STORAGE_LIBS)
@@ -83,6 +78,12 @@ libmmfcamcorder_la_CFLAGS += $(GST_WAYLAND_CFLAGS)
 libmmfcamcorder_la_LIBADD += $(GST_WAYLAND_LIBS)
 endif
 
+if MURPHY_SUPPORT
+libmmfcamcorder_la_SOURCES += mm_camcorder_resource.c
+libmmfcamcorder_la_CFLAGS += $(MURPHY_RESOURCE_CFLAGS) $(MURPHY_GLIB_CFLAGS) -D_MMCAMCORDER_MURPHY_SUPPORT
+libmmfcamcorder_la_LIBADD += $(MURPHY_RESOURCE_LIBS) $(MURPHY_GLIB_LIBS)
+endif
+
 install-exec-hook:
                                        mkdir -p $(DESTDIR)$(prefix)/share/sounds/mm-camcorder && \
                                        cp $(srcdir)/../sounds/* $(DESTDIR)$(prefix)/share/sounds/mm-camcorder/
index 292a909..bc1af5e 100644 (file)
 
 #include "mm_camcorder.h"
 #include "mm_debug.h"
+
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
 #include "mm_camcorder_resource.h"
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
 /* camcorder sub module */
 #include "mm_camcorder_attribute.h"
@@ -721,8 +724,10 @@ typedef struct mmf_camcorder {
        GCond task_thread_cond;                                 /**< cond for task thread */
        _MMCamcorderTaskThreadState task_thread_state;          /**< state of task thread */
 
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        /* resource manager for H/W resources */
        MMCamcorderResourceManager resource_manager;
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
        /* gdbus */
        GDBusConnection *gdbus_conn;                            /**< gdbus connection */
index d4f3b38..bab89d2 100644 (file)
@@ -42,7 +42,9 @@
 #include <mm_session.h>
 #include <mm_session_private.h>
 
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
 #include <murphy/common/glib-glue.h>
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
 
 /*---------------------------------------------------------------------------------------
@@ -430,6 +432,7 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
                }
        }
 
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        /* initialize resource manager */
        ret = _mmcamcorder_resource_manager_init(&hcamcorder->resource_manager, (void *)hcamcorder);
        if (ret != MM_ERROR_NONE) {
@@ -437,6 +440,7 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
                ret = MM_ERROR_CAMCORDER_INTERNAL;
                goto _ERR_DEFAULT_VALUE_INIT;
        }
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
        traceBegin(TTRACE_TAG_CAMERA, "MMCAMCORDER:CREATE:INIT_GSTREAMER");
 
@@ -506,8 +510,10 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
        return MM_ERROR_NONE;
 
 _ERR_DEFAULT_VALUE_INIT:
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        /* de-initialize resource manager */
        _mmcamcorder_resource_manager_deinit(&hcamcorder->resource_manager);
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
        /* unregister sound focus */
        if (hcamcorder->sound_focus_register && hcamcorder->sound_focus_id > 0) {
@@ -654,11 +660,13 @@ int _mmcamcorder_destroy(MMHandleType handle)
                hcamcorder->sub_context = NULL;
        }
 
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        /* de-initialize resource manager */
        ret = _mmcamcorder_resource_manager_deinit(&hcamcorder->resource_manager);
        if (ret != MM_ERROR_NONE) {
                _mmcam_dbg_err("failed to de-initialize resource manager 0x%x", ret);
        }
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
        /* Remove idle function which is not called yet */
        if (hcamcorder->setting_event_id) {
@@ -789,7 +797,6 @@ int _mmcamcorder_realize(MMHandleType handle)
 {
        int ret = MM_ERROR_NONE;
        int ret_sound = MM_ERROR_NONE;
-       int ret_resource = MM_ERROR_NONE;
        int state = MM_CAMCORDER_STATE_NONE;
        int state_FROM = MM_CAMCORDER_STATE_NULL;
        int state_TO = MM_CAMCORDER_STATE_READY;
@@ -999,7 +1006,7 @@ int _mmcamcorder_realize(MMHandleType handle)
                } else {
                        _mmcam_dbg_warn("NULL dpm_policy");
                }
-
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
                /* prepare resource manager for camera */
                ret = _mmcamcorder_resource_manager_prepare(&hcamcorder->resource_manager, MM_CAMCORDER_RESOURCE_TYPE_CAMERA);
                if (ret != MM_ERROR_NONE) {
@@ -1028,6 +1035,7 @@ int _mmcamcorder_realize(MMHandleType handle)
                        _mmcamcorder_resource_manager_unprepare(&hcamcorder->resource_manager);
                        goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                }
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
        }
 
        /* create pipeline */
@@ -1066,9 +1074,10 @@ int _mmcamcorder_realize(MMHandleType handle)
        return MM_ERROR_NONE;
 
 _ERR_CAMCORDER_CMD:
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        /* release hw resources */
        if (hcamcorder->type == MM_CAMCORDER_MODE_VIDEO_CAPTURE) {
-               ret_resource = _mmcamcorder_resource_manager_release(&hcamcorder->resource_manager);
+               int ret_resource = _mmcamcorder_resource_manager_release(&hcamcorder->resource_manager);
                if (ret_resource == MM_ERROR_RESOURCE_INVALID_STATE) {
                        _mmcam_dbg_warn("it could be in the middle of resource callback or there's no acquired resource");
                }
@@ -1080,6 +1089,7 @@ _ERR_CAMCORDER_CMD:
                        _mmcam_dbg_err("failed to unprepare resource manager, ret_resource(0x%x)", ret_resource);
                }
        }
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
 _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK:
        _MMCAMCORDER_UNLOCK_CMD(hcamcorder);
@@ -1153,6 +1163,7 @@ int _mmcamcorder_unrealize(MMHandleType handle)
                hcamcorder->sub_context = NULL;
        }
 
+#ifdef _MMCAMCORDER_MURPHY_SUPPORT
        if (hcamcorder->type == MM_CAMCORDER_MODE_VIDEO_CAPTURE) {
                /* release resource */
                ret = _mmcamcorder_resource_manager_release(&hcamcorder->resource_manager);
@@ -1169,6 +1180,7 @@ int _mmcamcorder_unrealize(MMHandleType handle)
                        _mmcam_dbg_err("failed to unprepare resource manager, ret(0x%x)", ret);
                }
        }
+#endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
        /* Deinitialize main context member */
        hcamcorder->command = NULL;