From: Gwenole Beauchesne Date: Fri, 20 Jul 2012 09:16:27 +0000 (+0200) Subject: vaapisink: drop checks for new APIs used by default. X-Git-Tag: accepted/trunk/20120822.173359~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcae632c32dc97e5169689a37afde67994dfa4a3;p=profile%2Fivi%2Fgstreamer-vaapi.git vaapisink: drop checks for new APIs used by default. GStreamer -base plugins >= 0.10.31 are now required, so the checks for new APIs like GstXOverlay::set_window_handle() and ::set_render_rectangle() are no longer necessary. --- diff --git a/configure.ac b/configure.ac index b6074ba..09c0185 100644 --- a/configure.ac +++ b/configure.ac @@ -163,15 +163,6 @@ PKG_CHECK_MODULES([GST_PLUGINS_BASE], PKG_CHECK_MODULES([GST_INTERFACES], [gstreamer-interfaces-$GST_MAJORMINOR >= gst_plugins_base_version]) -dnl ... GST_PLUGINS_BASE_CHECK_VERSION() implementation -V=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR` -GST_PLUGINS_BASE_MAJOR_VERSION=`echo "$V" | cut -d'.' -f1` -GST_PLUGINS_BASE_MINOR_VERSION=`echo "$V" | cut -d'.' -f2` -GST_PLUGINS_BASE_MICRO_VERSION=`echo "$V" | cut -d'.' -f3` -AC_SUBST(GST_PLUGINS_BASE_MAJOR_VERSION) -AC_SUBST(GST_PLUGINS_BASE_MINOR_VERSION) -AC_SUBST(GST_PLUGINS_BASE_MICRO_VERSION) - dnl ... GstVideoOverlayComposition (gstreamer-video) PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-$GST_MAJORMINOR >= gst_plugins_base_version]) @@ -452,7 +443,6 @@ debian.upstream/libgstvaapi-x11.install.in gst-libs/Makefile gst-libs/gst/Makefile gst-libs/gst/codecparsers/Makefile - gst-libs/gst/gstutils_version.h gst-libs/gst/vaapi/Makefile gst/Makefile gst/vaapi/Makefile diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am index 68753be..06d14db 100644 --- a/gst-libs/gst/Makefile.am +++ b/gst-libs/gst/Makefile.am @@ -1,8 +1,4 @@ SUBDIRS = codecparsers vaapi -gen_headers = gstutils_version.h -noinst_HEADERS = $(gen_headers) -EXTRA_DIST = gstutils_version.h.in - # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = Makefile.in $(gen_headers) diff --git a/gst-libs/gst/gstutils_version.h.in b/gst-libs/gst/gstutils_version.h.in deleted file mode 100644 index cc177b7..0000000 --- a/gst-libs/gst/gstutils_version.h.in +++ /dev/null @@ -1,61 +0,0 @@ -/* - * gstutils_version.h - GStreamer version utilities - * - * Copyright (C) 2011 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - */ - -#ifndef GST_UTILS_VERSION_H -#define GST_UTILS_VERSION_H - -/* gst-plugins-base version */ -#define GST_PLUGINS_BASE_MAJOR_VERSION @GST_PLUGINS_BASE_MAJOR_VERSION@ -#define GST_PLUGINS_BASE_MINOR_VERSION @GST_PLUGINS_BASE_MINOR_VERSION@ -#define GST_PLUGINS_BASE_MICRO_VERSION @GST_PLUGINS_BASE_MICRO_VERSION@ - -/** - * GST_UTILS_CHECK_VERSION: - * @major: major version, like 1 in 1.2.3 - * @minor: minor version, like 2 in 1.2.3 - * @micro: micro version, like 3 in 1.2.3 - * - * Evaluates to %TRUE if the version of gst-plugins-base is equal or - * greater than @major, @minor and @micro - */ -#define GST_UTILS_CHECK_VERSION(major,minor,micro, rmajor,rminor,rmicro) \ - ((rmajor) > (major) || \ - ((rmajor) == (major) && (rminor) > (minor)) || \ - ((rmajor) == (major) && (rminor) == (minor) && (rmicro) >= (micro))) - -/** - * GST_PLUGINS_BASE_CHECK_VERSION: - * @major: major version, like 1 in 1.2.3 - * @minor: minor version, like 2 in 1.2.3 - * @micro: micro version, like 3 in 1.2.3 - * - * Evaluates to %TRUE if the version of gst-plugins-base is greater - * than @major, @minor and @micro - */ -#ifndef GST_PLUGINS_BASE_CHECK_VERSION -#define GST_PLUGINS_BASE_CHECK_VERSION(major,minor,micro) \ - GST_UTILS_CHECK_VERSION(major,minor,micro, \ - GST_PLUGINS_BASE_MAJOR_VERSION, \ - GST_PLUGINS_BASE_MINOR_VERSION, \ - GST_PLUGINS_BASE_MICRO_VERSION) -#endif - -#endif /* GST_UTILS_VERSION_H */ diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index b3c8e04..2165038 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -31,7 +31,6 @@ #include "config.h" #include -#include #include #include #include @@ -49,12 +48,6 @@ #include "gstvaapisink.h" #include "gstvaapipluginutil.h" -#define HAVE_GST_XOVERLAY_SET_WINDOW_HANDLE \ - GST_PLUGINS_BASE_CHECK_VERSION(0,10,31) - -#define HAVE_GST_XOVERLAY_SET_RENDER_RECTANGLE \ - GST_PLUGINS_BASE_CHECK_VERSION(0,10,29) - #define GST_PLUGIN_NAME "vaapisink" #define GST_PLUGIN_DESC "A VA-API based videosink" @@ -148,8 +141,8 @@ gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id); static GstFlowReturn gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer); -static inline void -_gst_vaapisink_xoverlay_set_xid(GstXOverlay *overlay, guintptr window_id) +static void +gst_vaapisink_xoverlay_set_window_handle(GstXOverlay *overlay, guintptr window) { GstVaapiSink * const sink = GST_VAAPISINK(overlay); @@ -158,24 +151,9 @@ _gst_vaapisink_xoverlay_set_xid(GstXOverlay *overlay, guintptr window_id) sink->use_glx = FALSE; sink->foreign_window = TRUE; - gst_vaapisink_ensure_window_xid(sink, window_id); -} - -#if HAVE_GST_XOVERLAY_SET_WINDOW_HANDLE -static void -gst_vaapisink_xoverlay_set_window_handle(GstXOverlay *overlay, guintptr window_id) -{ - _gst_vaapisink_xoverlay_set_xid(overlay, window_id); + gst_vaapisink_ensure_window_xid(sink, window); } -#else -static void -gst_vaapisink_xoverlay_set_xid(GstXOverlay *overlay, XID xid) -{ - _gst_vaapisink_xoverlay_set_xid(overlay, xid); -} -#endif -#if HAVE_GST_XOVERLAY_SET_RENDER_RECTANGLE static void gst_vaapisink_xoverlay_set_render_rectangle( GstXOverlay *overlay, @@ -197,7 +175,6 @@ gst_vaapisink_xoverlay_set_render_rectangle( display_rect->x, display_rect->y, display_rect->width, display_rect->height); } -#endif static void gst_vaapisink_xoverlay_expose(GstXOverlay *overlay) @@ -215,14 +192,8 @@ gst_vaapisink_xoverlay_expose(GstXOverlay *overlay) static void gst_vaapisink_xoverlay_iface_init(GstXOverlayClass *iface) { -#if HAVE_GST_XOVERLAY_SET_WINDOW_HANDLE iface->set_window_handle = gst_vaapisink_xoverlay_set_window_handle; -#else - iface->set_xwindow_id = gst_vaapisink_xoverlay_set_xid; -#endif -#if HAVE_GST_XOVERLAY_SET_RENDER_RECTANGLE iface->set_render_rectangle = gst_vaapisink_xoverlay_set_render_rectangle; -#endif iface->expose = gst_vaapisink_xoverlay_expose; }