3198 Commits

Author SHA1 Message Date
ibaker
947485e2b7 CEA-608: Position top-of-screen roll-up cues with bottom-line=row
Reasoning and screenshots here:
https://github.com/google/ExoPlayer/issues/7475#issuecomment-640770791

Issue: #7475
PiperOrigin-RevId: 315475888
2020-06-09 16:05:22 +01:00
christosts
d23ca7b11a Set MediaCodec operation mode for audio/video
Add experimental APIs to set the MediaCodecOperationMode separately
for audio and video.

PiperOrigin-RevId: 315467157
2020-06-09 16:05:11 +01:00
samrobinson
83758577e3 Temporary fix for gapless regression for MP3.
PiperOrigin-RevId: 315334491
2020-06-09 16:04:49 +01:00
bachinger
99d805f6a8 Make media item of SinglePeriodTimeline non-null
This change makes the media item argument in any constructors of the SinglePeriodTimeline non-null. Further a dummy media item is created for deprecated constructors using a tag only.

PiperOrigin-RevId: 315283842
2020-06-08 17:41:06 +01:00
aquilescanta
c37af0b543 Make ChunkExtractor return a ChunkIndex instead of a SeekMap
PiperOrigin-RevId: 315283645
2020-06-08 17:40:55 +01:00
ibaker
770df8636a CEA-608: Don't assume roll-up captions are at the bottom of the screen
ANSI/CTA-608-E R-2014 Annex B.5 says:
"The concept of a movable base row for a roll-up caption is new."

It means "new" compared to TC1 and TC2 (released in or before 1985).

Issue: #7475
PiperOrigin-RevId: 315258859
2020-06-08 17:40:44 +01:00
andrewlewis
bc7310240d Suppress repeated logging for invalid MP3 headers
PiperOrigin-RevId: 315243493
2020-06-08 17:40:22 +01:00
samrobinson
680d955851 Adjust input timestamps for the Codec2 MP3 decoder.
Output timestamps are calculated by the codec based on the buffers,
which is offset in Codec2. This adjusts the input timestamps as they
are passed in so they will match the output timestamps produced by
the MediaCodec.

PiperOrigin-RevId: 314963830
2020-06-08 17:40:11 +01:00
olly
226583f01c Reintroduce isConnected check for download requirements
PiperOrigin-RevId: 314925639
2020-06-05 15:39:25 +01:00
ibaker
ee0c6224af Respect 33-bit wraparound when calculating WebVTT timestamps in HLS
Issue: #7462
PiperOrigin-RevId: 314919210
2020-06-05 14:48:13 +01:00
krocard
8dedbbbfb4 Introduce an offload option to DefaultRederersFactory
This introduces an option to turn on offload in the
audio sink.

#exo-offload

PiperOrigin-RevId: 314907088
2020-06-05 13:06:15 +01:00
bachinger
97a80ac624 Make ConcatentatingMediaSource provide a dummy media item
PiperOrigin-RevId: 314904897
2020-06-05 13:06:06 +01:00
bachinger
60f907be6d Make FakeTimeline and FakeMediaSource provide a media item
FakeMediaSource and FakeTimeline should put a media item to the window just as other media sources and timelines do. This change provides a fake media item for both of them.

Further the MaskingMediaSource needs to provide a media item for when the real timeline of the masked media source is not available. This can be easily done by using mediaSource.getMediaItem() once available. For now a dummy is used to make ExoPlayerTest run green. This can be easily change to use mediaSource.getMediaSource as soon as this method is defined by the MediaSource interface.

PiperOrigin-RevId: 314897474
2020-06-05 13:05:48 +01:00
olly
08b0e08b69 Fix bug where SilenceMediaSource#getTag was always returning null.
SilenceMediaSource never overloaded MediaSource#getTag, and default behavior is to return null.

PiperOrigin-RevId: 314779832
2020-06-05 13:05:39 +01:00
krocard
1dedd080a4 Remove unnecessary TargetApi
This can hide errors as the lint is pretty smart
to understand SDK level checks.

PiperOrigin-RevId: 314728030
2020-06-05 13:05:29 +01:00
olly
9b5cab0478 Fix more cases of downloads not being resumed
Issue: #7453
PiperOrigin-RevId: 314710328
2020-06-04 14:16:31 +01:00
olly
c77e300249 Clean up debug logging
PiperOrigin-RevId: 314707946
2020-06-04 14:16:22 +01:00
bachinger
fb73a9dfc8 Make media item of Timeline.Window non-null
This change makes the media item of Timeline.Window non-null by providing a fallback media item in window.set(...). After having migrated all media sources this should not be needed anymore, but a fallback makes it more safe than just making the mediaItem argument of window.set(...) non-null (which is done in a following CL in this chain of CLs).

PiperOrigin-RevId: 314527983
2020-06-04 14:16:04 +01:00
kimvde
7df99381c1 Optimize extractors order using file extension
PiperOrigin-RevId: 314508481
2020-06-04 14:15:45 +01:00
olly
3904f6778a Fix position jank after pausing and seeking
Issue: #6901
PiperOrigin-RevId: 314418536
2020-06-02 23:52:17 +01:00
olly
720f0012a8 AudioTrackPositionTracker: Prevent negative timestamps
Issue: #7456
PiperOrigin-RevId: 314408767
2020-06-02 23:52:08 +01:00
ibaker
9699889569 Assert that a negative extractor sniff never advances the read position
Extractor#sniff() javadoc says:
"If true is returned, the input's reading position may have been
modified. Otherwise, only its peek position may have been modified."
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/extractor/Extractor.html#sniff-com.google.android.exoplayer2.extractor.ExtractorInput-

PiperOrigin-RevId: 314296922
2020-06-02 23:51:33 +01:00
krocard
a5067e6314 Implement offload AudioTrack in DefaultAudioSink.
#exo-offload

PiperOrigin-RevId: 314288300
2020-06-02 23:51:15 +01:00
bachinger
75e54a452a Use identical media item for constructor if possible
If no deprecated methods on the factory is called, the media item instance that is passed to the createMediaSource method must be passed down to the constructor of the media source.

PiperOrigin-RevId: 314193865
2020-06-02 23:51:06 +01:00
olly
2f3c7cb85f Revert pushing download thread interruption into the Downloader implementations
Issue: #5978
PiperOrigin-RevId: 314175257
2020-06-02 23:50:56 +01:00
Ian Baker
8b89a5ed6d Merge pull request #6861 from chrisfillmore:feature/responseBodyForInvalidResponseCodeException_6853
PiperOrigin-RevId: 314105612
2020-06-01 15:00:08 +01:00
olly
f60d5a144f Remove logging that was submitted in error
PiperOrigin-RevId: 313806075
2020-05-29 18:35:10 +01:00
Oliver Woodman
496a315d91 Merge pull request #7395 from jdegroot-dss:add-storage-not-low-requirement
PiperOrigin-RevId: 313804207
2020-05-29 18:34:58 +01:00
olly
235df090fd Support multiple non-overlapping write locks in SimpleCache
Issue: #5978
PiperOrigin-RevId: 313802629
2020-05-29 18:34:47 +01:00
olly
cf726f0c60 Improve SimpleCacheTest
PiperOrigin-RevId: 313630376
2020-05-29 18:34:19 +01:00
tonihei
37024ae450 Add named constant for group indices.
PiperOrigin-RevId: 313596831
2020-05-29 18:33:52 +01:00
tonihei
4419a26bbb Use assertThrows in CacheWriterTest.
PiperOrigin-RevId: 313556143
2020-05-29 18:33:15 +01:00
olly
a01fd007cb Change setOutputSurfaceV23 visibility.
PiperOrigin-RevId: 313481722
2020-05-29 18:33:06 +01:00
Joris de Groot
2af9b4b066 Updated documentation 2020-05-28 14:55:02 +02:00
Oliver Woodman
82e199445a Merge pull request #7422 from noamtamim:bandwidthmeter-5g
PiperOrigin-RevId: 313372995
2020-05-27 19:01:12 +01:00
aquilescanta
32c356177f Extract a ChunkExtractor interface
A future implementation will depend on MediaParser.

PiperOrigin-RevId: 313367998
2020-05-27 19:01:02 +01:00
olly
d88f5f47e6 Turn CacheUtil into stateful CacheWriter
- The new CacheWriter is simplified somewhat
- Blocking on PriorityTaskManager.proceed is moved out of
  CacheWriter and into the Downloader tasks. This is because
  we want to shift only the caching parts of the Downloaders
  onto their Executors, whilst keeping the blocking parts on
  the main Downloader threads. Else we can end up "using"
  the Executor threads indefinitely whilst they're blocked.

Issue: #5978
PiperOrigin-RevId: 313222923
2020-05-27 19:00:53 +01:00
ibaker
a1c72c0daf Add .inOrder() to most AnalyticsCollectorTest asserts
I skipped it where it didn't make sense (e.g. singleton lists, or lists
where all elements are identical).

PiperOrigin-RevId: 313217398
2020-05-27 19:00:44 +01:00
krocard
151ea531b1 Make constants more readable with _ separator
Add an `_` in long constants.
Eg: 10000 => 10_000.

I'm proposing this change because I have had multiple
missread due to confusing the number of 0 in a long number.

More specifically, added an underscore to all number matching:
`final.*\ [0-9]{2,}000;`

PiperOrigin-RevId: 313186920
2020-05-27 19:00:36 +01:00
tonihei
45b574d593 Fix flaky test.
The test was flaky because it didn't wait for pending commands to finish
after pausing the test playback.

Also add more debug information to the toString() method because the
expected and actual state only differed in the nextAdGroupIndex in the
flaky case.

PiperOrigin-RevId: 313175919
2020-05-27 19:00:27 +01:00
tonihei
0add067eaa Make fallback value more explicitly unset.
PiperOrigin-RevId: 313171970
2020-05-27 19:00:18 +01:00
olly
03ea39b175 ConditionVariable: Add uninterruptible block
Sometimes it's useful to be able to block until something on some other thread
"really has finished". This will be needed for moving caching operations onto
the executor in Downloader implementations, since we need to guarantee that
Downloader.download doesn't return until it's no longer modifying the
underlying cache.

One solution to this is of course just to not interrupt the thread that's
blocking on the condition variable, but there are cases where you do need to do
this in case the thread is at some other point in its execution. This is true
for Downloader implementations, where the Download.download thread will also
be blocking on PriorityTaskManager.proceed. Arranging to conditionally
interrupt the thread based on where it's got to is probably possible, but seems
complicated and error prone.

Issue: #5978
PiperOrigin-RevId: 313152413
2020-05-27 19:00:09 +01:00
tonihei
ee11d9d6fb Make manifest loads on timeline refresh optional in FakeMediaSource.
Every timeline refresh currently assumes that it corresponds to a manifest
refresh and issues the respective load events. However, there are other
timeline updates that don't have a manifest refresh (e.g. ad state updates)and thus shouldn't issue these events.

PiperOrigin-RevId: 313150489
2020-05-27 19:00:00 +01:00
Noam Tamim
cf2214ddaa
Assume default 4G (instead of Wifi) bitrate for 5G 2020-05-24 15:20:18 +03:00
tonihei
dac3dde7bb Fix comparison in ChunkSampleStream.
A recent change tried to make this condition clearer by using Integer.MAX_VALUE, but
this only works if the comparison also compares against larger values.

PiperOrigin-RevId: 312697530
2020-05-21 18:43:13 +01:00
tonihei
80eb5d4235 Merge pull request #7244 from tvarga-dss:cancel-hls-chunk-download-and-discard-upstream
PiperOrigin-RevId: 312679454
2020-05-21 17:10:51 +01:00
andrewlewis
1bc8503a9b Check DefaultAudioSink supports passthrough
Previously if the AudioCapabilities reported that an encoding/channel count was
supported, DefaultAudioSink could try to play it via passthrough. However,
DefaultAudioSink does not support passthrough of every possible format (for
example, it's likely that AAC passthrough does not work given it's never been
tested and recent GitHub issues indicate that trying to use it leads to no
audio being played).

Add additional checks to make sure the encoding is in the list of encodings that
are known to work with passthrough in DefaultAudioSink.

issue:#7404
PiperOrigin-RevId: 312651358
2020-05-21 17:10:20 +01:00
olly
4384ef5b73 Make CacheUtil only about writing
A subsequent change will rename it to CacheWriter and make it instantiable.

Issue: #5978
PiperOrigin-RevId: 312648623
2020-05-21 17:10:11 +01:00
christosts
1154e8098a Rollback of 78c850a885
*** Original commit ***

Remove set timeout on release() and setSurface()

Removes the experimental methods to set a timeout when
releasing the player and setting the surface.

***

PiperOrigin-RevId: 312647457
2020-05-21 17:10:01 +01:00
olly
63522ea554 Improve CacheKeyFactory documentation
- To make it clear that cache keys are for whole resources
- To explicitly make it clear to implementors that deriving a cache key
  from position and length is invalid. We've seen at least one developer
  trying to do this [1], so it seems worthwhile to be explicit!

[1] https://github.com/google/ExoPlayer/issues/5978#issuecomment-618977036

Issue: #5978
PiperOrigin-RevId: 312643930
2020-05-21 17:09:41 +01:00