7900 Commits

Author SHA1 Message Date
Oliver Woodman
91d2d8b40e Merge pull request #6836 from DolbyLaboratories:dev-v2-refineAC4
PiperOrigin-RevId: 288772277
2020-01-17 13:56:09 +00:00
kimvde
42897b26c7 FlacExtractor: add condition for zero-length reads
This improves readability by making clearer that reading no bytes from
the input in readFrames() is an expected case if the buffer is full.

PiperOrigin-RevId: 288711841
2020-01-17 13:56:03 +00:00
tonihei
6395d44bfa Disable chronometer for playback speeds != 1.0
This doesn't work because the Chronometer text layout can only count in realtime.

Issue:#6816
PiperOrigin-RevId: 288711702
2020-01-17 13:55:58 +00:00
andrewlewis
e1a110e651 Fix TrueHD chunking in Matroska
Issue: #6845
PiperOrigin-RevId: 288688716
2020-01-17 13:55:49 +00:00
kimvde
7fe55cd468 Use FlacLibrary.isAvailable in FlacExtractor selection
PiperOrigin-RevId: 288667790
2020-01-17 13:55:40 +00:00
olly
bf9a61d62f Upgrade OkHttp library to fix HTTP2 issue
Issue: #4078
PiperOrigin-RevId: 288651166
2020-01-17 13:55:24 +00:00
olly
eb0acb4155 Fix playback for Vivo codecs that output non-16-bit audio
PiperOrigin-RevId: 288468497
2020-01-17 13:55:02 +00:00
kimvde
d1839f141a Add comment explaining FlacBinarySearchSeeker output
PiperOrigin-RevId: 288464154
2020-01-17 13:54:58 +00:00
olly
20e7684c6c FlacExtractor: Fix possible skipping of frame boundaries
PiperOrigin-RevId: 288304477
2020-01-17 13:54:47 +00:00
kimvde
be3257e87a Simulate IO exceptions in all FlacExtractor tests
- Simulate IO exceptions in the test using FlacBinarySearchSeeker for
  seeking in FlacExtractorTests. This makes the test slower but covers
  more test cases.

PiperOrigin-RevId: 288285057
2020-01-17 13:54:37 +00:00
olly
1f85cd9afe Remove WavExtractor from the nullness blacklist
PiperOrigin-RevId: 288292488
2020-01-17 13:54:33 +00:00
tonihei
d609c3b666 Support 5G in network type detection
PiperOrigin-RevId: 288280500
2020-01-17 13:54:27 +00:00
ibaker
63eaf1144c Fix MatroskaExtractor to use blockDurationUs not durationUs
This typo was introduced in ddb70d96ad
when migrating a static method with parameter `durationUs` to an
instance method where the correct field to use was `blockDurationUs`
(but `durationUs` also exists).

The test that catches this was only added in 45013ece1e (and
therefore configured with the wrong expected output data).

issue:#6833
PiperOrigin-RevId: 288274197
2020-01-17 13:53:43 +00:00
kimvde
1b764c2d30 Add unit tests to FLAC extractor related classes
PiperOrigin-RevId: 287973192
2020-01-17 13:52:54 +00:00
olly
97be06529c Use MIME types rather than PCM encodings for ALAW and MLAW
PiperOrigin-RevId: 287999703
2020-01-17 13:52:47 +00:00
andrewlewis
1f505fa9fd Show ad markers after the window duration
Issue: #6552
PiperOrigin-RevId: 287964221
2020-01-17 13:52:39 +00:00
olly
90a67b59c5 Add support for IMA ADPCM in WAV
PiperOrigin-RevId: 287854701
2020-01-17 13:52:33 +00:00
olly
ef0066f08a Support twos codec in MP4
Issue: #5789
PiperOrigin-RevId: 287828559
2020-01-17 13:52:29 +00:00
olly
0e1670bb23 Document overriding of drawables for PlayerControlView
Issue: #6779
PiperOrigin-RevId: 287828273
2020-01-17 13:52:24 +00:00
olly
b36c5e9973 Document overriding drawables for notifications
Issue: #6266
PiperOrigin-RevId: 287821640
2020-01-17 13:52:20 +00:00
andrewlewis
7fd0b1d872 Fix handling of E-AC-3 streams with AC-3 frames
Issue: #6602
PiperOrigin-RevId: 287816831
2020-01-17 13:52:16 +00:00
olly
1edcc6c4f7 Don't use WavHeader.averageBytesPerSecond
It's unreliable for at least one IMA ADPCM file I've found.
Calculating the blockIndex to seek to using exact properties
also seems more robust.

Note this doesn't change anything for the existing PCM test,
since averageBytesPerSecond is set correctly. It does make
a difference for an upcoming IMA ADPCM test though.

PiperOrigin-RevId: 287814947
2020-01-17 13:52:11 +00:00
andrewlewis
3cf88bb48b Fix typos
PiperOrigin-RevId: 287810018
2020-01-17 13:52:06 +00:00
olly
3bce2138c1 Fix handling of network transitions in RequirementsWatcher
Issue: #6733
PiperOrigin-RevId: 286621715
2020-01-17 13:51:34 +00:00
olly
355b3afabd Read arrays directly from Parcel
PiperOrigin-RevId: 286197990
2020-01-17 13:50:52 +00:00
krocard
54f6f4823a Parse MP3 header to retrieve the nb of sample per frames
Add support for MP3 as an encoding format for passthrough.

This change does not change the observable
behavior of Exoplayer.

Also name the magics.

#exo-offload

PiperOrigin-RevId: 286146539
2020-01-17 13:50:43 +00:00
kimvde
37e65ec0f2 Add FlacExtractorSeekTest
PiperOrigin-RevId: 285823771
2020-01-17 13:50:12 +00:00
kimvde
fcac5af82d Fix FlacExtractor construction
Fix the FlacExtractor constructor for the case where seek(0,0) is not called before reading.

PiperOrigin-RevId: 285811161
2020-01-17 13:50:04 +00:00
kimvde
bf9f49a91b Implement seeking from seektable in FLAC extractor
PiperOrigin-RevId: 285799995
2020-01-17 13:50:01 +00:00
olly
7bd912f895 Clean up WavExtractor PCM output
- Make extractor output samples that are uniformly distributed
  with respect to time, with a target of ~10 samples per second.
  The old approach could in theory put every frame into its own
  sample, which would be very inefficient downstream because we'd
  need to pass them individually to MediaCodec. It could also put
  data corresponding to a long duration of time into a single
  sample (e.g. if the sample rate of the content is low), which
  is bad downstream because we decide whether to set the decodeOnly
  flag on a per sample basis. More generally, the new approach
  is more predictable :).

- Stop using the WavSeekMap to get sample timestamps, and instead
  calculate them directly from the number of frames output. It's
  more obviously correct, particularly for data formats like IMA
  ADPCM where we'll need to adjust the data prior to output.

PiperOrigin-RevId: 285750010
2020-01-17 13:49:57 +00:00
andrewlewis
27b06e9ad9 Fix ParameterName warnings in core tests
PiperOrigin-RevId: 285716982
2020-01-17 13:49:29 +00:00
olly
80e3152e8c Make it easier to update extractor test dump files
PiperOrigin-RevId: 285407744
2020-01-17 13:49:18 +00:00
olly
052550e90e Rename getPhysicalDisplaySize to getCurrentDisplayModeSize
PiperOrigin-RevId: 285405910
2020-01-17 13:49:05 +00:00
ibaker
18cdd8ece2 Add ISO-8859-1 awareness to IcyDecoder
Also change IcyInfo.rawMetatadata from String to byte[]

ICY doesn't specify the character encoding, and there are streams
not using UTF-8 (issue:#6753). It seems the default of at least one
server is ISO-8859-1 so let's support that as a fallback:
https://github.com/savonet/liquidsoap/issues/411#issuecomment-288759200

Also update IcyDecoder to skip strings it doesn't recognise at all
instead of decoding invalid characters.

The feed from issue:#6753 now decodes accents correctly:
EventLogger:   ICY: title="D Pai - Le temps de la rentrée", url="null"
PiperOrigin-RevId: 285388522
2020-01-17 13:46:57 +00:00
tonihei
5737815ee8 Remove API version dependency of Util.normalizeLanguageCode
We previously used Locale.fromLanguageTag and then toLanguageTag to automatically
filter out invalid tags and to replace deprecated tags. However, this only works
for API 21+.

This change does no longer rely on the platform methods and instead:
 1. Keeps invalid tags as they are. This may help if developers rely on
    non-spec-complaint language tags (for example, #6681).
 2. Adds a list of deprcated tags and their modern replacements to our code
 3. Normalizes some short codes that have been superseded by macrolanguage codes by
    their macrolanguage equivalent.

Issue:#6681
PiperOrigin-RevId: 285384841
2020-01-17 13:43:30 +00:00
kimvde
c832896247 Refactor sample number computation in FLAC seeking
Retrieve the sample number in the extractor instead of passing a holder
to FlacBinarySearchSeeker. This change makes the code easier to
understand and is required to implement the seeking from the seek table.

PiperOrigin-RevId: 285241862
2020-01-17 13:43:16 +00:00
olly
4ea913fc78 Create WavExtractor.OutputWriter to handle different data formats
- Create PcmOutputWriter for PCM.
- In a future change an ImaAdPcmOutputWriter will be introduced
  for IMA ADPCM support.

PiperOrigin-RevId: 285238246
2020-01-17 13:43:12 +00:00
olly
d62dc9dcfb Remove assumption that WAV files only contain PCM encoded data
- WavHeader is now immutable and contains only values parsed out
  of the WAVE FMT chunk. It no longer contains a C.PcmEncoding
  encoding, or mutable data bounds.
- WavHeaderReader now parses the WAVE header chunks without any
  additional logic (e.g. validating the block alignment value,
  which is format type dependent).
- The SeekMap part of WavHeader is split out into WavSeekMap.

PiperOrigin-RevId: 285232498
2020-01-17 13:43:07 +00:00
olly
1144926380 Add WavHeader.samplesPerBlock (currently always == 1)
PiperOrigin-RevId: 284961417
2020-01-17 13:42:34 +00:00
kimvde
fe61cfee2c Remove duplicated logic in FlacReader
PiperOrigin-RevId: 284952647
2020-01-17 13:42:30 +00:00
kimvde
910bd8bdc5 Implement binary search seeking for FLAC extractor
PiperOrigin-RevId: 284814594
2020-01-17 13:42:07 +00:00
ibaker
4ed512d611 Fix javadoc warnings exposed by -Xdoclint
PiperOrigin-RevId: 284776943
2020-01-17 13:40:49 +00:00
kimvde
ff1efd4ec2 Add peek() method to ExtractorInput
PiperOrigin-RevId: 284537150
2020-01-17 13:39:27 +00:00
kimvde
24afcdc36b Remove TODO for supporting streams in Java FLAC extractor
Flac streams exist but are not commonly used. Also, they are not
supported by the FLAC extension extractor.

PiperOrigin-RevId: 284514327
2020-01-17 13:39:18 +00:00
kimvde
54413c26d4 Make metadata field nullable in FlacStreamMetadata
This makes the format metadata null (instead of an empty Metadata
object) when it is not provided, and is therefore consistent with the
other extractors behavior.

PiperOrigin-RevId: 284171148
2020-01-17 13:37:58 +00:00
olly
a5ee17ec26 Fix casting to not need warning suppression
Also remove getRendererCapabilities arg that's now always null.

PiperOrigin-RevId: 283966795
2020-01-17 13:36:55 +00:00
andrewlewis
023e141be8 Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2020-01-17 13:36:40 +00:00
aquilescanta
0a0a478294 Add a test for SampleQueue capacity increases
Also remove redundant line

PiperOrigin-RevId: 283956203
2020-01-17 13:36:33 +00:00
aquilescanta
14897fb6df Invert the ownership scheme between SampleQueue and SampleMetadataQueue
Saves around 200 lines of code. High level overview:
- Rename SampleQueue to SampleDataQueue.
- Rename SampleMetadataQueue to SampleQueue.

This CL should not introduce behavior changes. The only significant
changes in synchronization should be:
+ Add synchronized keyword to isReady.
  - Seems to be necessary.
+ Add synchronized keyword to SampleQueue.sampleMetadata.
  - Before this change, SampleQueue.sampleMetadata could acquire the
    SampleMetadataQueue lock three times in a single method call.

Other miscellaneous improvements:
+ Put all private methods at the bottom.
+ Move release() to the right category.

PiperOrigin-RevId: 283795844
2020-01-17 13:36:09 +00:00
aquilescanta
9974670cc7 Make DownloadHelper pass DrmSessionManager to MediaSources
PiperOrigin-RevId: 283795201
2020-01-17 13:35:21 +00:00