[svn r799] -fixed volume compability with playbin; -Enable compile without gmyth dep;
1.1 --- a/gst-gmyth/Makefile.am Thu Aug 02 14:58:15 2007 +0100
1.2 +++ b/gst-gmyth/Makefile.am Fri Aug 03 15:37:32 2007 +0100
1.3 @@ -1,5 +1,4 @@
1.4 SUBDIRS = \
1.5 - mythsrc \
1.6 nuvdemux \
1.7 concatmux \
1.8 playbinmaemo \
1.9 @@ -7,9 +6,14 @@
1.10 multiqueue
1.11
1.12 DIST_SUBDIRS = \
1.13 - mythsrc \
1.14 nuvdemux \
1.15 concatmux \
1.16 playbinmaemo \
1.17 decodebin2 \
1.18 multiqueue
1.19 +
1.20 +if WITH_GMYTH
1.21 +SUBDIRS += mythsrc
1.22 +DIST_SUBDIRS += mythsrc
1.23 +endif
1.24 +
2.1 --- a/gst-gmyth/configure.ac Thu Aug 02 14:58:15 2007 +0100
2.2 +++ b/gst-gmyth/configure.ac Fri Aug 03 15:37:32 2007 +0100
2.3 @@ -114,9 +114,10 @@
2.4 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
2.5
2.6 PKG_CHECK_MODULES(GMYTH, gmyth >= 0.3, HAVE_GMYTH=yes,HAVE_GMYTH=no)
2.7 -if test "x$HAVE_GMYTH" = "xno"; then
2.8 - AC_MSG_ERROR(you need gmyth >= 0.3 installed)
2.9 +if test "x$HAVE_GMYTH" = "xyes"; then
2.10 + AC_DEFINE([WITH_GMYTH],[1],[Define if GMYTH support is enabled])
2.11 fi
2.12 +AM_CONDITIONAL(WITH_GMYTH, test "x$HAVE_GMYTH" = "xyes")
2.13 AC_SUBST(GMYTH_CFLAGS)
2.14 AC_SUBST(GMYTH_LIBS)
2.15
3.1 --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Thu Aug 02 14:58:15 2007 +0100
3.2 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Fri Aug 03 15:37:32 2007 +0100
3.3 @@ -86,15 +86,6 @@
3.4 static gboolean autoplug_continue_cb (GstElement* object,
3.5 GstCaps* caps,
3.6 gpointer user_data);
3.7 -static void decode_new_pad_cb (GstElement *element,
3.8 - GObject *new_pad,
3.9 - gpointer user_data);
3.10 -static void queue_underrun_cb (GstElement* queue,
3.11 - gpointer user_data);
3.12 -static void queue_sink_underrun_cb (GstElement* queue,
3.13 - gpointer user_data);
3.14 -static void queue_sink_overrun_cb (GstElement* queue,
3.15 - gpointer user_data);
3.16 static gboolean add_element (GstPlayBinMaemo *pbm,
3.17 GstElement *child);
3.18 static void clear_elements (GstPlayBinMaemo *pbm);
3.19 @@ -131,8 +122,8 @@
3.20 NULL, G_PARAM_READWRITE));
3.21
3.22 g_object_class_install_property (gobject_klass, ARG_VOLUME,
3.23 - g_param_spec_uint ("volume", "Audio volume", "volume",
3.24 - 0, 10, (guint) DEFAULT_VOLUME, G_PARAM_READWRITE));
3.25 + g_param_spec_double ("volume", "Audio volume", "volume",
3.26 + 0.0, 10.0, (gdouble) DEFAULT_VOLUME, G_PARAM_READWRITE));
3.27
3.28 g_object_class_install_property (gobject_klass, ARG_XID,
3.29 g_param_spec_long ("xid", "xid", "X windown ID",
3.30 @@ -216,10 +207,12 @@
3.31 static const gchar *blacklisted_uris[] = { NULL };
3.32
3.33 /* mime types that we don't consider to be media types */
3.34 +/*
3.35 static const gchar *no_media_mimes[] = {
3.36 "application/x-executable", "application/x-bzip", "application/x-gzip",
3.37 "application/zip", "application/x-compress", NULL
3.38 };
3.39 +*/
3.40
3.41 /* mime types we consider raw media */
3.42 static const gchar *raw_mimes[] = {
3.43 @@ -289,9 +282,9 @@
3.44 /* whoops, could not create the source element, dig a little deeper to
3.45 * figure out what might be wrong. */
3.46 if (prot) {
3.47 + /*
3.48 gchar *desc;
3.49
3.50 - /*
3.51 gst_element_post_message (GST_ELEMENT (play_bin_maemo),
3.52 gst_missing_uri_source_message_new (GST_ELEMENT (play_bin_maemo),
3.53 prot));
3.54 @@ -300,8 +293,8 @@
3.55 GST_ELEMENT_ERROR (play_bin_maemo, CORE, MISSING_PLUGIN,
3.56 (_("A %s plugin is required to play this stream, but not installed."),
3.57 desc), ("No URI handler for %s", prot));
3.58 - */
3.59 g_free (desc);
3.60 + */
3.61 g_free (prot);
3.62 } else
3.63 goto invalid_uri;
3.64 @@ -344,9 +337,6 @@
3.65 static gboolean
3.66 setup_source (GstPlayBinMaemo *pbm)
3.67 {
3.68 - GstIterator *childs;
3.69 - GstState state;
3.70 -
3.71 if (!pbm->need_rebuild)
3.72 return TRUE;
3.73
3.74 @@ -414,14 +404,18 @@
3.75 }
3.76 case ARG_VOLUME:
3.77 {
3.78 - guint volume = 0;
3.79 - volume = g_value_get_uint (value);
3.80 - if (volume != 0) {
3.81 - volume = (guint) (65535 * volume / 10);
3.82 + gdouble d_volume = 0;
3.83 + guint u_volume = 0;
3.84 + d_volume = g_value_get_double (value);
3.85 +
3.86 + g_debug ("Getting : %5.2f", d_volume);
3.87 + if (d_volume != 0) {
3.88 + u_volume = (guint) (65535 * d_volume);
3.89 }
3.90
3.91 - if (play_bin_maemo->volume != volume) {
3.92 - play_bin_maemo->volume = volume;
3.93 + g_debug ("Converting : %d", u_volume);
3.94 + if (play_bin_maemo->volume != u_volume) {
3.95 + play_bin_maemo->volume = u_volume;
3.96 update_volume (play_bin_maemo);
3.97 }
3.98 break;
3.99 @@ -465,11 +459,11 @@
3.100 break;
3.101 case ARG_VOLUME:
3.102 {
3.103 - guint volume = 0;
3.104 + gdouble volume = 0;
3.105 if (play_bin_maemo->volume > 0) {
3.106 - volume = 10 * play_bin_maemo->volume / 65535;
3.107 + volume = play_bin_maemo->volume / 65535;
3.108 }
3.109 - g_value_set_uint (value, volume);
3.110 + g_value_set_double (value, volume);
3.111 break;
3.112 }
3.113 case ARG_XID:
3.114 @@ -799,7 +793,7 @@
3.115 for (walk=comp; walk != NULL; walk = walk->next) {
3.116 GstElementFactory *factory = (GstElementFactory *) walk->data;
3.117 GstElement *element;
3.118 - GstPad *sinkpad;
3.119 + GstPad *sinkpad = NULL;
3.120
3.121 if ((element = create_element (pbm, factory)) == NULL) {
3.122 GST_WARNING_OBJECT (pbm, "Could not create an element from %s",