gstreamer/gst/isomp4
Charlie Turner 39d32b2394 qtdemux: Find mp4a esds atoms in protected streams sample description tables.
This problem was found in Test. 2 of the YouTube 2018 EME
tests[1]. The code was accidentally not finding an mp4a's esds atom in
the sample description table when the stream was encrypted. It assumed
that if the stream is protected, then only an enca atom will be found
here. What happens with YouTube is they often provide protected
content with a few seconds of clear content, and then switch to the
encrypted stream.

The failure case here was an incorrect codec_data field being sent
into aacparse. The advertisement of stereo audio @ 44.1kHz for the
mp4a (unprotected) stream was incorrect. As usual, the esds contained
the real values here which were mono at 22050 Hz.

Here's what the MP4 tree looks like for these types of files,
demonstrating why the code was making a wrong assumption (or maybe
YouTube is being unusual),

[ftyp] size=8+16
...
[moov] size=8+1571
...
  [trak] size=8+559
...
          [stsd] size=12+234
            entry-count = 2
            [enca] size=8+147
              channel_count = 2
              sample_size = 16
              sample_rate = 44100
              [esds] size=12+27
                ...
            ...
            [mp4a] size=8+67
              channel_count = 2
              sample_size = 16
              sample_rate = 44100
              [esds] size=12+27
                ...

In addition to fixing this, the checks for esds atoms in mp4a and mp4v
have been made symmetrical. While I haven't seen a test case for video
with the same problem, it seemed better to make the same checks. This
also fixes a crash reported from another user[2], they also noted the
asymmetry with mp4v and mp4a.

[1] https://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/2018.html?test_type=encryptedmedia-test
[2] https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/398
2019-03-15 12:41:33 +00:00
..
atoms.c qtmux: round to nearest when computing mehd and tkhd duration 2018-10-27 13:12:56 +01:00
atoms.h isomp4: qtmux: Add Closed Caption support 2018-04-23 15:58:10 +02:00
atomsrecovery.c gst-plugins-good: atoms_recovery: Handled buffer mapping failure 2017-10-24 22:04:27 -07:00
atomsrecovery.h atomsrecovery: read from mdat only what is on headers 2017-10-24 21:33:25 -07:00
descriptors.c qtdemux: Fix calcuation of descriptor length 2013-12-23 15:09:49 +01:00
descriptors.h Fix FSF address 2012-11-04 00:07:18 +00:00
fourcc.h qtdemux: Recognize more AV1 atoms 2018-07-26 14:14:53 -04:00
gstisoff.c qtdemux: Apply qtdemux debug category to gstisoff 2018-01-29 18:40:02 +00:00
gstisoff.h isomp4: Redefine gst_isoff_ symbols to gst_isoff_qt_ 2015-02-17 12:31:06 +01:00
gstqtmoovrecover.c atomsrecovery: read from mdat only what is on headers 2017-10-24 21:33:25 -07:00
gstqtmoovrecover.h Fix FSF address 2012-11-04 00:07:18 +00:00
gstqtmux-doc.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:35:17 +01:00
gstqtmux-doc.h isomp4mux: fix copy and paste 2014-02-18 22:35:45 +01:00
gstqtmux.c qtmux: Only write timecode trak for video 2019-02-08 14:13:46 +02:00
gstqtmux.h qtmux: Add property for providing a threshold after which we create an edit list for gaps at the start 2018-10-22 12:29:23 +01:00
GstQTMux.prs qtmux: Implement the preset interface. 2016-09-01 13:16:49 +03:00
gstqtmuxmap.c isomp4: Replace GST_VIDEO_CAPTION_TYPE_CEA608_IN_CEA708_RAW with CEA608_S334_1A 2018-12-15 21:31:20 +00:00
gstqtmuxmap.h isomp4: qtmux: Add Closed Caption support 2018-04-23 15:58:10 +02:00
gstrtpxqtdepay.c good: use new gst_element_class_add_static_pad_template() 2016-03-24 14:32:20 +02:00
gstrtpxqtdepay.h Fix FSF address 2012-11-04 00:07:18 +00:00
isomp4-plugin.c Don't use setlocale in plugins() 2013-09-01 21:18:38 +01:00
LEGAL quicktime: rename plugin to isomp4 2011-04-30 17:58:02 +01:00
Makefile.am qtdemux: Apply qtdemux debug category to gstisoff 2018-01-29 18:40:02 +00:00
meson.build Meson: Generate pc file for all plugins in good 2018-04-25 11:07:06 +01:00
properties.c Fix FSF address 2012-11-04 00:07:18 +00:00
properties.h docs: fix "Symbol name not found at the start of the comment block" 2015-07-07 17:12:02 +02:00
qtatomparser.h Fix FSF address 2012-11-04 00:07:18 +00:00
qtdemux.c qtdemux: Find mp4a esds atoms in protected streams sample description tables. 2019-03-15 12:41:33 +00:00
qtdemux.h qtdemux: Use GPtrArray to store QtDemuxStream structure 2018-10-19 14:44:43 +02:00
qtdemux_debug.h qtdemux: Apply qtdemux debug category to gstisoff 2018-01-29 18:40:02 +00:00
qtdemux_dump.c qtdemux: Add initial support for AV1 demuxing 2018-07-26 14:14:53 -04:00
qtdemux_dump.h isomp4: Add gmhd/gmin debugging 2018-01-31 19:12:48 +01:00
qtdemux_lang.c qtdemux: Apply qtdemux debug category to gstisoff 2018-01-29 18:40:02 +00:00
qtdemux_lang.h Fix FSF address 2012-11-04 00:07:18 +00:00
qtdemux_types.c qtdemux: Recognize more AV1 atoms 2018-07-26 14:14:53 -04:00
qtdemux_types.h qtdemux: handle default-base-is-moof flag 2015-08-05 18:12:45 -03:00
qtpalette.h Fix FSF address 2012-11-04 00:07:18 +00:00