optional use of gstreamer0.10, patch based on the work

done by Saleem Abdulrasool and Tim-Philipp Mller (Fixes: #326257)
This commit is contained in:
Sebastien Bacher 2006-01-15 21:56:50 +00:00
parent 90c31372c9
commit 95ceaa7ea5
5 changed files with 106 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2006-01-15 Sebastien Bacher <seb128@debian.org>
* configure.in: optional use of gstreamer0.10, patch based on the work
done by Saleem Abdulrasool and Tim-Philipp Müller (Fixes: #326257)
2006-01-14 Chao-Hsiung Liao <j_h_liau@yahoo.com.tw> 2006-01-14 Chao-Hsiung Liao <j_h_liau@yahoo.com.tw>
* configure.in: Add "zh_HK" to ALL_LINGUAS. * configure.in: Add "zh_HK" to ALL_LINGUAS.

View file

@ -462,25 +462,49 @@ AC_SUBST(ALSA_CFLAGS)
dnl ============================================== dnl ==============================================
dnl GStreamer section dnl GStreamer section
dnl ============================================== dnl ==============================================
GST_MAJORMINOR=auto
AC_ARG_ENABLE(gstreamer, AC_ARG_ENABLE(gstreamer,
AC_HELP_STRING([--enable-gstreamer],[use gstreamer, if available]), AC_HELP_STRING([--enable-gstreamer],[use gstreamer, if available (and optionally specify a version)]),
[case "${enableval}" in [case "${enableval}" in
yes) ENABLE_GSTREAMER=yes ;; yes) ENABLE_GSTREAMER=yes ;;
0.8) ENABLE_GSTREAMER=yes && GST_MAJORMINOR=0.8 ;;
0.10) ENABLE_GSTREAMER=yes && GST_MAJORMINOR=0.10 ;;
no) ENABLE_GSTREAMER=no ;; no) ENABLE_GSTREAMER=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gstreamer) ;; *) AC_MSG_ERROR([
*** Bad value ${enableval} for --enable-gstreamer
*** Please use one of the following:
*** --enable-gstreamer=0.8
*** --enable-gstreamer=0.10
]) ;;
esac], esac],
[ENABLE_GSTREAMER=yes]) dnl Default value [ENABLE_GSTREAMER=yes]) dnl Default value
if test "x$ENABLE_GSTREAMER" = "xyes"; then if test "x$ENABLE_GSTREAMER" = "xyes"; then
have_gstreamer=no have_gstreamer=no
PKG_CHECK_MODULES(GST, gstreamer-interfaces-0.8 >= 0.8.0, if test x$GST_MAJORMINOR = xauto ; then
have_gstreamer=yes, PKG_CHECK_MODULES(GST, gstreamer-0.8,[GST_MAJORMINOR=0.8],[GST_MAJORMINOR=0.10])
AC_MSG_RESULT(*** All of GStreamer dependent parts will be disabled ***)) fi
if test x$GST_MAJORMINOR = x0.8 ; then
GST_REQS=0.8.0
PKGS="gstreamer-0.8 >= $GST_REQS gstreamer-interfaces-0.8 >= $GST_REQS"
else
GST_REQS=0.10.2
PKGS="gstreamer-0.10 >= $GST_REQS gstreamer-plugins-base-0.10 >= $GST_REQS"
fi
PKG_CHECK_MODULES(GST, $PKGS, have_gstreamer=yes,
AC_MSG_RESULT([*** All of GStreamer dependent parts will be disabled ***]))
if test x$GST_MAJORMINOR = x0.10 ; then
GST_LIBS="$GST_LIBS -lgstinterfaces-0.10 -lgstaudio-0.10"
fi
else else
have_gstreamer=disabled have_gstreamer=disabled
AC_MSG_RESULT(*** GStreamer has been explicitly disabled ***) AC_MSG_RESULT(*** GStreamer has been explicitly disabled ***)
fi fi
AM_CONDITIONAL(HAVE_GSTREAMER, test x"$have_gstreamer" = "xyes") AM_CONDITIONAL(HAVE_GSTREAMER, test x"$have_gstreamer" = "xyes")
AM_CONDITIONAL(HAVE_GST10, test x"$GST_MAJORMINOR" = "x0.10")
AC_SUBST(GST_LIBS) AC_SUBST(GST_LIBS)
AC_SUBST(GST_CFLAGS) AC_SUBST(GST_CFLAGS)

View file

@ -1,3 +1,11 @@
2006-01-15 Sebastien Bacher <seb128@debian.org>
* actions/Makefile.am:
* actions/acme-volume-gstreamer.c: (_acme_set_mixer),
(acme_volume_gstreamer_open):
optional use of gstreamer0.10, patch based on the work
done by Saleem Abdulrasool and Tim-Philipp Müller (Fixes: #326257)
2006-01-14 Rodney Dawes <dobey@novell.com> 2006-01-14 Rodney Dawes <dobey@novell.com>
* gnome-settings-xsettings.c (xsettings_callback): * gnome-settings-xsettings.c (xsettings_callback):

View file

@ -9,6 +9,9 @@ libacme_la_SOURCES = \
libacme_la_LIBADD = libacme_la_LIBADD =
if HAVE_GSTREAMER if HAVE_GSTREAMER
if HAVE_GST10
INCLUDES += -DHAVE_GST10
endif
INCLUDES += -DHAVE_GSTREAMER INCLUDES += -DHAVE_GSTREAMER
libacme_la_SOURCES += acme-volume-gstreamer.c acme-volume-gstreamer.h libacme_la_SOURCES += acme-volume-gstreamer.c acme-volume-gstreamer.h
libacme_la_LIBADD += $(GST_LIBS) libacme_la_LIBADD += $(GST_LIBS)

View file

@ -27,9 +27,15 @@
#include "config.h" #include "config.h"
#include "acme-volume-gstreamer.h" #include "acme-volume-gstreamer.h"
#ifdef HAVE_GST10
#include <gst/gst.h>
#include <gst/interfaces/mixer.h>
#include <gst/interfaces/propertyprobe.h>
#else
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/mixer/mixer.h> #include <gst/mixer/mixer.h>
#include <gst/propertyprobe/propertyprobe.h> #include <gst/propertyprobe/propertyprobe.h>
#endif
#include <string.h> #include <string.h>
@ -214,6 +220,43 @@ acme_volume_gstreamer_close_real (AcmeVolumeGStreamer *self)
return FALSE; return FALSE;
} }
#ifdef HAVE_GST10
/*
* _acme_set_mixer
* Arguments: mixer - pointer to mixer element
* data - pointer to user data (AcmeVolumeGStreamer to be modified)
* Returns: gboolean indicating success
*/
static gboolean
_acme_set_mixer(GstMixer *mixer, gpointer user_data)
{
const GList *tracks;
tracks = gst_mixer_list_tracks (mixer);
while (tracks != NULL) {
GstMixerTrack *track = GST_MIXER_TRACK (tracks->data);
if (GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_MASTER)) {
AcmeVolumeGStreamer *self;
self = ACME_VOLUME_GSTREAMER (user_data);
self->_priv->mixer = mixer;
self->_priv->track = track;
/* no need to ref the mixer element */
g_object_ref (self->_priv->track);
return TRUE;
}
tracks = tracks->next;
}
return FALSE;
}
#endif
/* This is a modified version of code from gnome-media's gst-mixer */ /* This is a modified version of code from gnome-media's gst-mixer */
static gboolean static gboolean
acme_volume_gstreamer_open (AcmeVolumeGStreamer *vol) acme_volume_gstreamer_open (AcmeVolumeGStreamer *vol)
@ -237,9 +280,24 @@ acme_volume_gstreamer_open (AcmeVolumeGStreamer *vol)
* for first one named "volume". * for first one named "volume".
* *
* We should probably do something intelligent if we don't find an * We should probably do something intelligent if we don't find an
* appropriate mixer/track. But now we do something stupid... everything * appropriate mixer/track. But now we do something stupid...
* just becomes a no-op. * everything just becomes a no-op.
*/ */
#ifdef HAVE_GST10
GList *mixer_list;
mixer_list = gst_audio_default_registry_mixer_filter (_acme_set_mixer,
TRUE,
self);
if (mixer_list == NULL)
return FALSE;
/* do not unref the mixer as we keep the ref for self->priv->mixer */
g_list_free (mixer_list);
return TRUE;
#else
elements = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY); elements = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY);
for ( ; elements != NULL && self->_priv->mixer == NULL; elements = elements->next) { for ( ; elements != NULL && self->_priv->mixer == NULL; elements = elements->next) {
GstElementFactory *factory = GST_ELEMENT_FACTORY (elements->data); GstElementFactory *factory = GST_ELEMENT_FACTORY (elements->data);
@ -321,6 +379,7 @@ acme_volume_gstreamer_open (AcmeVolumeGStreamer *vol)
g_free (title); g_free (title);
} }
return FALSE; return FALSE;
#endif
} }
static void static void