Commit graph

9205 commits

Author SHA1 Message Date
Sebastian Dröge
f0163a016c qtmux: Error out on discontinuities/gaps when muxing raw audio
When muxing raw audio, we have no way of storing timestamps but are just
storing a continuous stream of audio samples. If the difference between
the expected and the real timestamp becomes to big, we should error out
instead of silently creating files with wrong A/V sync.

https://bugzilla.gnome.org/show_bug.cgi?id=780679
2017-05-09 14:16:51 +02:00
Tim-Philipp Müller
d826c5ad96 matroskademux: improve index memory usage
Re-arrange order of index entry struct members to avoid padding
bytes in the middle of the struct, thus potentially reducing the
overall size of the struct and reducing memory used by the index.
On Linux x86_64 the size goes down from 32 bytes to 24 bytes for
each index entry.
2017-05-06 22:39:31 +01:00
Seungha Yang
66448be77f qtdemux: Fix crash on mss stream caused by invalid stsd entry access
Since mss has no moov, default stsd entry should be created with media-caps.

https://bugzilla.gnome.org/show_bug.cgi?id=782042
2017-05-02 14:20:02 +03:00
Sebastian Dröge
875fc630d5 qtdemux: Don't crash in debug output if stream==NULL
That case is correctly handled below but not in the debug output.

https://bugzilla.gnome.org/show_bug.cgi?id=781270
2017-04-27 12:56:27 +03:00
Sebastian Dröge
a593e4966e qtdemux: Don't perform seeks with inconsistent seek values
If gst_segment_do_seek() fails, we shouldn't try seeking on that
resulting segment but just error out. Crashes further down the line
otherwise.
2017-04-25 17:12:30 +03:00
Tim-Philipp Müller
e7e7f26200 rtph264depay: don't insert SPS/PPS inline for AVC output
SPS/PPS are in the caps in this case and shouldn't be in
the stream data.
2017-04-24 17:29:37 +01:00
Sebastian Dröge
c99f7579f3 rtspsrc: Chain up to the parent class' provide_clock() implementation
If no clock was provided directly by rtspsrc. This behaviour was removed
by f8013487c9 and results in rtspsrc not
providing the system clock via the rtpjitterbuffer.

As a result, if another element like an audio sink, provides a clock,
the pipeline would select that (when going to PAUSED/PLAYING again later).
Audio clocks usually don't progress in PAUSED, and thus our live source
won't be able to use the clock to produce data, making the sink never
preroll and everything is stuck.
2017-04-21 19:14:09 +01:00
Jürgen Sachs
7c658c3c04 qtdemux: reset sample_description_id to default
Fixes stream where sample_description_id is specified in the tfhd

https://bugzilla.gnome.org/show_bug.cgi?id=778337
2017-04-21 06:45:10 +02:00
Sebastian Dröge
fe77e2efe8 splitmuxsink: Don't use an explicit name for requesting audio pads
... unless the muxer uses the same audio pad template name as
splitmuxsink. We can't request a pad called "audio_0" on a muxer that
wants pads to be "sink_%d".
2017-04-20 13:17:33 +01:00
ChangBok Chae
3d19d6d8bc flvdemux: remove duplicated segment initialization
It's also done in gst_flv_demux_cleanup().

https://bugzilla.gnome.org/show_bug.cgi?id=779106
2017-04-20 12:42:58 +01:00
Xavier Claessens
6b42569ded splitmuxsink: Correctly catch FLUSH events in probes
https://bugzilla.gnome.org/show_bug.cgi?id=767498
2017-04-20 20:17:35 +10:00
Tim-Philipp Müller
50a4b5bc0d Revert "rtpbin: pipeline gets an EOS when any rtpsources byes"
This reverts commit eeea2a7fe8.

It breaks EOS in some sender pipelines, see
https://bugzilla.gnome.org/show_bug.cgi?id=773218#c20
2017-04-19 12:28:12 +01:00
Edward Hervey
58e3033747 qtdemux: Reset adapter in more discontinuity cases
In push mode we process as much as possible in the adapter. When we receive
a DISCONT buffer which we can't match to an actual sample (based on the existing
sample table) and there is still data remaining in the incoming adapter,there is
one of two cases happening:
1) We are doing reverse playback, in which case we should flush out all pending
  data
2) We have leftover data from the previous incoming buffer... which we can't do
  anything about.

For the second case, make sure we flush out the remaining data so that we can start
parsing again from scratch.

https://bugzilla.gnome.org/show_bug.cgi?id=781319
2017-04-17 13:10:06 +02:00
Edward Hervey
474819cc3d rtspsrc: Use GST_ELEMENT_ERROR_WITH_DETAILS
Allows the application to know the exact status code that was returned
by the server in a programmatic fashion.

https://bugzilla.gnome.org/show_bug.cgi?id=781304
2017-04-17 13:10:06 +02:00
Seungha Yang
3b9ea4b85f qtdemux: Fix leak on QtDemuxStreamStsdEntry
Fix unit test failure

https://bugzilla.gnome.org/show_bug.cgi?id=781362
2017-04-16 23:37:55 +01:00
Sebastian Dröge
e51c08b0a2 qtmux: Fix timescale of timecode tracks
They should have ideally the same timescale of the video track, which we
can't guarantee here as in theory timecode configuration and video
framerate could be different. However we should set a correct timescale
based on the framerate given in the timecode configuration, and not just
use the framerate numerator.
2017-04-14 13:38:53 +03:00
Edward Hervey
c6e9c67f63 qtdemux: Properly reset demuxer when all streams are EOS
Make sure offset and neededbytes are properly resetted when all
streams are EOS in push-mode.

Avoids cases when some data might still be pushed by upstream (because
it didn't yet see the resulting GST_FLOW_EOS yet) and qtdemux gets
completely lost.

https://bugzilla.gnome.org/show_bug.cgi?id=781266
2017-04-13 13:26:36 +02:00
Edward Hervey
7077425c3d qtmux: Don't forget to update pad->last_buf
buf is the current pad->last_buf value. If ever it gets copied/unreffed,
we need to make sure to write back the new  pointer to the last_buf
variable.

Fixes using wrong pointer values in the case of decrasing DTS value
2017-04-12 13:26:59 +02:00
Jürgen Sachs
9684c88c60 qtdemux: fix: sample description index override in tfhd not evaluated
https://bugzilla.gnome.org/show_bug.cgi?id=778337
2017-04-12 11:04:46 +02:00
Edward Hervey
26f9869668 qtdemux: Add out-of-bound check
Make sure we don't read invalid memory
2017-04-12 11:03:24 +02:00
Thiago Santos
9ac3861a9b qtdemux: move parsing of tkhd out of stsd entry loop
It needs only to be read once.
2017-04-11 23:42:56 -07:00
Thiago Santos
cf6733a55e qtdemux: check for a different stsd entry before pushing a sample
Before pushing a sample, check if there was a change in the current
stsd entry. This patch also assumes that the first stsd entry is
used as default for the first sample. It might cause an uneeded
caps renegotiation when this isn't the case.
2017-04-11 23:42:56 -07:00
Thiago Santos
86b427dc70 qtdemux: parse all stsd entries
stsd can have multiple format entries, parse them all.

This is required to play DVB DASH profile that uses multiple entries
to identify the different available bitrates/options on dash streams

The stream format-specific data is not stored into QtDemuxStreamStsdEntry
2017-04-11 23:42:55 -07:00
Thiago Santos
54e252e095 qtdemux: rework stsd sample entries access
Instead of using the stsd as a base pointer, use the actual stsd
entry as the stsd can have multiple entries. This is rarely used
for file playback but is a possible profile with in DVB DASH specs.

This still doesn't support stsd with multiple entries but makes it
easier to do so.
2017-04-11 14:13:56 -07:00
Thiago Santos
bd32bcc36c qtdemux: get stsd child by index instead of type
There might be multiple children with the same type
2017-04-11 14:13:56 -07:00
George Kiagiadakis
7f6c783930 rtprtxqueue: implement handling of the max-size-time property
https://bugzilla.gnome.org/show_bug.cgi?id=780867
2017-04-11 09:44:33 +03:00
Sebastian Dröge
d6b145df5f qtmux: Fix last_dts tracking for raw audio and similar formats
Accumulate the durations directly and don't scale yet another time by
the number of samples.
2017-04-10 15:55:54 +03:00
Lyon Wang
f26835d8bb scaletempo: Scale GAP event timestamp and duration like for buffers
https://bugzilla.gnome.org/show_bug.cgi?id=781008
2017-04-09 10:45:21 +03:00
Edward Hervey
9a066e548d aacparse: streamline and improve AudioSpecificConfig parsing
AudioSpecifigConfig is used in a variety of AAC streams but was
being parsed differently. Instead, make everyone use the same parsing.

* Remove unused 'bits' field (it was always set to 0 if present)
* Add proper GAConfig parsing (to know the  number of samples per frame
  if present).

Fixes wrong rate/channels configuration in streams coming from qtdemux

https://bugzilla.gnome.org/show_bug.cgi?id=780966
2017-04-06 12:04:46 +02:00
Edward Hervey
345c566552 aacparse: Handle Parametric Stereo with HE-AAC(v2)
According to ISO/IEC:14496-2:2009 , in the case of HE-AACv2 (audioObjecType
29) parametric stereo is used (a single mono track is used and then
transformations are applied to it to provide a stereo output).

We therefore report two channels in the case where there is one reported
in the audioChannelConfiguration.

Fixes the various issues where a demuxer would report two channels, but
then the parser would say there's only one channel, and then the decoder
would output two channels.
2017-04-04 18:16:39 +02:00
Sebastian Dröge
6f3737f0c5 qtmux: Simplify buffer refcounting in add_buffer() and remove unneeded NULL checks 2017-04-04 15:24:45 +03:00
Sebastian Dröge
6b889bea69 qtmux: Select the best pad based on the cached last_buf if any
last_buf is the one we're going to write next, not buf. As such we
should check timestamps against that one if there is one to select the
earliest pad.

Also remember the currently selected pad in the very beginning when
storing the first last_buf.

This both solves some edge cases where not the correct next pad was
selected corresponding to the target interleave.
2017-04-04 15:24:45 +03:00
Sebastian Dröge
eb307baff4 qtmux: Error out immediately if a timecode is to be written but downstream return not-OK 2017-04-04 15:24:45 +03:00
Edward Hervey
1e4cdc6d6f qtdemux: Update variables before early exit
This is an update of d78d589627

We still exit as early as possible in case of non-ok/non-unlinked combined
flow, but we first make sure that we update the internal position variables.

This ensures that if upstreams "ignores" the flow return (and carries on pushing),
we don't end up processing data with completely bogus variables/positions.
2017-04-03 11:37:52 +02:00
Douglas Bagnall
a9f26c2a14 interleave: avoid using uninitialised ordering_map
If self->channel_positions == NULL (which seems unlikely),
self->default_channels_ordering_map will be used unintialised.

We avoid that by keeping track of the channel_mask, which is set when
the ordering map is initialised.

https://bugzilla.gnome.org/show_bug.cgi?id=780331
2017-03-31 14:10:34 +03:00
Douglas Bagnall
c08d719453 interleave: don't overflow channel map with >64 channels
When there are more than 64 channels, we don't want to exceed the
bounds of the ordering_map buffer, and in these cases we don't want to
rempa at all. Here we avoid doing that.

https://bugzilla.gnome.org/show_bug.cgi?id=780331
2017-03-31 14:10:34 +03:00
Sebastian Dröge
2b50a338c3 qtdemux: In gap mode, consider the mdat offset when calculating the remaining mdat size
The mdat generally does not start at offset 0, we have to include the
size of the moof and whatever else was in front of the mdat.
2017-03-27 21:52:51 +03:00
Sebastian Dröge
ea4e9fc2d4 atomsrecovery: Error out when fseek() fails instead of silently ignoring
CID 1403262
2017-03-27 11:43:57 +03:00
George Kiagiadakis
501bf0e8d1 rtpmux: fix output segment and buffer DTS to correspond to the flattened PTS
https://bugzilla.gnome.org/show_bug.cgi?id=780347
2017-03-24 11:09:46 +02:00
Sebastian Dröge
e66d75ec87 qtmux: Remove some unused variables 2017-03-23 17:53:54 +02:00
Sebastian Dröge
ebdaca603c qtmux: Remove a couple of unneeded levels of indentation 2017-03-23 15:02:03 +02:00
Enrique Ocaña González
28a57d0586 qtdemux: distinguish TFDT with value 0 from no TFDT at all
TFDTs with time 0 are being ignored since commit 1fc3d42f. They're
mistaken with the case of not having TFDT, but those two cases
must be distinguished in some way.

This patch passes an extra boolean flag when the TFDT is present.
This is now the condition being evaluated, instead of checking for
0 time.

https://bugzilla.gnome.org/show_bug.cgi?id=780410
2017-03-23 08:28:53 +11:00
Sebastian Dröge
9c121b09a5 qtmux: Reset current chunk after writing out timecode
If we have multiple tracks with timecodes, or it's not the first track
that has timecodes, or not the first buffer, we already started a chunk
for media data. We now need to "close" that chunk because we wrote data
for the timecode track and a new chunk has to be started for the
original track the next time it has data.
2017-03-22 19:16:33 +02:00
Sebastian Dröge
cb6aab8685 qtmux: Do timecode handling per track, not per muxer instance
There could be multiple video tracks with timecodes.
2017-03-22 18:53:19 +02:00
Jan Schmidt
d76bd1913f qtdemux: matroskademux: Ignore repeated seek events
Similar to what was done in adaptivedemux, ignore seek
events we've already handled - such as when they are received
on every srcpad of files with lots of streams.
2017-03-22 00:40:01 +11:00
Sebastian Dröge
a56a01f15f dashdemux: Update mdatleft from overall mdatsize and offset when observing a gap
Otherwise mdatleft will have a value calculated from the initial
mdatsize minus the parts of the stream that we saw, which is not
including all the parts of the stream that might've been skipped.
2017-03-21 14:56:55 +02:00
Tim-Philipp Müller
f26edcdf34 docs: update two references to the removed 'mad' plugin
https://bugzilla.gnome.org/show_bug.cgi?id=776140
2017-03-20 17:03:54 +00:00
George Kiagiadakis
3e91601fbb rtprtxqueue: add basic documentation and example pipelines
Mostly explaining the difference between rtprtxqueue and rtprtxsend.
2017-03-20 12:10:55 +02:00
George Kiagiadakis
ba606b96d3 rtprtxreceive: fix example pipelines and improve the documentation
https://bugzilla.gnome.org/show_bug.cgi?id=771383
2017-03-17 19:07:34 +02:00
Vincent Penquerc'h
f35238794c flacparse: fix playback if sample number does not start at 0
This reverts commit 29b807685d, while
fixing the original breaking tests/check/pipelines/flacdec.
2017-03-17 14:11:44 +00:00