Commit graph

259 commits

Author SHA1 Message Date
Alex Ashley
a965185dee qtdemux: Add support for the avc3 sample entry format of the AVC file format
Amendment 2 of ISO/IEC 14496-15 (AVC file format) is defining a new
structure for fragmented MP4 called "avc3". The principal difference
between AVC1 and AVC3 is the location of the codec initialisation
data (e.g. SPS, PPS). In AVC1 this data is placed in the initial
MOOV box (moov.trak.mdia.minf.stbl.stsd.avc1) but in AVC3 this data
goes in the first sample of every fragment (i.e. the first sample in
each mdat box).  The principal reason for avc3 is to make it easier
for client implementations, because it removes the requirement to
insert the SPS+PPS in to the decoder pipeline every time there is a
representation change.

This commit adds support for the "avc3" atom, which is almost identical
to the "avc1" atom, except it does not contain any SPS or PPS data.

https://bugzilla.gnome.org/show_bug.cgi?id=702004
2013-09-04 13:33:22 +02:00
Tim-Philipp Müller
1dfc1f2686 Don't use setlocale in plugins()
Only apps should call setlocale(), not libraries.
2013-09-01 21:18:38 +01:00
Thiago Santos
9549289a18 qtdemux: push buffers after segment stop until reaching a keyframe
This should make decoders able to precisely push buffers until the stop
time in case they need the next keyframe to do it.

Also, according to gst_segment_clip, it should only push a buffer that
the starting ts is strictly smaller than the segment stop, so we change
the min < comparison for <=
2013-08-28 12:58:56 -03:00
Chris Bass
3e9dea3f8c qtdemux: check denominator isn't zero before scaling duration.
When gst_qtdemux_configure_stream sets fps_d, check that n_samples is
non-zero before using it as a denominator to scale the stream duration.

https://bugzilla.gnome.org/show_bug.cgi?id=706076
2013-08-16 10:14:30 +02:00
Matej Knopp
2269ac8f28 qtdemux: elst should offset samples instead of buffers
The current approach where buffers are offset is not ideal, as during seek
and loop current time is compared to sample times.

https://bugzilla.gnome.org/show_bug.cgi?id=700264
2013-08-12 13:48:04 +02:00
Thibault Saunier
38946bd9f4 qtdemux: Fix compilation 2013-08-06 15:31:38 +02:00
Thibault Saunier
593a31f2b4 qtdemux: Raw buffer DTS should always be CLOCK_TIME_NONE 2013-08-06 15:17:44 +02:00
Edward Hervey
4f4f6432cc qtmux: Use buffer PTS if DTS is not set
Avoids ending up with completely bogus scaled duration/pts when new
buffers have invalid DTS.
2013-08-04 17:15:38 +02:00
Sebastian Dröge
2e35b36aab gst: Don't swap start/stop for negative rates in the SEGMENT query 2013-07-29 12:12:41 +02:00
Matej Knopp
47ed79fb1c qtdemux: Check for data size when parsing h264 codec data from strf atom 2013-07-29 11:53:07 +02:00
Matej Knopp
2dcdfe07f7 qtdemux: Support H264 fourcc
https://bugzilla.gnome.org/show_bug.cgi?id=704996
2013-07-29 09:11:39 +02:00
Thiago Santos
e49b6e7c35 qtdemux: correctly handle seqnum for seeks and segments
Use the same seqnum on messages and events for derived events.
Fixed for flushes / stream-start / segment after a seek, and segment
after a segment.

Fixes #676242
2013-07-25 15:24:31 -03:00
Edward Hervey
3d48d25756 qtdemux: Add all the mpeg XDCAM variants
This should cover all known XDCAM variants (which are all mpeg2 video)

Fixes #672227
2013-07-23 15:03:31 +02:00
Sebastian Dröge
1a0278ed64 qtdemux: Add support for group-id in the stream-start event 2013-07-22 15:30:13 +02:00
Olivier Crête
96a8fb92e2 qtdemux: Add WRLE support 2013-07-19 14:58:30 -04:00
Tim-Philipp Müller
aa7d597120 qtdemux: make files from Vivotek camera play
Skip tracks of 'vivo' subtype with empty stsd instead of
erroring out saying that the file is broken.

https://bugzilla.gnome.org/show_bug.cgi?id=699791
2013-07-19 19:38:30 +01:00
Tim-Philipp Müller
ce52b319ff qtmux: when streaming don't try to seek when stopping
It might cause errors in sinks that are not seekable and
have reported this (like e.g. fdsink)

https://bugzilla.gnome.org/show_bug.cgi?id=696228
2013-07-19 17:31:38 +01:00
Wim Taymans
bdd3c31902 qtdemux: simplify some helpers
Some helper functions are not needed anymore or can be simplified.
2013-07-19 17:26:54 +02:00
Wim Taymans
61a8937ced qtdemux: for non-raw video, move palette in caps
We only need to append the palette to raw video buffers, non-raw video has the
palette in the caps still.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=704292
2013-07-19 17:14:46 +02:00
Arnaud Vrac
40ab78825c qtdemux: nitpicking in esds parsing 2013-07-19 14:26:18 +02:00
Arnaud Vrac
d0d25a5e1f qtdemux: set proper caps for mpeg-1 audio
Remove AAC specific fields from mpeg-1 audio caps, remove assumption
that the mpeg1 audio layer is 3, and set `parsed' field.

https://bugzilla.gnome.org/show_bug.cgi?id=704548
2013-07-19 14:26:08 +02:00
Arnaud Vrac
5def061d20 qtdemux: remove chapter stream
Remove all streams that are actually table of contents, since we will
never need the data after parsing them.
2013-07-18 11:48:12 +02:00
Arnaud Vrac
ae67c13416 qtdemux: send gap event for sparse streams in push mode
This allows to pre-roll at least if the next subtitle buffer
is far away.
2013-07-18 11:48:11 +02:00
Arnaud Vrac
1237898351 qtdemux: do not use indexes from sparse stream when seeking in push mode
This makes seeking more accurate in push mode, since the previous
keyframe on a sparse stream might be far away.
2013-07-18 11:48:11 +02:00
Arnaud Vrac
e561d12655 qtdemux: advertise subtitle streams as sparse 2013-07-18 11:48:11 +02:00
Wim Taymans
4c97701650 qtdemux: extract the palette from stsd
Sometimes a palette is inside the stsd, extract it instead of always using
the default one
2013-07-17 15:17:19 +02:00
Wim Taymans
6b82c89562 qtdemux: add support for WRAW
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=704292
2013-07-17 09:57:17 +02:00
Wim Taymans
f698483bb3 qtdemux: palette is appended to buffers, not in caps
Fix the palette handling, in 1.0 we append the palette to the buffer instead of
placing it on the caps.

See also https://bugzilla.gnome.org/show_bug.cgi?id=704292
2013-07-17 09:57:16 +02:00
Arnaud Vrac
54bba4f60c qtdemux: reset segment on flush stop
cca2f555d1 introduces a regression, where the demux segment is not
reset on flush stop, so the next upstream segment event will calculate
an invalid base time on the new segment to be sent downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=704255
2013-07-16 10:47:20 +02:00
Matej Knopp
ca32442f86 qtdemux: offset samples according to edit list
https://bugzilla.gnome.org/show_bug.cgi?id=700264
2013-07-15 09:59:23 +02:00
Matej Knopp
3111161e8a qtdemux: unselect instead of ignoring disabled track, detect chapter track
https://bugzilla.gnome.org/show_bug.cgi?id=704007
2013-07-12 11:45:33 +02:00
Matej Knopp
7b69f427f1 qtdemux: correct argument order in gst_util_uint64_scale_int_round
https://bugzilla.gnome.org/show_bug.cgi?id=703350
2013-07-10 09:20:17 +02:00
Matej Knopp
4053e1d6ac qtdemux: compute framerate from average sample duration
https://bugzilla.gnome.org/show_bug.cgi?id=703350
2013-07-01 12:53:17 +02:00
Wim Taymans
8428423c04 qtdemux: handle SEGMENT query 2013-06-20 11:31:22 +02:00
Sebastian Dröge
b001da2926 qtdemux: Disable usage of allocation queries
This can only reliably work if demuxers have a
separate streaming thread per srcpad. This should be
done in a demuxer base class, which integrates parts
of multiqueue

https://bugzilla.gnome.org/show_bug.cgi?id=701856
2013-06-19 11:07:48 +02:00
Alex Ashley
46a137c810 Avoid skipping moov atoms for fragmented MP4 files.
bug #700505

Following a representation change that causes a resolution change,
the video decoder fails to decode correctly. Dashdemux detects the
representation change and pushes a new caps event and an
initialization segment (a new moov atom) to the downstream qtdemux,
but it doesn't handle this new moov yet, it will only parse the
first one it receives.

This commit changes qtdemux to accept a new moov in a dash bitstream
switching scenario.
2013-06-19 01:44:22 -03:00
Thiago Santos
384e8f6c34 qtdemux: send stream-start only once for each stream
Do not send stream start again when reconfiguring a pad for new caps.
That is common for adaptive streams
2013-06-19 00:55:30 -03:00
Sebastian Dröge
adc9f0bd10 qtdemux: Do allocation query after exposing all pads and no-more-pads
Also configure video streams as early as possible.

Related https://bugzilla.gnome.org/show_bug.cgi?id=701856
but not fixing that.
2013-06-11 12:27:19 +02:00
Thiago Santos
7c12435f9b qtdemux: make sure taglist is writable before adding tags
Avoids assertions
2013-06-02 15:37:06 -03:00
Thiago Santos
78dfdee2aa qtdemux: effectively skip tracks that weren't listed on the 1st moov
Without this, stream is NULL and the code will try to access it, leading
to segfaults.
2013-06-02 13:06:15 -03:00
Thiago Santos
70fca21c28 qtdemux: skip redundant check
!got_moov is already checked the line above
2013-06-02 13:06:15 -03:00
David Schleef
318cd39c3e qtdemux: Add error if file has playready drm 2013-05-21 18:21:49 -07:00
Thiago Santos
55caa99ccd qtdemux: Do not expect EOS after a segment event if upstream is mss
In case qtdemux is handling a mss stream, do not mark the stream to wait
for EOS after a segment. Even if it seems to be the last one according to
the current streams information.

MSS handling is different here because there is another demuxer driving
the pipeline
2013-05-16 16:50:49 -03:00
Thiago Santos
5517e352ab qtdemux: only set channels and rate if qtdemux knows it
Setting both of those to 0 is pointless and means that qtdemux
doesn't know the real value. Avoid setting it in this case.
2013-05-16 16:50:49 -03:00
Arnaud Vrac
6edcc564ba qtdemux: set alac caps using info from codec buffer
The samplerate field in the STSD atom is not right for some ALAC files
(usually when audio is 96kHz/24bits), so the audio caps must be
extracted from the codec data.

https://bugzilla.gnome.org/show_bug.cgi?id=700382
2013-05-15 18:42:11 +01:00
Thiago Santos
a0e934e72e qtdemux: push new caps events when caps change
Whenever the demuxer has a new caps on a stream, it should set the
new_caps variable to true and a new caps event will be pushed before
the next buffer
2013-05-07 19:29:17 -03:00
Thiago Santos
725faab590 qtdemux: do not push discont buffers if they aren't discont
qtdemux takes its buffers from a GstAdapter. Those buffers are created
from the larger buffer that it obtained from upstream and they carry
the same flags, including DISCONT if it is set. In these cases, all
buffers that qtdemux is going to push would be marked as DISCONT.

This scenario can make parsers/decoders flush on every buffer leading
to no decoding at all hapenning. This patch prevents this by unsetting
the flag if it shouldn't be set.
2013-05-07 19:29:17 -03:00
Thiago Santos
4d073beeee qtdemux: some code cleanup for mss handling code
* Explicitly init variables for fragmented formats at init
* Do not use GstClockTime type if the variable isn't a timestamp
* Fix a style/readability issue at an if block
* Group 2 mss mode conditional blocks together to improve readability

Conflicts:
	gst/isomp4/qtdemux.c
2013-05-07 19:29:17 -03:00
Thiago Santos
d1b91c755c qtdemux: avoid storing non-time newsegments to push later
This can confuse downstream when they get a byte segment after receiving
the natural time segment from qtdemux that it sends when starting to
push buffers. This is specially the case with parsers that try to
convert the position from byte to time format and might miss the
correct position for playback to start.
2013-05-07 19:29:17 -03:00
Thiago Santos
895525b5cb qtdemux: avoid setting fields to non-writable caps 2013-05-07 19:29:17 -03:00