gst-libs/gst/riff/riff-media.c: Add DIB fourcc (raw, palettized 8-bit RGB).

Original commit message from CVS:
* gst-libs/gst/riff/riff-media.c:
(gst_riff_create_video_caps_with_data),
(gst_riff_create_video_template_caps):
Add DIB fourcc (raw, palettized 8-bit RGB).
* gst-libs/gst/riff/riff-read.c:
(gst_riff_read_strf_vids_with_data):
Oops, fix strf_data reading bug.
* gst/avi/gstavidemux.c: (gst_avi_demux_add_stream):
Use a non-NULL tag.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_trak):
Time for hacks. Sorry Dave. At least one quicktime movie (a
trailer) that I've encountered contains multiple video tracks.
One of those is the actual video track, the other are one-frame
tracks (images). Unfortunately, the number of frames according
to the trak header is 1 for each, so that doesn't help. So
instead, I look at the duration and discard tracks with a
duration shorter than 20% of the length of the stream. Better
than nothing.
This commit is contained in:
Ronald S. Bultje 2004-10-02 14:10:19 +00:00
parent b4700acee0
commit 89e2912bad
3 changed files with 45 additions and 2 deletions

View file

@ -1,3 +1,24 @@
2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst-libs/gst/riff/riff-media.c:
(gst_riff_create_video_caps_with_data),
(gst_riff_create_video_template_caps):
Add DIB fourcc (raw, palettized 8-bit RGB).
* gst-libs/gst/riff/riff-read.c:
(gst_riff_read_strf_vids_with_data):
Oops, fix strf_data reading bug.
* gst/avi/gstavidemux.c: (gst_avi_demux_add_stream):
Use a non-NULL tag.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_trak):
Time for hacks. Sorry Dave. At least one quicktime movie (a
trailer) that I've encountered contains multiple video tracks.
One of those is the actual video track, the other are one-frame
tracks (images). Unfortunately, the number of frames according
to the trak header is 1 for each, so that doesn't help. So
instead, I look at the duration and discard tracks with a
duration shorter than 20% of the length of the stream. Better
than nothing.
2004-10-01 Christian Schaller <christian@fluendo.com>
* Patch fra Phil Blundell

View file

@ -832,10 +832,15 @@ gst_avi_demux_add_stream (GstAviDemux * avi)
{
char *codec_name = NULL;
GstTagList *list = gst_tag_list_new ();
guint32 tag;
padname = g_strdup_printf ("video_%02d", avi->num_v_streams);
templ = gst_element_class_get_pad_template (klass, "video_%02d");
caps = gst_riff_create_video_caps_with_data (strf.vids->compression,
if (strf.vids->compression)
tag = strf.vids->compression;
else
tag = strh->fcc_handler;
caps = gst_riff_create_video_caps_with_data (tag,
strh, strf.vids, extradata, initdata, &codec_name);
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC,
codec_name, NULL);

View file

@ -1876,6 +1876,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
tkhd = qtdemux_tree_get_child_by_type (trak, FOURCC_tkhd);
g_assert (tkhd);
GST_LOG ("track[tkhd] version/flags: 0x%08x",
QTDEMUX_GUINT32_GET (tkhd->data + 8));
/* track duration? */
mdia = qtdemux_tree_get_child_by_type (trak, FOURCC_mdia);
@ -1885,7 +1888,21 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
g_assert (mdhd);
stream->timescale = QTDEMUX_GUINT32_GET (mdhd->data + 20);
GST_INFO ("track timescale: %d", stream->timescale);
GST_LOG ("track timescale: %d", stream->timescale);
GST_LOG ("track duration: %d", QTDEMUX_GUINT32_GET (mdhd->data + 24));
/* HACK:
* some of those trailers, nowadays, have prologue images that are
* themselves vide tracks as well. I haven't really found a way to
* identify those yet, except for just looking at their duration. */
if ((guint64) QTDEMUX_GUINT32_GET (mdhd->data + 24) *
qtdemux->timescale * 10 / (stream->timescale * qtdemux->duration) < 2) {
GST_WARNING ("Track shorter than 20%% (%d/%d vs. %d/%d) of the stream "
"found, assuming preview image or something; skipping track",
QTDEMUX_GUINT32_GET (mdhd->data + 24), stream->timescale,
qtdemux->duration, qtdemux->timescale);
return;
}
hdlr = qtdemux_tree_get_child_by_type (mdia, FOURCC_hdlr);
g_assert (hdlr);