summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-10-15 09:19:37 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-10-15 09:19:37 +0000
commit9b6e65d53730e3aab3a8a1d1622a35cc485c5fd4 (patch)
tree8c323f58217c1b5f385ac2a25916d0823c4ad838 /gst/qtdemux
parent67f62e276b661b27dd2c469bf0568b60cba0229d (diff)
downloadgst-plugins-bad-9b6e65d53730e3aab3a8a1d1622a35cc485c5fd4.tar.gz
gst-plugins-bad-9b6e65d53730e3aab3a8a1d1622a35cc485c5fd4.tar.bz2
gst-plugins-bad-9b6e65d53730e3aab3a8a1d1622a35cc485c5fd4.zip
gst/qtdemux/qtdemux.c: An esds box is not a container.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header), (qtdemux_parse), (gst_qtdemux_handle_esds): An esds box is not a container. Fix parsing of mp4v boxes. Do not try to renegotiate fps for each frame. Need to find a better method. This should fix mp4 playback.
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/qtdemux.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index e62fba0c..defcee13 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug);
/* temporary hack */
#define g_print(...) /* */
-//#define gst_util_dump_mem(a,b) /* */
+#define gst_util_dump_mem(a,b) /* */
#define QTDEMUX_GUINT32_GET(a) (GST_READ_UINT32_BE(a))
#define QTDEMUX_GUINT24_GET(a) (GST_READ_UINT32_BE(a) >> 8)
@@ -735,16 +735,19 @@ gst_qtdemux_loop_header (GstElement * element)
} while (TRUE);
if (buf) {
- /* hum... */
+ /* hum... FIXME changing framerate breaks horribly, better set
+ * an average framerate, or get rid of the framerate property. */
if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) {
- float fps =
- 1. * GST_SECOND / stream->samples[stream->sample_index].duration;
- if (fps != stream->fps) {
- gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps,
- NULL);
- stream->fps = fps;
- gst_pad_set_explicit_caps (stream->pad, stream->caps);
- }
+ //float fps =
+ // 1. * GST_SECOND / stream->samples[stream->sample_index].duration;
+ /*
+ if (fps != stream->fps) {
+ gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps,
+ NULL);
+ stream->fps = fps;
+ gst_pad_set_explicit_caps (stream->pad, stream->caps);
+ }
+ */
}
GST_BUFFER_TIMESTAMP (buf) =
@@ -987,7 +990,7 @@ QtNodeType qt_node_types[] = {
{FOURCC_mp4v, "mp4v", 0,},
{FOURCC_wave, "wave", QT_CONTAINER},
{FOURCC_appl, "appl", QT_CONTAINER},
- {FOURCC_esds, "esds", QT_CONTAINER},
+ {FOURCC_esds, "esds", 0},
{FOURCC_hnti, "hnti", QT_CONTAINER},
{FOURCC_rtp_, "rtp ", 0, qtdemux_dump_unknown},
{FOURCC_sdp_, "sdp ", 0, qtdemux_dump_unknown},
@@ -1208,12 +1211,17 @@ qtdemux_parse (GstQTDemux * qtdemux, GNode * node, void *buffer, int length)
buf = buffer + 0x32;
end = buffer + length;
+ /* FIXME Quicktime uses PASCAL string while
+ * the iso format uses C strings. Check the file
+ * type before attempting to parse the string here. */
tlen = QTDEMUX_GUINT8_GET (buf);
g_print ("tlen = %d\n", tlen);
buf++;
g_print ("string = %.*s\n", tlen, (char *) buf);
- buf += tlen;
- buf += 23;
+ /* the string has a reserved space of 32 bytes so skip
+ * the remaining 31 */
+ buf += 31;
+ buf += 4; /* and 4 bytes reserved */
gst_util_dump_mem (buf, end - buf);
while (buf < end) {
@@ -2323,7 +2331,7 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream,
guint8 *data_ptr = NULL;
int data_len = 0;
- //gst_util_dump_mem (ptr, len);
+ gst_util_dump_mem (ptr, len);
ptr += 8;
g_print ("version/flags = %08x\n", QTDEMUX_GUINT32_GET (ptr));
ptr += 4;