AC_SUBST(GST_PLUGIN_BASE_CFLAGS)
AC_SUBST(GST_PLUGIN_BASE_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(GST_VIDEO, gstreamer-video-1.0 >= 1.2.0)
AC_SUBST(GST_VIDEO_CFLAGS)
AC_SUBST(GST_VIDEO_LIBS)
+%bcond_with wayland
+%bcond_with x
+
Name: libmm-player
Summary: Multimedia Framework Player Library
Version: 0.5.56
-Release: 1
+Release: 2
Group: Multimedia/Libraries
License: Apache-2.0
URL: http://source.tizen.org
BuildRequires: pkgconfig(mm-sound)
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
+%if %{with wayland}
+BuildRequires: pkgconfig(gstreamer-wayland-1.0)
+%endif
BuildRequires: pkgconfig(gstreamer-video-1.0)
BuildRequires: pkgconfig(gstreamer-app-1.0)
BuildRequires: pkgconfig(appcore-efl)
cp %{SOURCE1001} .
%build
-CFLAGS+=" -Wall -D_FILE_OFFSET_BITS=64 -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS
+%if %{with x}
+CFLAGS+=" -Wall -D_FILE_OFFSET_BITS=64 -DHAVE_X11 -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS
+%endif
+%if %{with wayland}
+CFLAGS+=" -Wall -D_FILE_OFFSET_BITS=64 -DHAVE_WAYLAND -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS
+%endif
LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"; export LDFLAGS
./autogen.sh
# always enable sdk build. This option should go away
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS ./configure --enable-sdk --prefix=%{_prefix} --disable-static
-%configure --disable-static
+%configure \
+%if %{with x}
+--disable-static
+%endif
+%if %{with wayland}
+--disable-static \
+--enable-wayland
+%endif
#%__make -j1
make %{?jobs:-j%jobs}
if IS_SDK
libmmfplayer_la_CFLAGS += -DIS_SDK
endif
+
+if WAYLAND_SUPPORT
+libmmfplayer_la_CFLAGS += $(GST_WAYLAND_CFLAGS)
+libmmfplayer_la_LIBADD += $(GST_WAYLAND_LIBS)
+endif
0,
0
},
+#ifdef HAVE_WAYLAND
+ {
+ "wl_display",
+ MM_ATTRS_TYPE_DATA,
+ MM_ATTRS_FLAG_RW,
+ (void *) NULL,
+ MM_ATTRS_VALID_TYPE_NONE,
+ 0,
+ 0
+ },
+ {
+ "wl_window_render_x",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "wl_window_render_y",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "wl_window_render_width",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+ {
+ "wl_window_render_height",
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ (void *) 0,
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ 0,
+ MMPLAYER_MAX_INT
+ },
+#endif
{
"display_overlay_user_data",
MM_ATTRS_TYPE_DATA,
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
#include <gst/video/videooverlay.h>
+#ifdef HAVE_WAYLAND
+#include <gst/wayland/wayland.h>
+#endif
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
case MM_DISPLAY_SURFACE_X:
{
/* ximagesink or xvimagesink */
- void *xid = NULL;
+ void *surface = NULL;
double zoom = 0;
int display_method = 0;
int roi_x = 0;
int force_aspect_ratio = 0;
gboolean visible = TRUE;
+#ifdef HAVE_WAYLAND
+ /*set wl_display*/
+ void* wl_display = NULL;
+ GstContext *context = NULL;
+ int wl_window_x = 0;
+ int wl_window_y = 0;
+ int wl_window_width = 0;
+ int wl_window_height = 0;
+
+ mm_attrs_get_data_by_name(attrs, "wl_display", &wl_display);
+ if (wl_display)
+ context = gst_wayland_display_handle_context_new(wl_display);
+ if (context)
+ gst_element_set_context(GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), context);
+
+ /*It should be set after setting window*/
+ mm_attrs_get_int_by_name(attrs, "wl_window_render_x", &wl_window_x);
+ mm_attrs_get_int_by_name(attrs, "wl_window_render_y", &wl_window_y);
+ mm_attrs_get_int_by_name(attrs, "wl_window_render_width", &wl_window_width);
+ mm_attrs_get_int_by_name(attrs, "wl_window_render_height", &wl_window_height);
+#endif
/* common case if using x surface */
- mm_attrs_get_data_by_name(attrs, "display_overlay", &xid);
- if ( xid )
+ mm_attrs_get_data_by_name(attrs, "display_overlay", &surface);
+ if ( surface )
{
+#ifdef HAVE_WAYLAND
+ int wl_surface = 0;
+ wl_surface = (int*)surface;
+ debug_log("set video param : xid %p", (int*)surface);
+ if (wl_surface)
+ {
+ gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), (int*)surface );
+ /* After setting window handle, set render rectangle */
+ gst_video_overlay_set_render_rectangle(
+ GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
+ wl_window_x,wl_window_y,wl_window_width,wl_window_height);
+ }
+#else // HAVE_X11
int xwin_id = 0;
- xwin_id = *(int*)xid;
- debug_log("set video param : xid %d", *(int*)xid);
+ xwin_id = *(int*)surface;
+ debug_log("set video param : xid %p", *(int*)surface);
if (xwin_id)
{
- gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), *(int*)xid );
+ gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), *(int*)surface );
}
+#endif
}
else
{