From d1cc150bfea709ed875cd03d15d169f922c24178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 11 Mar 2016 02:18:15 +0100 Subject: Use GST_CHECK_VERSION instead of extra definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 68a765485d7562dd85f3448996f454a3afe6915e) --- config.h.in | 3 --- kaffeine/configure.in.in | 1 - kaffeine/src/player-parts/gstreamer-part/gstreamer_part.cpp | 5 ++--- kaffeine/src/player-parts/gstreamer-part/timer.cpp | 4 ++-- kaffeine/src/player-parts/gstreamer-part/video.cpp | 9 +++++---- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/config.h.in b/config.h.in index 1afeb9a..88dc36a 100644 --- a/config.h.in +++ b/config.h.in @@ -24,9 +24,6 @@ /* DVB headers installed */ #undef HAVE_DVB -/* Defined if GStreamer is 1.x */ -#undef HAVE_GSTREAMER_1 - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff --git a/kaffeine/configure.in.in b/kaffeine/configure.in.in index fab9603..001ba9a 100644 --- a/kaffeine/configure.in.in +++ b/kaffeine/configure.in.in @@ -205,7 +205,6 @@ if test "$with_gstreamer" != "no" ; then CFLAGS_GSTREAMER=`"$PKG_CONFIG" --cflags gstreamer-1.0 gstreamer-plugins-base-1.0` LIB_GSTREAMER=`"$PKG_CONFIG" --libs gstreamer-1.0 gstreamer-plugins-base-1.0` LIB_GSTOVERLAY='-lgstvideo-1.0' - AC_DEFINE(HAVE_GSTREAMER_1, 1, [Defined if GStreamer is 1.x]) AC_MSG_RESULT([yes]) else if "$PKG_CONFIG" --exists "gstreamer-0.10 gstreamer-plugins-base-0.10"; then diff --git a/kaffeine/src/player-parts/gstreamer-part/gstreamer_part.cpp b/kaffeine/src/player-parts/gstreamer-part/gstreamer_part.cpp index f9ed207..28ecfbf 100644 --- a/kaffeine/src/player-parts/gstreamer-part/gstreamer_part.cpp +++ b/kaffeine/src/player-parts/gstreamer-part/gstreamer_part.cpp @@ -38,7 +38,6 @@ #include #include -#include "config.h" #include "gstreamer_part.h" #include "gstreamer_part.moc" #include "playlistimport.h" @@ -766,7 +765,7 @@ bool GStreamerPart::initGStreamer() /* check for visualization plugins */ GList* factories = gst_registry_get_feature_list( -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) gst_registry_get (), #else gst_registry_get_default (), @@ -774,7 +773,7 @@ bool GStreamerPart::initGStreamer() GST_TYPE_ELEMENT_FACTORY); TQString name, cat; while ( factories ) { -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) name = GST_OBJECT_NAME(factories->data); #else name = GST_PLUGIN_FEATURE_NAME(factories->data); diff --git a/kaffeine/src/player-parts/gstreamer-part/timer.cpp b/kaffeine/src/player-parts/gstreamer-part/timer.cpp index 7ef268d..2399641 100644 --- a/kaffeine/src/player-parts/gstreamer-part/timer.cpp +++ b/kaffeine/src/player-parts/gstreamer-part/timer.cpp @@ -133,7 +133,7 @@ void Timer::slotUpdate() return; if ( gst_element_query_duration( m_play, -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) fmt, #else &fmt, @@ -144,7 +144,7 @@ void Timer::slotUpdate() } if ( !gst_element_query_position( m_play, -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) fmt, #else &fmt, diff --git a/kaffeine/src/player-parts/gstreamer-part/video.cpp b/kaffeine/src/player-parts/gstreamer-part/video.cpp index dee1d14..1cb28a4 100644 --- a/kaffeine/src/player-parts/gstreamer-part/video.cpp +++ b/kaffeine/src/player-parts/gstreamer-part/video.cpp @@ -34,7 +34,8 @@ #include #include -#ifdef HAVE_GSTREAMER_1 +#include +#if GST_CHECK_VERSION(1,0,0) #include #else #include @@ -71,7 +72,7 @@ void VideoWindow::setPlaybin( GstElement *play ) VideoWindow::~VideoWindow() { -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) if ( m_element && GST_IS_VIDEO_OVERLAY(m_element) ) { gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY(m_element), 0 ); } @@ -90,7 +91,7 @@ VideoWindow::~VideoWindow() void VideoWindow::refresh() { /* expose overlay */ -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) if ( m_element && GST_IS_VIDEO_OVERLAY(m_element) ) { gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY (m_element), winId() ); gst_video_overlay_expose( GST_VIDEO_OVERLAY (m_element) ); @@ -183,7 +184,7 @@ void VideoWindow::newState() GstCaps *caps; g_object_get( info, "object", &pad, NULL ); if ( -#ifdef HAVE_GSTREAMER_1 +#if GST_CHECK_VERSION(1,0,0) (caps=gst_pad_get_current_caps(pad)) #else (caps=gst_pad_get_negotiated_caps(pad)) -- cgit v1.2.1