Skip to content

Commit

Permalink
drop gstreamer 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
recursive-rat4 authored and matiasdelellis committed Jun 25, 2013
1 parent e060f3a commit b3bd5bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 61 deletions.
41 changes: 6 additions & 35 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,6 @@ AC_ARG_WITH([gtk3],
[CFLAGS="$CFLAGS -Wno-deprecated-declarations"],
[with_gtk3=no])

dnl gstreamer version
AC_ARG_WITH([gstreamer],
[AS_HELP_STRING([--with-gstreamer=0.10|1.0],[which gstreamer version to compile against (default: 0.10)])],
[case "$with_gstreamer" in
0.10|1.0) ;;
*) AC_MSG_ERROR([invalid gstreamer version specified]) ;;
esac],
[with_gstreamer=0.10]
)

case "$with_gstreamer" in
0.10) GSTREAMER_API_VERSION=0.10
GSTREAMER_REQUIRED=0.10
;;
1.0) GSTREAMER_API_VERSION=1.0
GSTREAMER_REQUIRED=0.11.90
;;
esac
AC_DEFINE_UNQUOTED(GSTREAMER_API_VERSION, $GSTREAMER_API_VERSION, [Define the GStreamer+ API version])

AC_SUBST(CFLAGS)

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Expand All @@ -78,9 +58,11 @@ LT_INIT([disable-static])
dnl Check for i18n support
XDT_I18N([cs de es el fr hu it ja nl no pl pt pt_BR ru sv tr uk zh_CN])

GSTREAMER_REQUIRED=0.11.90

dnl Check for required packages
XDT_CHECK_PACKAGE([GSTREAMER], [gstreamer-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED])
XDT_CHECK_PACKAGE([GSTREAMER_BASE], [gstreamer-base-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED])
XDT_CHECK_PACKAGE([GSTREAMER], [gstreamer-1.0], [$GSTREAMER_REQUIRED])
XDT_CHECK_PACKAGE([GSTREAMER_BASE], [gstreamer-base-1.0], [$GSTREAMER_REQUIRED])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.28])
AS_IF([test "x$with_gtk3" != xno],
[XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.0.0])],
Expand All @@ -105,19 +87,10 @@ XDT_CHECK_OPTIONAL_PACKAGE([TAGLIB_1_7],
[taglib],
[taglib library to APE], [yes])

dnl Check gstreamer-interfaces
dnl need for gstreamer 0.10
GSTREAMER_INTERFACES_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([GSTREAMER_INTERFACES],
[gstreamer-interfaces-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED],
[gstreamer-interfaces],
[gstreamer-interfaces], [yes])

dnl Check gstreamer-audio
dnl need for gstreamer 1.0
GSTREAMER_AUDIO_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([GSTREAMER_AUDIO],
[gstreamer-audio-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED],
[gstreamer-audio-1.0], [$GSTREAMER_REQUIRED],
[gstreamer-audio],
[gstreamer-audio], [yes])

Expand Down Expand Up @@ -175,9 +148,7 @@ echo " Gtk version used...: $GTK_VERSION"
echo " Prefix.............: ${prefix}"
echo " Debug enabled......: $debug"
echo ""
AS_IF([test $GSTREAMER_API_VERSION = 1.0],
[echo " Cubic volume support.....................(Need gstreamer-plugins-base).: $GSTREAMER_AUDIO_FOUND"],
[echo " Cubic volume support.....................(Need gstreamer-plugins-base).: $GSTREAMER_INTERFACES_FOUND"])
echo " Cubic volume support.....................(Need gstreamer-plugins-base).: $GSTREAMER_AUDIO_FOUND"
AS_IF([test "x$with_gtk3" != xno],
[echo " Use multimedia key without gnome-media-keys.......(Need keybinder-3.0).: $LIBKEYBINDER_FOUND"],
[echo " Use multimedia key without gnome-media-keys..(Need keybinder >= 0.2.0).: $LIBKEYBINDER_FOUND"])
Expand Down
7 changes: 0 additions & 7 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@ pragha_LDADD = $(GSTREAMER_LIBS) \
$(LIBCDIO_PARANOIA_LIBS) \
$(LIBCDDB_LIBS)

## for gstreamer 0.10
if HAVE_GSTREAMER_INTERFACES
pragha_CFLAGS += $(GSTREAMER_INTERFACES_CFLAGS)
pragha_LDADD += $(GSTREAMER_INTERFACES_LIBS)
endif

## for gstreamer 1.0
if HAVE_GSTREAMER_AUDIO
pragha_CFLAGS += $(GSTREAMER_AUDIO_CFLAGS)
pragha_LDADD += $(GSTREAMER_AUDIO_LIBS)
Expand Down
22 changes: 3 additions & 19 deletions src/pragha-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@

#include <stdlib.h>

#if HAVE_GSTREAMER_AUDIO || HAVE_GSTREAMER_INTERFACES
#if GST_CHECK_VERSION (1, 0, 0)
#if HAVE_GSTREAMER_AUDIO
#include <gst/audio/streamvolume.h>
#else
#include <gst/interfaces/streamvolume.h>
#endif //GST_CHECK_VERSION
#define convert_volume(from, to, val) gst_stream_volume_convert_volume((from), (to), (val))
#define VOLUME_FORMAT_LINEAR GST_STREAM_VOLUME_FORMAT_LINEAR
#define VOLUME_FORMAT_CUBIC GST_STREAM_VOLUME_FORMAT_CUBIC
Expand Down Expand Up @@ -142,11 +138,7 @@ pragha_backend_get_current_length (PraghaBackend *backend)
gboolean result;
GstFormat format = GST_FORMAT_TIME;

#if GST_CHECK_VERSION (1, 0, 0)
result = gst_element_query_duration(priv->pipeline, format, &song_length);
#else
result = gst_element_query_duration(priv->pipeline, &format, &song_length);
#endif

if (!result || format != GST_FORMAT_TIME)
return GST_CLOCK_TIME_NONE;
Expand All @@ -162,11 +154,7 @@ pragha_backend_get_current_position (PraghaBackend *backend)
gboolean result;
GstFormat format = GST_FORMAT_TIME;

#if GST_CHECK_VERSION (1, 0, 0)
result = gst_element_query_position(priv->pipeline, format, &song_position);
#else
result = gst_element_query_position(priv->pipeline, &format, &song_position);
#endif

if (!result || format != GST_FORMAT_TIME)
return GST_CLOCK_TIME_NONE;
Expand Down Expand Up @@ -242,7 +230,7 @@ pragha_backend_get_volume (PraghaBackend *backend)

g_object_get (priv->pipeline, "volume", &volume, NULL);

#if HAVE_GSTREAMER_AUDIO || HAVE_GSTREAMER_INTERFACES
#if HAVE_GSTREAMER_AUDIO
volume = convert_volume (VOLUME_FORMAT_LINEAR, VOLUME_FORMAT_CUBIC, volume);
#endif

Expand Down Expand Up @@ -272,7 +260,7 @@ pragha_backend_set_volume (PraghaBackend *backend, gdouble volume)

volume = CLAMP (volume, 0.0, 1.0);

#if HAVE_GSTREAMER_AUDIO || HAVE_GSTREAMER_INTERFACES
#if HAVE_GSTREAMER_AUDIO
volume = convert_volume (VOLUME_FORMAT_CUBIC, VOLUME_FORMAT_LINEAR, volume);
#endif

Expand Down Expand Up @@ -954,11 +942,7 @@ pragha_backend_init (PraghaBackend *backend)
priv->error = NULL;
priv->preferences = pragha_preferences_get ();

#if GST_CHECK_VERSION (1, 0, 0)
priv->pipeline = gst_element_factory_make("playbin", "playbin");
#else
priv->pipeline = gst_element_factory_make("playbin2", "playbin");
#endif

if (priv->pipeline == NULL) {
g_critical ("Failed to create playbin element. Please check your GStreamer installation.");
Expand Down

0 comments on commit b3bd5bc

Please sign in to comment.