Commit graph

404 commits

Author SHA1 Message Date
Heekyoung Seo a5bfaf8a79 qtdemux: Enable xvid/mp2 codec support
Add support for xvid video and mp2 audio, add m2v1 fourcc.

https://bugzilla.gnome.org/show_bug.cgi?id=775794
2016-12-14 10:17:23 +02:00
Edward Hervey 50bb6630f5 qtdemux: Sanitize unknown codec caps
We might have non-printable characters in the unknown fourcc, replace
them with '_', in the same way we do it for unknown tags.
2016-12-02 08:52:06 +01:00
Sebastian Dröge 6939399e96 qtdemux: Increase inflate buffer in bigger steps
1024 bytes is quite small, let's do 4096 bytes (or one page).
Also remove redundant if, we're always in that case when getting here.
2016-12-01 14:44:26 +02:00
Sebastian Dröge b79655d3c9 qtdemux: Ensure that size of the pasp atom is as much as we need
https://bugzilla.gnome.org/show_bug.cgi?id=775455
2016-12-01 14:30:49 +02:00
Sebastian Dröge d46cc8df6c qtdemux: Free compressed moov node and it's corresponding decompressed data
https://bugzilla.gnome.org/show_bug.cgi?id=775455
2016-12-01 14:30:10 +02:00
Sebastian Dröge b4d6b2af8e qtdemux: Check size of compressed MOOV header against available data
And actually read the size of the cmvd atom from the right position.

https://bugzilla.gnome.org/show_bug.cgi?id=775455
2016-12-01 14:29:21 +02:00
Sebastian Dröge 5e4883094b qtdemux: Fix zlib inflate loop
Handle errors cleanly, deallocate all memory and return the actual size
of the inflated data.

https://bugzilla.gnome.org/show_bug.cgi?id=775455
2016-12-01 14:27:55 +02:00
Sebastian Dröge d0949baf3d qtdemux: Fix out of bounds read in tag parsing code
We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.

https://bugzilla.gnome.org/show_bug.cgi?id=775451
2016-12-01 13:32:22 +02:00
Vivia Nikolaidou f8bf3a84ef qtdemux: Read interlacing information from 'fiel' atom
Read interlacing and TFF/BFF information from the 'fiel' atom and pass it
into the caps

https://bugzilla.gnome.org/show_bug.cgi?id=775414
2016-11-30 18:52:20 +02:00
Sebastian Dröge 499c5139bd qtdemux: Fix compiler warning
qtdemux.c: In function ‘qtdemux_parse_trak’:
qtdemux.c:10184:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘gint {aka const int}’ [-Werror=format=]
           GST_DEBUG_OBJECT (qtdemux, "Found jpeg: len %u, need %lu", len,
                                      ^
2016-11-29 13:55:40 +02:00
Scott D Phillips 4ec5daba5f qtdemux: Change off_t type to gint
off_t is a signed integer type provided by sys/types.h on posix systems.
Replace with gint for building on non-posix systems (like windows).

https://bugzilla.gnome.org/show_bug.cgi?id=775287
2016-11-29 13:12:24 +02:00
David Evans 45843ab9a2 qtdemux: Be sure not to read off end of FLAC dfLa box
https://bugzilla.gnome.org/show_bug.cgi?id=773712
2016-11-21 17:51:14 +02:00
christophecvr fc3022da1c qtdemux: Fix wrong compiler warning with gcc 6.2
| ../../../git/gst/isomp4/qtdemux.c: In function 'qtdemux_parse_tree':
| ../../../git/gst/isomp4/qtdemux.c:10224:24: error: 'size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                  offset += size;
|                         ^~
| ../../../git/gst/isomp4/qtdemux.c:10197:25: note: 'size' was declared here
|                  guint32 size, tag;
|                          ^~~~

https://bugzilla.gnome.org/show_bug.cgi?id=774747
2016-11-21 09:33:05 +02:00
Sebastian Dröge bb35f15d44 qtdemux: Ensure that raw audio and video have properly aligned buffers
That is, aligned to the basic type for audio and to 32 bytes for video.
Fixes crashes if the raw buffers are passed to SIMD processing functions.

https://bugzilla.gnome.org/show_bug.cgi?id=774428
2016-11-20 13:08:27 +02:00
Seungha Yang 7d2a07076e qtdemux: Remove useless return variable
qtdemux_expose_streams() returns flow error immediately, if there is an error.
So, the variable for the flow return is not needed.

https://bugzilla.gnome.org/show_bug.cgi?id=774674
2016-11-18 18:05:23 +02:00
David Evans 2ad30254c3 qtdemux: Add support for FLAC encapsulated in ISOBMFF
As defined by
https://git.xiph.org/?p=flac.git;a=blob_plain;f=doc/isoflac.txt

https://bugzilla.gnome.org/show_bug.cgi?id=773712
2016-11-18 18:03:30 +02:00
Seungha Yang e5b3d9257d qtdemux: Don't modify upstream TIME segment
TIME segment implies that stream/running time is being handled by upstream.
So, we shouldn't override it without any clue.
This patch is for fixing seek in DASH streaming.

https://bugzilla.gnome.org/show_bug.cgi?id=774196
2016-11-15 14:46:34 +02:00
Jan Schmidt 324cc4dc4a isomp4: Don't use gst_video_colorimetry_to_string_full()
The API was reverted. Just use the plain
gst_video_colorimetry_to_string() function.
2016-11-02 11:46:07 +11:00
Sebastian Dröge 68b0441a5e qtdemux: Fix compiler warning
qtdemux.c: In function ‘qtdemux_parse_tree’:
qtdemux.c:10139:16: error: ‘color_table_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             if (color_table_id != 0) {
                ^
qtdemux.c:10121:19: note: ‘color_table_id’ was declared here
           guint16 color_table_id;
                   ^~~~~~~~~~~~~~
2016-11-01 21:00:15 +02:00
Sebastian Dröge 7b565475bf qt: Add support for ProRes 4444 XQ
And also 4444 in the muxer.

https://bugzilla.gnome.org/show_bug.cgi?id=769048
2016-11-01 20:41:22 +02:00
Sebastian Dröge ec7f699604 qtdemux: Read colorimetry information from colr atom if available
https://bugzilla.gnome.org/show_bug.cgi?id=772181
2016-11-01 20:41:22 +02:00
Vincent Penquerc'h 5a889647ba qtdemux: extract interlaced information from jpeg video
This information is hidden in a small chunk of data.
Format found at https://developer.apple.com/standards/qtff-2001.pdf,
page 92, "Video Sample Description", under table 3.1.

https://bugzilla.gnome.org/show_bug.cgi?id=767771
2016-11-01 20:10:23 +02:00
Enrique Ocaña González 69fc488392 qtdemux: Use the tfdt decode time on byte streams when it's significantly different than the time in the last sample
We consider there's a sifnificant difference when it's larger than on second
or than half the duration of the last processed fragment in case the latter is
larger.

https://bugzilla.gnome.org/show_bug.cgi?id=754230
2016-11-01 20:07:39 +02:00
Xabier Rodriguez Calvar 415ae458d2 qtdemux: offset is irrelevant when no crypto info
Cause later it will try to use the crypto info array to get an index and
attach on of the positions as buffer's crypto info.

https://bugzilla.gnome.org/show_bug.cgi?id=770951
2016-09-10 11:29:55 +03:00
Xabier Rodriguez Calvar 92075e0256 qtdemux: Fix crash with no cenc aux offset
https://bugzilla.gnome.org/show_bug.cgi?id=770951
2016-09-07 09:58:22 +03:00
Thibault Saunier 150edef830 Use the new API to post flow ERROR messages on the bus
https://bugzilla.gnome.org/show_bug.cgi?id=770158
2016-08-26 19:23:26 -03:00
Sebastian Dröge 45db90fdb0 qtdemux: When receiving a DISCONT buffer that does not point to a sample, remember the offset
And don't just reset everything. This makes sure that we can continue to
handle data in the following scenario:

moov: discont
moof: discont
mdat: continuous

Previously this would fail because the offset would be the accumulated offset
from moov and moof at the mdat position, while the buffer offset might be
something completely different.
2016-07-28 17:58:16 +03:00
Edward Hervey 85b0c3a83d qtdemux: Let upstream events go through upstream
There's no real reason to avoid sending QOS/NAVIGATION events upstrea.
Some elements might want to have that information.
2016-07-08 15:00:28 +02:00
Luis de Bethencourt a85dbfc246 qtdemux: fix AAC codec_data values
As seen in the parent switch for object_type_id, the 4 possible values are
0x40, 0x66, 0x67 and 0x68. Fixing the nested switch to match these values.

Looks like it was a typo making them decimal instead of hexadecimal.

CID 1363328
2016-07-06 12:47:18 +01:00
Sebastian Dröge df454fa28f qtdemux: Invent AAC codec_data if none is present
Without, raw AAC can't be handled and we have some information available in
the decoder that most likely allows us to decode the stream in one way or
another. This is the same code already used by matroskademux for the same
reasons, and ffmpeg/vlc play such files just fine too by guesswork.
2016-07-04 16:55:32 +02:00
Edward Hervey e3923df800 qtdemux: Handle upstream GAP in push-mode/time segment
This is to handle cases where upstream handles the fragmented streaming in TIME
segments and sends us data with gaps within fragments. This would happen when dealing
with trick-modes.

When upstream (push-based, TIME SEGMENT) wishes to send discontinuous samples,
it must obey the following rules:
* The buffer containing the [moof] must have a valid GST_BUFFER_OFFSET
* The buffers containing the first sample after a gap:
 * MUST start at the beginning of a sample,
 * MUST have the DISCONT flag set,
 * MUST have a valid GST_BUFFER_OFFSET relative to the beginning of the fragment.

https://bugzilla.gnome.org/show_bug.cgi?id=767354
2016-07-01 14:21:04 +02:00
Seungha Yang 231018bcfe qtdemux: Push caps only when it was updated
Commit 7873bede31 caused new caps
event per moof without consideration of duplication.

https://bugzilla.gnome.org/show_bug.cgi?id=768268
2016-07-01 11:37:20 +02:00
Edward Hervey 30d2918ab0 qtdemux: Show state name in debugging
Makes it easier to trace what's going on
2016-06-07 18:40:14 +03:00
Edward Hervey 7d309d3f4b qtdemux: Remove useless variable
That variable is only needed for a debug statement, move it there
2016-06-07 18:40:14 +03:00
Edward Hervey d8f1a6c58e qtdemux: Add/Fix comments on the various structure variables
No variables were added/removed. This was just a good excuse to:
* Comment what most variables are used for (and when)
* Order them in such a way as to show first the common variables used
  in all cases, followed by those only used in push-mode
2016-06-07 18:40:14 +03:00
Edward Hervey 6f1eed7f02 qtdemux: Remove unused structure
Let's just remove it, been commented for 7+ years :)
2016-06-07 18:40:14 +03:00
Sebastian Dröge 24862c2f74 qtdemux: Forward segments directly if we are operating in PUSH mode on fragmented streams
We shouldn't go through segment activation as we will only have a limited
understanding of how the whole stream timeline looks like from the moof. We
only know about the current fragment, while upstream knows about the whole
stream.

This fixes seeking in DASH streams, both for seeks after the current moof and
for seeks into the current moof. The former would fail because the moof ends
and we can't activate any segment, the latter would cause a segment that stops
at the moof end, and no further fragments would be played because we end up
being EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=767071
2016-06-07 16:19:39 +03:00
Sebastian Dröge 4498e57c10 qtdemux: Use the demuxer segment instead of a new one for MSS streams
Upstream might have told us something about the to be expected segment, so
let's use that information instead of coming up with a [0,-1] segment.

https://bugzilla.gnome.org/show_bug.cgi?id=767071
2016-06-01 09:32:03 +03:00
Sebastian Dröge 84e698c531 qtdemux: Only activate segments and send SEGMENT events if we have streams
But in that case also remove the pending newsegment event, otherwise we would
later send a possibly outdated event.

https://bugzilla.gnome.org/show_bug.cgi?id=767071
2016-06-01 09:32:03 +03:00
Sebastian Dröge f8eb909d90 qtdemux: In PULL mode, nothing is ever going to send us a SEGMENT event
https://bugzilla.gnome.org/show_bug.cgi?id=767071
2016-06-01 09:32:03 +03:00
Sebastian Dröge f3e68164e4 qtdemux: Don't override TIME segments from upstream that we just saw
The point of d8fb7a9c96 was to not have any
spurious segments stored for later if we do BYTES->TIME conversion, but
overriding any TIME segments from upstream does not make any sense.

See https://bugzilla.gnome.org/show_bug.cgi?id=763165

https://bugzilla.gnome.org/show_bug.cgi?id=767071
2016-06-01 09:32:03 +03:00
Sebastian Dröge 7cd9d34c80 qtdemux: Set seek event seqnum on all SEGMENT events
Some were forgotten.

See https://bugzilla.gnome.org/show_bug.cgi?id=765935
2016-05-20 11:15:44 +03:00
Seungha Yang 56e273bc21 qtdemux: Parsing elst box based on version
segment_duration and media_time should be parsed based on version
of elst box. Specification defines that an elst box with version 1
has uint64 and int64 values for segment_duration and media_time,
respectively.

https://bugzilla.gnome.org/show_bug.cgi?id=766301
2016-05-15 13:10:03 +03:00
Thiago Santos 00f23053b1 qtdemux: improve edts segment handling after seeks in push mode
Properly handle edts segments for push-based operation seeking.
We only support edts that a single segment that has media at the end,
being preceeded by any number of gap segments.

This also allows the qt segment rate to be respected after seeks

https://bugzilla.gnome.org/show_bug.cgi?id=765669
2016-05-09 11:46:46 -03:00
Thiago Santos 6604614dc5 qtdemux: properly activate segment with rate != 1.0
Also use the qt rate to identify the position within a qt segment
to properly translate playback time to qt media time

https://bugzilla.gnome.org/show_bug.cgi?id=765669
2016-05-09 10:49:53 -03:00
Thiago Santos c70ed4c914 qtdemux: update segment when new duration is found
Otherwise the old segment will have a shorter stop time and would
cause the stream to end too early.
2016-05-05 09:30:48 -03:00
Thiago Santos a5e02e948b qtdemux: dismember activate_segment into 2 parts
One that updates and push a new segment, the other will move the
stream to the new segment starting position
2016-05-05 09:30:48 -03:00
Sebastian Dröge e0b26059ae qtdemux: Store the segment sequence number in the EOS events and SEGMENT_DONE events/message
Also instead of storing it per stream, store it globally in the demuxer. It's
the same for each stream anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=765806
2016-04-29 15:13:34 +03:00
Seungha Yang cde45a41a5 qtdemux: Do not use unreliable framerate
timescale/1 is unreliable value for framerate. Due to downstream
element usually use framerate generated by qtdemux, let it be omitted
until the framerate can be reliably calculated.

https://bugzilla.gnome.org/show_bug.cgi?id=764733
2016-04-21 12:53:48 +03:00
Sebastian Dröge 707c69cb72 Revert "qtdemux: expose streams with first moof for fragmented format"
This reverts commit d8bb6687ea.

https://bugzilla.gnome.org/show_bug.cgi?id=764733
2016-04-21 12:53:33 +03:00