# HG changeset patch # User renatofilho # Date 1186151852 -3600 # Node ID 45c799bef1f67b149b7cbbc1a1f2ad9fba8b7198 # Parent a6ac25bf88a7a067b33f87dceb62a3400a716569 [svn r799] -fixed volume compability with playbin; -Enable compile without gmyth dep; diff -r a6ac25bf88a7 -r 45c799bef1f6 gst-gmyth/Makefile.am --- a/gst-gmyth/Makefile.am Thu Aug 02 14:58:15 2007 +0100 +++ b/gst-gmyth/Makefile.am Fri Aug 03 15:37:32 2007 +0100 @@ -1,5 +1,4 @@ SUBDIRS = \ - mythsrc \ nuvdemux \ concatmux \ playbinmaemo \ @@ -7,9 +6,14 @@ multiqueue DIST_SUBDIRS = \ - mythsrc \ nuvdemux \ concatmux \ playbinmaemo \ decodebin2 \ multiqueue + +if WITH_GMYTH +SUBDIRS += mythsrc +DIST_SUBDIRS += mythsrc +endif + diff -r a6ac25bf88a7 -r 45c799bef1f6 gst-gmyth/configure.ac --- a/gst-gmyth/configure.ac Thu Aug 02 14:58:15 2007 +0100 +++ b/gst-gmyth/configure.ac Fri Aug 03 15:37:32 2007 +0100 @@ -114,9 +114,10 @@ AC_SUBST(GST_PLUGINS_BASE_CFLAGS) PKG_CHECK_MODULES(GMYTH, gmyth >= 0.3, HAVE_GMYTH=yes,HAVE_GMYTH=no) -if test "x$HAVE_GMYTH" = "xno"; then - AC_MSG_ERROR(you need gmyth >= 0.3 installed) +if test "x$HAVE_GMYTH" = "xyes"; then + AC_DEFINE([WITH_GMYTH],[1],[Define if GMYTH support is enabled]) fi +AM_CONDITIONAL(WITH_GMYTH, test "x$HAVE_GMYTH" = "xyes") AC_SUBST(GMYTH_CFLAGS) AC_SUBST(GMYTH_LIBS) diff -r a6ac25bf88a7 -r 45c799bef1f6 gst-gmyth/playbinmaemo/gstplaybinmaemo.c --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Thu Aug 02 14:58:15 2007 +0100 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Fri Aug 03 15:37:32 2007 +0100 @@ -86,15 +86,6 @@ static gboolean autoplug_continue_cb (GstElement* object, GstCaps* caps, gpointer user_data); -static void decode_new_pad_cb (GstElement *element, - GObject *new_pad, - gpointer user_data); -static void queue_underrun_cb (GstElement* queue, - gpointer user_data); -static void queue_sink_underrun_cb (GstElement* queue, - gpointer user_data); -static void queue_sink_overrun_cb (GstElement* queue, - gpointer user_data); static gboolean add_element (GstPlayBinMaemo *pbm, GstElement *child); static void clear_elements (GstPlayBinMaemo *pbm); @@ -131,8 +122,8 @@ NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_VOLUME, - g_param_spec_uint ("volume", "Audio volume", "volume", - 0, 10, (guint) DEFAULT_VOLUME, G_PARAM_READWRITE)); + g_param_spec_double ("volume", "Audio volume", "volume", + 0.0, 10.0, (gdouble) DEFAULT_VOLUME, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_XID, g_param_spec_long ("xid", "xid", "X windown ID", @@ -216,10 +207,12 @@ static const gchar *blacklisted_uris[] = { NULL }; /* mime types that we don't consider to be media types */ +/* static const gchar *no_media_mimes[] = { "application/x-executable", "application/x-bzip", "application/x-gzip", "application/zip", "application/x-compress", NULL }; +*/ /* mime types we consider raw media */ static const gchar *raw_mimes[] = { @@ -289,9 +282,9 @@ /* whoops, could not create the source element, dig a little deeper to * figure out what might be wrong. */ if (prot) { + /* gchar *desc; - /* gst_element_post_message (GST_ELEMENT (play_bin_maemo), gst_missing_uri_source_message_new (GST_ELEMENT (play_bin_maemo), prot)); @@ -300,8 +293,8 @@ GST_ELEMENT_ERROR (play_bin_maemo, CORE, MISSING_PLUGIN, (_("A %s plugin is required to play this stream, but not installed."), desc), ("No URI handler for %s", prot)); - */ g_free (desc); + */ g_free (prot); } else goto invalid_uri; @@ -344,9 +337,6 @@ static gboolean setup_source (GstPlayBinMaemo *pbm) { - GstIterator *childs; - GstState state; - if (!pbm->need_rebuild) return TRUE; @@ -414,14 +404,18 @@ } case ARG_VOLUME: { - guint volume = 0; - volume = g_value_get_uint (value); - if (volume != 0) { - volume = (guint) (65535 * volume / 10); + gdouble d_volume = 0; + guint u_volume = 0; + d_volume = g_value_get_double (value); + + g_debug ("Getting : %5.2f", d_volume); + if (d_volume != 0) { + u_volume = (guint) (65535 * d_volume); } - if (play_bin_maemo->volume != volume) { - play_bin_maemo->volume = volume; + g_debug ("Converting : %d", u_volume); + if (play_bin_maemo->volume != u_volume) { + play_bin_maemo->volume = u_volume; update_volume (play_bin_maemo); } break; @@ -465,11 +459,11 @@ break; case ARG_VOLUME: { - guint volume = 0; + gdouble volume = 0; if (play_bin_maemo->volume > 0) { - volume = 10 * play_bin_maemo->volume / 65535; + volume = play_bin_maemo->volume / 65535; } - g_value_set_uint (value, volume); + g_value_set_double (value, volume); break; } case ARG_XID: @@ -799,7 +793,7 @@ for (walk=comp; walk != NULL; walk = walk->next) { GstElementFactory *factory = (GstElementFactory *) walk->data; GstElement *element; - GstPad *sinkpad; + GstPad *sinkpad = NULL; if ((element = create_element (pbm, factory)) == NULL) { GST_WARNING_OBJECT (pbm, "Could not create an element from %s",