summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-03 13:43:58 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-03 13:43:58 +0000
commit440d6ef4e30534ffe985611ac71e904e07181180 (patch)
treed21038b94ef66a9a01e8ae616d11a16fb6e1ac00 /gst/qtdemux
parentc4893ec595c404513ec2ec35e7def43abc85669d (diff)
downloadgst-plugins-bad-440d6ef4e30534ffe985611ac71e904e07181180.tar.gz
gst-plugins-bad-440d6ef4e30534ffe985611ac71e904e07181180.tar.bz2
gst-plugins-bad-440d6ef4e30534ffe985611ac71e904e07181180.zip
gst/qtdemux/qtdemux.c: Add codecdata on avc1 (h264).
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak): Add codecdata on avc1 (h264).
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/qtdemux.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 47699f98..c8d00c59 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -2123,6 +2123,28 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
if (esds) {
gst_qtdemux_handle_esds (qtdemux, stream, esds);
+ } else {
+ if (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4) ==
+ GST_MAKE_FOURCC ('a', 'v', 'c', '1')) {
+ gint len = QTDEMUX_GUINT32_GET (stsd->data);
+
+ if (len > 0x6E &&
+ QTDEMUX_FOURCC_GET (stsd->data + 0x6A) ==
+ GST_MAKE_FOURCC ('a', 'v', 'c', 'C')) {
+ GstBuffer *buf;
+ gint size;
+
+ if (QTDEMUX_GUINT32_GET (stsd->data + 0x66) < len - 0x66)
+ size = QTDEMUX_GUINT32_GET (stsd->data + 0x66) - 8;
+ else
+ size = len - 0x6E;
+ buf = gst_buffer_new_and_alloc (size);
+ memcpy (GST_BUFFER_DATA (buf), (guint8 *) stsd->data + 0x6E, size);
+ gst_caps_set_simple (stream->caps,
+ "codec_data", GST_TYPE_BUFFER, buf, NULL);
+ gst_buffer_unref (buf);
+ }
+ }
}
GST_INFO ("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT,