1.1 --- a/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Thu Aug 02 14:58:15 2007 +0100
1.2 +++ b/gst-gmyth/playbinmaemo/gstplaybinmaemo.c Fri Aug 03 21:42:55 2007 +0100
1.3 @@ -86,15 +86,6 @@
1.4 static gboolean autoplug_continue_cb (GstElement* object,
1.5 GstCaps* caps,
1.6 gpointer user_data);
1.7 -static void decode_new_pad_cb (GstElement *element,
1.8 - GObject *new_pad,
1.9 - gpointer user_data);
1.10 -static void queue_underrun_cb (GstElement* queue,
1.11 - gpointer user_data);
1.12 -static void queue_sink_underrun_cb (GstElement* queue,
1.13 - gpointer user_data);
1.14 -static void queue_sink_overrun_cb (GstElement* queue,
1.15 - gpointer user_data);
1.16 static gboolean add_element (GstPlayBinMaemo *pbm,
1.17 GstElement *child);
1.18 static void clear_elements (GstPlayBinMaemo *pbm);
1.19 @@ -131,8 +122,8 @@
1.20 NULL, G_PARAM_READWRITE));
1.21
1.22 g_object_class_install_property (gobject_klass, ARG_VOLUME,
1.23 - g_param_spec_uint ("volume", "Audio volume", "volume",
1.24 - 0, 10, (guint) DEFAULT_VOLUME, G_PARAM_READWRITE));
1.25 + g_param_spec_double ("volume", "Audio volume", "volume",
1.26 + 0.0, 10.0, (gdouble) DEFAULT_VOLUME, G_PARAM_READWRITE));
1.27
1.28 g_object_class_install_property (gobject_klass, ARG_XID,
1.29 g_param_spec_long ("xid", "xid", "X windown ID",
1.30 @@ -216,10 +207,12 @@
1.31 static const gchar *blacklisted_uris[] = { NULL };
1.32
1.33 /* mime types that we don't consider to be media types */
1.34 +/*
1.35 static const gchar *no_media_mimes[] = {
1.36 "application/x-executable", "application/x-bzip", "application/x-gzip",
1.37 "application/zip", "application/x-compress", NULL
1.38 };
1.39 +*/
1.40
1.41 /* mime types we consider raw media */
1.42 static const gchar *raw_mimes[] = {
1.43 @@ -289,9 +282,9 @@
1.44 /* whoops, could not create the source element, dig a little deeper to
1.45 * figure out what might be wrong. */
1.46 if (prot) {
1.47 + /*
1.48 gchar *desc;
1.49
1.50 - /*
1.51 gst_element_post_message (GST_ELEMENT (play_bin_maemo),
1.52 gst_missing_uri_source_message_new (GST_ELEMENT (play_bin_maemo),
1.53 prot));
1.54 @@ -300,8 +293,8 @@
1.55 GST_ELEMENT_ERROR (play_bin_maemo, CORE, MISSING_PLUGIN,
1.56 (_("A %s plugin is required to play this stream, but not installed."),
1.57 desc), ("No URI handler for %s", prot));
1.58 - */
1.59 g_free (desc);
1.60 + */
1.61 g_free (prot);
1.62 } else
1.63 goto invalid_uri;
1.64 @@ -344,9 +337,6 @@
1.65 static gboolean
1.66 setup_source (GstPlayBinMaemo *pbm)
1.67 {
1.68 - GstIterator *childs;
1.69 - GstState state;
1.70 -
1.71 if (!pbm->need_rebuild)
1.72 return TRUE;
1.73
1.74 @@ -414,14 +404,18 @@
1.75 }
1.76 case ARG_VOLUME:
1.77 {
1.78 - guint volume = 0;
1.79 - volume = g_value_get_uint (value);
1.80 - if (volume != 0) {
1.81 - volume = (guint) (65535 * volume / 10);
1.82 + gdouble d_volume = 0;
1.83 + guint u_volume = 0;
1.84 + d_volume = g_value_get_double (value);
1.85 +
1.86 + g_debug ("Getting : %5.2f", d_volume);
1.87 + if (d_volume != 0) {
1.88 + u_volume = (guint) (65535 * d_volume);
1.89 }
1.90
1.91 - if (play_bin_maemo->volume != volume) {
1.92 - play_bin_maemo->volume = volume;
1.93 + g_debug ("Converting : %d", u_volume);
1.94 + if (play_bin_maemo->volume != u_volume) {
1.95 + play_bin_maemo->volume = u_volume;
1.96 update_volume (play_bin_maemo);
1.97 }
1.98 break;
1.99 @@ -465,11 +459,11 @@
1.100 break;
1.101 case ARG_VOLUME:
1.102 {
1.103 - guint volume = 0;
1.104 + gdouble volume = 0;
1.105 if (play_bin_maemo->volume > 0) {
1.106 - volume = 10 * play_bin_maemo->volume / 65535;
1.107 + volume = play_bin_maemo->volume / 65535;
1.108 }
1.109 - g_value_set_uint (value, volume);
1.110 + g_value_set_double (value, volume);
1.111 break;
1.112 }
1.113 case ARG_XID:
1.114 @@ -799,7 +793,7 @@
1.115 for (walk=comp; walk != NULL; walk = walk->next) {
1.116 GstElementFactory *factory = (GstElementFactory *) walk->data;
1.117 GstElement *element;
1.118 - GstPad *sinkpad;
1.119 + GstPad *sinkpad = NULL;
1.120
1.121 if ((element = create_element (pbm, factory)) == NULL) {
1.122 GST_WARNING_OBJECT (pbm, "Could not create an element from %s",