AC_SUBST(GST_APP_CFLAGS)
AC_SUBST(GST_APP_LIBS)
+AC_ARG_ENABLE(wayland, AC_HELP_STRING([--enable-wayland], [enable wayland]),
+[
+ case "${enableval}" in
+ yes) WAYLAND_SUPPORT=yes ;;
+ no) WAYLAND_SUPPORT=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-wayland) ;;
+ esac
+],[WAYLAND_SUPPORT=no])
+if test "x$WAYLAND_SUPPORT" = "xyes"; then
+PKG_CHECK_MODULES(GST_WAYLAND, gstreamer-wayland-1.0 >= 1.2.0)
+AC_SUBST(GST_WAYLAND_CFLAGS)
+AC_SUBST(GST_WAYLAND_LIBS)
+fi
+AM_CONDITIONAL([WAYLAND_SUPPORT], [test "x$WAYLAND_SUPPORT" = "xyes"])
+
PKG_CHECK_MODULES(MM_COMMON, mm-common)
AC_SUBST(MM_COMMON_CFLAGS)
AC_SUBST(MM_COMMON_LIBS)
+%bcond_with wayland
+
Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.9.3
-Release: 1
+Version: 0.9.4
+Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(mmutil-imgp)
BuildRequires: pkgconfig(mm-log)
BuildRequires: pkgconfig(gstreamer-base-1.0)
+%if %{with wayland}
+BuildRequires: pkgconfig(gstreamer-wayland-1.0)
+BuildRequires: pkgconfig(wayland-client)
+%endif
BuildRequires: pkgconfig(sndfile)
BuildRequires: pkgconfig(camsrcjpegenc)
BuildRequires: pkgconfig(libpulse)
%build
+%if %{with wayland}
+export CFLAGS+=" -DHAVE_WAYLAND"
+%endif
./autogen.sh
-%configure --disable-static
+%configure \
+%if %{with wayland}
+ --enable-wayland \
+%endif
+ --disable-static
make %{?jobs:-j%jobs}
%install
libmmfcamcorder_la_CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections
libmmfcamcorder_la_LIBADD += $(SYSTEMINFO_LIBS)
+if WAYLAND_SUPPORT
+libmmfcamcorder_la_CFLAGS += $(GST_WAYLAND_CFLAGS)
+libmmfcamcorder_la_LIBADD += $(GST_WAYLAND_LIBS)
+endif
+
install-exec-hook:
mkdir -p $(DESTDIR)$(prefix)/share/sounds/mm-camcorder && \
cp $(srcdir)/../sounds/* $(DESTDIR)$(prefix)/share/sounds/mm-camcorder/
MMCamFaceInfo *face_info; /**< face information, this should be freed after use it. */
} MMCamFaceDetectInfo;
+#ifdef HAVE_WAYLAND
+/**
+ * Wayland information
+ */
+typedef struct _MMCamWaylandInfo {
+ void *evas_obj;
+ void *window;
+ void *surface;
+ void *display;
+ int window_x;
+ int window_y;
+ int window_width;
+ int window_height;
+} MMCamWaylandInfo;
+#endif /* HAVE_WAYLAND */
/*=======================================================================================
| TYPE DEFINITIONS |
#include <gst/video/colorbalance.h>
#include <gst/video/cameracontrol.h>
#include <gst/video/videooverlay.h>
+#ifdef HAVE_WAYLAND
+#include <gst/wayland/wayland.h>
+#endif
/*-----------------------------------------------------------------------
| MACRO DEFINITIONS: |
!strcmp(videosink_name, "evaspixmapsink")) {
_mmcam_dbg_log("Commit : Set evas object [%p]", p_handle);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst, "evas-object", p_handle);
+#ifdef HAVE_WAYLAND
+ } else if (!strcmp(videosink_name, "waylandsink")) {
+ MMCamWaylandInfo *wl_info = (MMCamWaylandInfo *)p_handle;
+ GstContext *context = NULL;
+
+ context = gst_wayland_display_handle_context_new((struct wl_display *)wl_info->display);
+ if (context) {
+ gst_element_set_context(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), context);
+ } else {
+ _mmcam_dbg_warn("gst_wayland_display_handle_context_new failed");
+ }
+
+ gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst), (guintptr)wl_info->surface);
+ gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(sc->element[_MMCAMCORDER_VIDEOSINK_SINK].gst),
+ wl_info->window_x,
+ wl_info->window_y,
+ wl_info->window_width,
+ wl_info->window_height);
+#endif /* HAVE_WAYLAND */
} else {
_mmcam_dbg_warn("Commit : Nothing to commit with this element[%s]", videosink_name);
return FALSE;
#include <gst/audio/audio-format.h>
#include <gst/video/videooverlay.h>
#include <gst/video/cameracontrol.h>
+#ifdef HAVE_WAYLAND
+#include <gst/wayland/wayland.h>
+#endif
+
#include <sys/time.h>
#include <unistd.h>
_mmcam_dbg_err("display handle(eavs object) is NULL");
return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
}
+#ifdef HAVE_WAYLAND
+ } else if (!strcmp(videosink_name, "waylandsink")) {
+ MMCamWaylandInfo *wl_info = (MMCamWaylandInfo *)overlay;
+ if (wl_info) {
+ GstContext *context = NULL;
+
+ context = gst_wayland_display_handle_context_new((struct wl_display *)wl_info->display);
+ if (context) {
+ gst_element_set_context(vsink, context);
+ } else {
+ _mmcam_dbg_warn("gst_wayland_display_handle_context_new failed");
+ }
+
+ gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), (guintptr)wl_info->surface);
+ gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(vsink),
+ wl_info->window_x,
+ wl_info->window_y,
+ wl_info->window_width,
+ wl_info->window_height);
+ } else {
+ _mmcam_dbg_warn("Handle is NULL. skip setting.");
+ }
+#endif /* HAVE_WAYLAND */
} else {
_mmcam_dbg_warn("Who are you?? (Videosink: %s)", videosink_name);
}