libs/gst/base/gstbasesrc.c: When the subclass did not set caps on outgoing buffers, configure the caps we negotiated ...

Original commit message from CVS:
* libs/gst/base/gstbasesrc.c: (gst_base_src_get_range),
(gst_base_src_start):
When the subclass did not set caps on outgoing buffers, configure the
caps we negotiated on the source pad.
When the typefind helper does not find caps, error out properly instead
of doing things with NULL caps.
This commit is contained in:
Wim Taymans 2008-05-19 10:03:09 +00:00
parent ceb208f1b5
commit 638ecae590
2 changed files with 26 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2008-05-19 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasesrc.c: (gst_base_src_get_range),
(gst_base_src_start):
When the subclass did not set caps on outgoing buffers, configure the
caps we negotiated on the source pad.
When the typefind helper does not find caps, error out properly instead
of doing things with NULL caps.
2008-05-18 Tim-Philipp Müller <tim.muller at collabora co uk>
* gst/gsttypefind.h:

View file

@ -1825,6 +1825,10 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
&& GST_BUFFER_TIMESTAMP (*buf) == -1)
GST_BUFFER_TIMESTAMP (*buf) = 0;
/* set pad caps on the buffer if the buffer had no caps */
if (GST_BUFFER_CAPS (*buf) == NULL)
gst_buffer_set_caps (*buf, GST_PAD_CAPS (src->srcpad));
/* now sync before pushing the buffer */
status = gst_base_src_do_sync (src, *buf);
@ -2377,7 +2381,9 @@ gst_base_src_start (GstBaseSrc * basesrc)
if (basesrc->random_access && basesrc->data.ABI.typefind && size != -1) {
GstCaps *caps;
caps = gst_type_find_helper (basesrc->srcpad, size);
if (!(caps = gst_type_find_helper (basesrc->srcpad, size)))
goto typefind_failed;
gst_pad_set_caps (basesrc->srcpad, caps);
gst_caps_unref (caps);
} else {
@ -2404,6 +2410,16 @@ could_not_negotiate:
gst_base_src_stop (basesrc);
return FALSE;
}
typefind_failed:
{
GST_DEBUG_OBJECT (basesrc, "could not typefind, stopping");
GST_ELEMENT_ERROR (basesrc, STREAM, FORMAT,
("Could not determine media type"),
("Add support for this media type"));
/* we must call stop */
gst_base_src_stop (basesrc);
return FALSE;
}
}
static gboolean