ext/gnomevfs/gstgnomevfssrc.*: Set the ICY caps on the srcpad from where they get...
authorWim Taymans <wim.taymans@gmail.com>
Tue, 20 May 2008 11:13:27 +0000 (11:13 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 20 May 2008 11:13:27 +0000 (11:13 +0000)
Original commit message from CVS:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
(gst_gnome_vfs_src_finalize),
(gst_gnome_vfs_src_received_headers_callback),
(gst_gnome_vfs_src_create), (gst_gnome_vfs_src_stop):
* ext/gnomevfs/gstgnomevfssrc.h:
Set the ICY caps on the srcpad from where they get picked up by the base
class now and set on the outgoing buffers.
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_create):
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_buffer_new):
BaseSrc now sets the caps on outgoing buffers automatically.

ChangeLog
ext/gnomevfs/gstgnomevfssrc.c
ext/gnomevfs/gstgnomevfssrc.h
gst-libs/gst/audio/gstbaseaudiosrc.c
sys/v4l/v4lsrc_calls.c

index aa781c7..e2de938 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2008-05-20  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
+       (gst_gnome_vfs_src_finalize),
+       (gst_gnome_vfs_src_received_headers_callback),
+       (gst_gnome_vfs_src_create), (gst_gnome_vfs_src_stop):
+       * ext/gnomevfs/gstgnomevfssrc.h:
+       Set the ICY caps on the srcpad from where they get picked up by the base
+       class now and set on the outgoing buffers.
+
+       * gst-libs/gst/audio/gstbaseaudiosrc.c:
+       (gst_base_audio_src_create):
+       * sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_buffer_new):
+       BaseSrc now sets the caps on outgoing buffers automatically.
+
+2008-05-20  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst-libs/gst/audio/gstbaseaudiosink.c:
        (gst_base_audio_sink_resample_slaving),
        (gst_base_audio_sink_skew_slaving),
index fb60c37..3242f65 100644 (file)
@@ -275,7 +275,6 @@ gst_gnome_vfs_src_init (GstGnomeVFSSrc * gnomevfssrc)
   gnomevfssrc->curoffset = 0;
   gnomevfssrc->seekable = FALSE;
 
-  gnomevfssrc->icy_caps = NULL;
   gnomevfssrc->iradio_mode = FALSE;
   gnomevfssrc->http_callbacks_pushed = FALSE;
   gnomevfssrc->iradio_name = NULL;
@@ -329,11 +328,6 @@ gst_gnome_vfs_src_finalize (GObject * object)
   g_free (src->iradio_title);
   src->iradio_title = NULL;
 
-  if (src->icy_caps) {
-    gst_caps_unref (src->icy_caps);
-    src->icy_caps = NULL;
-  }
-
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -534,9 +528,14 @@ gst_gnome_vfs_src_received_headers_callback (gconstpointer in,
     /* Icecast stuff */
     if (strncmp (data, "icy-metaint:", 12) == 0) {      /* ugh */
       if (sscanf (data + 12, "%d", &icy_metaint) == 1) {
-        if (icy_metaint > 0)
-          src->icy_caps = gst_caps_new_simple ("application/x-icy",
+        if (icy_metaint > 0) {
+          GstCaps *icy_caps;
+
+          icy_caps = gst_caps_new_simple ("application/x-icy",
               "metadata-interval", G_TYPE_INT, icy_metaint, NULL);
+          gst_pad_set_caps (GST_BASE_SRC_PAD (src), icy_caps);
+          gst_caps_unref (icy_caps);
+        }
       }
       continue;
     }
@@ -633,9 +632,6 @@ gst_gnome_vfs_src_create (GstBaseSrc * basesrc, guint64 offset, guint size,
 
   buf = gst_buffer_new_and_alloc (size);
 
-  if (src->icy_caps)
-    gst_buffer_set_caps (buf, src->icy_caps);
-
   data = GST_BUFFER_DATA (buf);
   GST_BUFFER_OFFSET (buf) = src->curoffset;
 
@@ -866,10 +862,5 @@ gst_gnome_vfs_src_stop (GstBaseSrc * basesrc)
   }
   src->curoffset = 0;
 
-  if (src->icy_caps) {
-    gst_caps_unref (src->icy_caps);
-    src->icy_caps = NULL;
-  }
-
   return TRUE;
 }
index 8c37fe8..31c1f65 100644 (file)
@@ -67,8 +67,6 @@ struct _GstGnomeVFSSrc
   gboolean iradio_mode;
   gboolean http_callbacks_pushed;
 
-  GstCaps *icy_caps;
-
   gchar *iradio_name;
   gchar *iradio_genre;
   gchar *iradio_url;
index 4b7c55f..a152739 100644 (file)
@@ -808,8 +808,6 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
   GST_BUFFER_OFFSET (buf) = sample;
   GST_BUFFER_OFFSET_END (buf) = sample + samples;
 
-  gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (bsrc)));
-
   *outbuf = buf;
 
   return GST_FLOW_OK;
index c14ee12..9ba2558 100644 (file)
@@ -732,8 +732,5 @@ gst_v4lsrc_buffer_new (GstV4lSrc * v4lsrc, gint num)
   GST_BUFFER_TIMESTAMP (buf) = timestamp;
   GST_BUFFER_DURATION (buf) = duration;
 
-  /* the negotiate() method already set caps on the source pad */
-  gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (v4lsrc)));
-
   return buf;
 }