From d8dc371c0da3f00a53acf0559f4fe4d060893515 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 20 May 2008 11:13:27 +0000 Subject: [PATCH] ext/gnomevfs/gstgnomevfssrc.*: Set the ICY caps on the srcpad from where they get picked up by the base class now and... 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 | 15 +++++++++++++++ ext/gnomevfs/gstgnomevfssrc.c | 23 +++++++---------------- ext/gnomevfs/gstgnomevfssrc.h | 2 -- gst-libs/gst/audio/gstbaseaudiosrc.c | 2 -- sys/v4l/v4lsrc_calls.c | 3 --- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa781c7ad8..e2de9385db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-05-20 Wim Taymans + + * 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 * gst-libs/gst/audio/gstbaseaudiosink.c: diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index fb60c37438..3242f6532c 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -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; } diff --git a/ext/gnomevfs/gstgnomevfssrc.h b/ext/gnomevfs/gstgnomevfssrc.h index 8c37fe8d07..31c1f65caa 100644 --- a/ext/gnomevfs/gstgnomevfssrc.h +++ b/ext/gnomevfs/gstgnomevfssrc.h @@ -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; diff --git a/gst-libs/gst/audio/gstbaseaudiosrc.c b/gst-libs/gst/audio/gstbaseaudiosrc.c index 4b7c55feb6..a152739d88 100644 --- a/gst-libs/gst/audio/gstbaseaudiosrc.c +++ b/gst-libs/gst/audio/gstbaseaudiosrc.c @@ -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; diff --git a/sys/v4l/v4lsrc_calls.c b/sys/v4l/v4lsrc_calls.c index c14ee123f5..9ba25581c1 100644 --- a/sys/v4l/v4lsrc_calls.c +++ b/sys/v4l/v4lsrc_calls.c @@ -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; }