Commit graph

460 commits

Author SHA1 Message Date
Mark Nauwelaerts 4bcad634f8 qtdemux: fragmented support; forego check for short streams
... as some bogus files may indicate streams of 0 duration in moov,
while indicating the complete movie duration in mvhd (the latter should
be in mehd).
2010-12-03 15:50:32 +01:00
Mark Nauwelaerts 30065f8f01 qtdemux: fragmented support; code cleanups and optimizations in atom parsing
Avoid extra allocation in _parse_trun, add more checks for parsing errors,
add or adjust some debug statement, fix comments, sprinkle some branch
prediction.
2010-12-03 15:50:32 +01:00
Thiago Santos 4f62f49a17 qtdemux: parse_moof should return TRUE on success 2010-12-03 15:50:32 +01:00
Thiago Santos 7dabc7764e qtdemux: Fix iteration bug
Avoid infinite loop when iterating traf
2010-12-03 15:50:32 +01:00
Thiago Santos f48817522d qtdemux: Refactor trun parsing
The allocation of the samples can be placed out of the loop.
Makes the code clearer.

Also avoid relying on traf information as it is placed on the
end of the file and might not be acessible on push mode.
2010-12-03 15:50:31 +01:00
Thiago Santos 400f22bfe3 qtdemux: Remove parsing of unused atom
sdtp atom is parsed but not used, so we don't have to
parse it.
2010-12-03 15:50:31 +01:00
Mark Nauwelaerts 19b87dbdbe qtdemux: tweak wam support
... with some comment and portability macros.
2010-12-03 15:50:31 +01:00
Marc-André Lureau 293e6a61b4 qtdemux: support wma & vc-1
https://bugzilla.gnome.org/show_bug.cgi?id=596321
2010-12-03 15:50:31 +01:00
Andoni Morales Alastruey 6f05c5c050 qtdemux: parse fmp4 samples information
The fragmented mp4 format stores the tracks and samples information in the
'moof' boxes, which are appended before each fragment (fragment->'moof'+'mdat').
The 'mfra' box stores the offset of each 'moof' box and their presentation
time. The location of this box can be retrieved from the 'mfro' box, which is
located at the end of the file.
The 'mfra' box is parsed to get the offset of each 'moof' box and their
presentation time.
Each 'moof' box can contain information for one or more tracks inside
'tfhd' boxes. For each track in a 'moof', we have a 'trun' box, which
contains information of each sample (offset and duration) used to build
the samples table.

Based on patch by Marc-André Lureau <mlureau@flumotion.com>

https://bugzilla.gnome.org/show_bug.cgi?id=596321
2010-12-03 15:50:31 +01:00
Marc-André Lureau c9b866a994 qtdemux: parse the track id from the track header
Signed-off-by: Andoni Morales Alastruey <amorales@flumotion.com>

https://bugzilla.gnome.org/show_bug.cgi?id=596321
2010-12-03 15:50:31 +01:00
Marc-André Lureau 2fa531ee3c qtdemux: allow pulling atoms with unknown size
Signed-off-by: Andoni Morales Alastruey <amorales@flumotion.com>

https://bugzilla.gnome.org/show_bug.cgi?id=596321
2010-12-03 15:50:30 +01:00
Thiago Santos 6511730ba1 qtdemux: Parse and use creation time tag from mvhd
Expose creation time from mvhd as a datetime tag

Fixes #634928
2010-12-02 17:12:29 -03:00
Tim-Philipp Müller ac70239020 qtdemux: fix deadlock in error code path
GST_ELEMENT_ERROR must not be called with the object lock held,
since it will call gst_object_get_parent() internally, which
takes the object lock as well.
2010-10-24 18:57:59 +01:00
Mark Nauwelaerts 4085f12058 ac3: demuxers provide framed output 2010-10-14 17:29:26 +02:00
Mark Nauwelaerts c7a8d672a7 qtdemux: handle another mp4v variation
... including the glbl atom containing codec-data.
2010-10-13 17:26:33 +02:00
Arun Raghavan 4a244e0d55 qtdemux: AAC codec_data can be > 2 bytes long
This fixes the assumption that DecoderSpecificInfo must be 2 bytes long
for AAC files. The specification allows HE-AAC to be explicitly
signalled in a backward compatible way. This is done by means of an
additional information after the regular AAC header. It is expected that
decoders that can play AAC but not HE-AAC will parse the header normally
and ignore extended bits, much as they do for the HE-AAC specific payload
in the actual stream.

https://bugzilla.gnome.org/show_bug.cgi?id=612313
2010-10-05 19:45:31 +01:00
Arun Raghavan c65305d70e qtdemux: Use pbutils for H.264 profile/level extraction
The functions used to extract this data have been moved to gstpbutils to
facilitate reuse.

https://bugzilla.gnome.org/show_bug.cgi?id=617318
2010-10-01 17:07:36 +01:00
Arun Raghavan 1a37a62454 qtdemux: Export MPEG-4 video profile and level in stream caps
This uses gstpbutils to extract the profile and level from the video
object sequence and adds this to stream caps. This can be used as
metadata and for fine-grained decoder selection.

https://bugzilla.gnome.org/show_bug.cgi?id=616521
2010-10-01 14:41:44 +01:00
Tim-Philipp Müller 64753bdbe8 qtdemux: fix aac channel override based on codec data for 7.1 case 2010-10-01 11:42:15 +01:00
Arun Raghavan 845a3d6c3d qtdemux: Export AAC profile and level in caps
This exports the AAC profile and level in caps for use as metadata and
(eventually) for more fine-grained selection of decoders at
caps-negotiation time. (Doesn't work for HE-AAC yet though.)

https://bugzilla.gnome.org/show_bug.cgi?id=612313
2010-10-01 11:41:53 +01:00
Edward Hervey 6ce6ad41d5 qtdemux: Don't post tags if there are none
And make all code go through _post_global_tags.
2010-09-22 12:56:39 +02:00
Thiago Santos 52f5e95aee qtdemux: Parse uuid atoms in push mode
Parses uuid atoms in push mode when they are found, they might
contain xmp tags.

Also does a minor refactoring to put the global tags posting
into a single function instead of repeating it in 3 different
places.

Fixes #629839
2010-09-20 23:39:38 -03:00
Thiago Santos 9227352e31 qtdemux: Delay tags posting a little
Delay tags posting until we've parsed all the headers so
that the native and xmp tags get merged before posting

https://bugzilla.gnome.org/show_bug.cgi?id=629839
2010-09-20 22:37:26 -03:00
Thiago Santos 8d6cabf9c3 qtdemux: Parse xmp packet in uuid atom
xmp packet is placed into a top-level uuid atom for
isom/mp4 variants.

This patch makes qtdemux parse all top-level atoms
in pull-mode before starting to push data, making
it able to find those tags.

https://bugzilla.gnome.org/show_bug.cgi?id=629839
2010-09-20 22:37:26 -03:00
Alessandro Decina 3605bd454a qtdemux: fix logic when pushing EOS.
Don't check for return values when pushing EOS. Still post an error if EOS is
reached and no streams have been found.
2010-09-15 18:27:24 +02:00
Alessandro Decina 42cde1ba3c qtdemux: don't send EOS twice on the same pad. 2010-09-14 17:43:33 +02:00
Wim Taymans bd43ac854a qtdemux: use older g_array_free
g_array_unref() is only since 2.22
2010-09-07 17:06:02 +02:00
Mark Nauwelaerts 713719f705 qtdemux: improve framerate determining
Collect a limited number of starting sample durations and use the median of
those to determine caps framerate.
2010-09-06 14:45:43 +02:00
Stefan Kost 3b91ea7c81 qtdemux: use GST_BOILERPLATE macro 2010-09-06 09:57:58 +03:00
Sebastian Dröge 7fe34f3889 qtdemux: Don't use GST_FLOW_IS_FATAL() 2010-09-04 14:52:10 +02:00
Mark Nauwelaerts 8ea04c66b8 qtdemux: prevent reading past avc1 atom when parsing
... when one of the subatoms has a large/invalid size.

Fixes #626609.
2010-08-11 12:58:17 +02:00
Thiago Santos bef350bf34 qtdemux: Correctly parse mvhd atoms
Parse mvhd data according to its version to avoid failing
on valid files.
2010-07-29 10:00:15 -03:00
Thiago Santos a15430a862 qtdemux: Fix the max/avg in btrt atom reading
According to ISO media base format, the max bitrate is the
first one, and the avg comes next.
2010-07-28 12:22:23 -03:00
Andoni Morales Alastruey e6d7e69844 qtdemux: set the pixel-aspect-ratio field also for par=1/1
https://bugzilla.gnome.org/show_bug.cgi?id=625302
2010-07-26 16:08:37 +02:00
Mark Nauwelaerts 65fdbe68ec qtdemux: also calculate PAR using track width and height for QT files
(... as opposed to only for ISO style files).

Fixes #624173.
2010-07-16 14:00:18 +02:00
Mark Nauwelaerts bbded080e0 qtdemux: do not align reverse playback reference stream twice
Timestamp rounding issues could lead to going backwards 2 keyframe periods
(rather than only 1).  While this is not necessarily a problem, it might
potentially place additional (buffering) load on downstream and could be
avoided (because We Can).

Fixes #623629.
2010-07-16 13:58:34 +02:00
Mark Nauwelaerts 2a22e9d487 qtdemux: convert some more mov format timestamp to gst time 2010-07-16 13:58:21 +02:00
Arun Raghavan 8aed3176ce qtdemux: Fix order of bitrates in 'btrt' atom
There seems to be a bug in libmp4v2 that generates a MPEG4BitRateBox as
(bufferSizeDB, avgBitrate, maxBitrate) instead of (bufferSizeDB,
maxBitrate, avgBitrate), according to the spec. I used the mp4file
output while writing this code, so the order is wrong. This patches
fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=623654
2010-07-06 10:33:16 +01:00
Edward Hervey fcf1995020 qtdemux: strip out bogus tags from XMP atom
https://bugzilla.gnome.org/show_bug.cgi?id=623366
2010-07-02 14:39:36 +02:00
Robert Swain 50273537dc qtdemux: Round timestamp up when scaling to mov format
Fix timestamp rounding to allow the correct index to be located.

The issue was that scaling from GStreamer time format to mov time format was
rounding down causing the timestamp of the newsegment event received after a
flushing keyframe seek to find the sample index before the one it should
causing further backward seeking to the keyframe prior until no rounding error
occurred.

Rounding up when scaling to mov format has the desired effect, and it is
not clear whether just the _round () variant would be sufficient.

Fixes bug #619105
2010-05-26 00:08:16 +01:00
David Schleef e847957790 qtdemux: Add VP8 2010-05-17 17:18:25 +02:00
Mark Nauwelaerts bcde9fab09 qtdemux: fix push based seeking
... where it comes down to transforming incoming BYTE segment
to a corresponding TIME segment.

Also fixes #609405.
2010-05-11 18:44:01 +02:00
Mark Nauwelaerts e934f637b6 qtdemux: fix partial parsing of ctts table
Fixes #616516.
2010-05-11 11:06:20 +02:00
Mark Nauwelaerts a9e688cf32 qtdemux: cleanup a comment and add some debug and conditional compilation 2010-05-11 11:06:17 +02:00
David Schleef 1df1d34fe1 qtdemux: UYVY is 4:2:2, not 4:2:0 2010-04-30 17:19:44 -07:00
Tim-Philipp Müller a155deaabf matroskademux, qtdemux: minor code cleanup in avc_level_idc_to_string()
Do the same with slightly fewer LOC.
2010-04-12 15:10:11 +01:00
Arun Raghavan 861311e8f6 qtdemux: Post avg./max. bitrate tags for H.264
This reads the average and maximum bitrates from the 'btrt' atom if
available, and pushes these as tags,

https://bugzilla.gnome.org/show_bug.cgi?id=614927
2010-04-07 11:55:32 +02:00
Thiago Santos f966ff66f8 qtdemux: Read replaygain peak/gain tags
Make qtdemux read tags replaygain tags that are within '----' atoms.

Fixes #614471
2010-04-02 15:23:51 -03:00
Arun Raghavan 95c6d558f0 matroska: Export h.264 profile and level in caps
This replicates the code in qtdemux to export the h.264 profile and
level in the stream caps.

https://bugzilla.gnome.org/show_bug.cgi?id=614651
2010-04-02 18:51:34 +02:00
Sebastian Dröge 9317ad6fe9 qtdemux: Fix off-by-one introduced in last commit 2010-04-02 18:50:45 +02:00