10943 Commits

Author SHA1 Message Date
olly
858fa26e3a Force PlayReady license URL
The media specifies a URL that uses http rather than https, which the
demo app doesn't permit by default. The URL here is the same except it
uses https instead.

#minor-release

PiperOrigin-RevId: 348445571
2021-01-11 16:14:34 +00:00
Oliver Woodman
2b8cfcf2ec Merge pull request #8357 from TiVo:p-fix-cea708anchor
PiperOrigin-RevId: 348440799
2021-01-11 16:14:34 +00:00
krocard
011342f4cf Explicitly fail playback if new format has no sampleMimeType
This avoids a NullPointerException later when the format is used.

Fixes https://github.com/google/ExoPlayer/issues/8283.

PiperOrigin-RevId: 348017149
2021-01-11 16:14:34 +00:00
christosts
c22fd76b6b HlsPlaylistParser: ignore subtitles without URI
Issue: #8323
PiperOrigin-RevId: 347827615
2021-01-11 16:14:34 +00:00
ibaker
d0e6dec199 Fix EPI.seekTo to balance operation acks when seeking during an ad
This regression was introduced in
b1e9257de1

Issue: #8349

PiperOrigin-RevId: 347802049
2021-01-11 16:14:34 +00:00
andrewlewis
ffa746f390 Fix checking imaAdMediaInfo nullness
It's intended to log a warning in this case, rather than throw.

Issue: #8290

PiperOrigin-RevId: 347790527
2021-01-11 16:14:34 +00:00
krocard
125de92989 Clarify EventLogger Window log
PiperOrigin-RevId: 347789441
2021-01-11 16:14:34 +00:00
sungsoo
a015b7ec82 Make media2 extension depend on androidx media2 1.1.0
Issue: #8011
PiperOrigin-RevId: 347288689
2021-01-11 16:14:33 +00:00
olly
3a0b1f7da7 Fix UI menu not dismissing on API level 22 and earlier
Issue: #8272
PiperOrigin-RevId: 347010412
2021-01-11 16:13:29 +00:00
olly
a028ce8964 Fix missing Javadoc
PiperOrigin-RevId: 346764371
2021-01-11 16:13:28 +00:00
bachinger
fa0cc1e15f Improve javadoc of Window.windowStartTimeMs
PiperOrigin-RevId: 346346359
2021-01-11 16:13:28 +00:00
kimvde
6db6d14b16 Throw ParserException if AAC config is invalid
Issue:#8295
PiperOrigin-RevId: 346064966
2021-01-11 16:13:28 +00:00
aquilescanta
ab6b167ee0 Add iso9 to the list of supported MP4 brands
Issue: #8308
#minor-release
PiperOrigin-RevId: 345707141
2021-01-11 16:13:28 +00:00
ibaker
2195facd85 Gracefully handle null-terminated subtitle content in MKV containers
This was reported for SSA/ASS in PR #8265, but it seems to me the
SubRip part of the Matroska spec is similarly loose, so this change
handles null-terminated strings in both.

PiperOrigin-RevId: 345452667
2021-01-11 16:13:07 +00:00
Oliver Woodman
8c935e366c Merge pull request #8154 from samoylenkodmitry:handle_out_of_space
PiperOrigin-RevId: 345428731
2021-01-11 16:12:36 +00:00
andrewlewis
2516e94eb9 Fix SonicAudioProcessor end of stream behavior
The `AudioProcessor` interface requires that no more input is queued after
queueing end of stream, but `DefaultAudioSink` did queue more input and the
implementation of `SonicAudioProcessor` actually relied on this to drain output
at the end of the stream.

Fix this behavior by getting `Sonic` output in `getOutput` and having
`DefaultAudioSink` only queue input to processors that are not draining.

Also add TODOs to clean up audio processor implementations where the code
handles interaction that doesn't conform to the interface.

PiperOrigin-RevId: 345406478
2021-01-11 16:12:36 +00:00
ibaker
35173a016b Add an MKV asset with SSA subtitles for extractor and playback tests
Asset generated using a temporary SSA file and:
```
$ mkvmerge -o sample_with_ssa_subtitles.mkv sample.mkv input.ssa
```

PiperOrigin-RevId: 345217628
2021-01-11 16:12:24 +00:00
Oliver Woodman
953e4e89e2 Merge pull request #8414 from tidoemanuele:tidoemanuele-improve-non-2xx-message
PiperOrigin-RevId: 350797551
2021-01-08 19:09:15 +00:00
olly
a7379ee658 PlayerEmsgHandler: Track stream max chunk times separately
Issue: #8408
PiperOrigin-RevId: 350786430
2021-01-08 18:48:21 +00:00
olly
c1529c46d8 Fix flaky DownloadManager test
#minor-release

PiperOrigin-RevId: 350782940
2021-01-08 17:55:34 +00:00
Oliver Woodman
495347d3c0 Merge pull request #8215 from TiVo:p-fix-apple-iframe-bug
PiperOrigin-RevId: 345202157
2021-01-08 16:52:25 +00:00
olly
eb38a63e36 Mini release note tweaks
PiperOrigin-RevId: 345036042
2021-01-08 16:52:25 +00:00
andrewlewis
fe754f313e Mask ad media periods before the URI is available
Previously `MediaPeriodQueue` would return null if an ad media URI hadn't
loaded yet, but this meant that the player could be stuck in `STATE_READY` if
an `AdsLoader` unexpectedly didn't provide an ad URI. Fix this behavior by
masking ad media periods. `MaskingMediaPeriod` no longer requires a
`MediaSource` to instantiate it.

This also fixes a specific case where playback gets stuck when using the IMA
extension with an empty ad where the IMA SDK unexpectedly doesn't notify the ad
group fetch error.

Issue: #8205
PiperOrigin-RevId: 344984824
2021-01-08 16:52:25 +00:00
bachinger
d8df5411b8 Fix flaky test
PiperOrigin-RevId: 334801561
2021-01-08 16:46:18 +00:00
ibaker
06942116bd Propagate LoadErrorHandlingPolicy to SingleSampleMediaSource.Factory
I think this was missed when integrating DefaultMediaSourceFactory with
SingleSampleMediaSource.Factory in
315ba6f324

Issue: #8430
#minor-release
PiperOrigin-RevId: 350759580
2021-01-08 15:33:43 +00:00
ibaker
b1cf04f22c Tweak comment in PgsDecoder to match the structure of the data
The Palette Definition Segment is documented here, you can is it goes:
luminance (y), red (cr), blue (cb), alpha

http://blog.thescorpius.com/index.php/2017/07/15/presentation-graphic-stream-sup-files-bluray-subtitle-format/

(I think it's important to be really precise here, because YCbCr is a
very common format, so this ordering is slightly unusual:
https://en.wikipedia.org/wiki/YCbCr)

PiperOrigin-RevId: 350747808
2021-01-08 15:33:31 +00:00
christosts
04250031bc Synchronize initialization of DefaultDownloadIndex
There is a race condition when initializing the downloads database. The
constructor of the DownloadManager kicks-off the database initialization
in its internal thread, but at the same time an app can try to access
the database directly through the manager's download index, e.g. doing

DonwloadManager manager = new ...
manager.getDownloadIndex().getDownload("id");

might enter DefaultDownloadIndex.ensureInitialized() from two threads.
When upgrading the downloads table from version 2 to version 3, the
first thread that enters the database transaction in ensureInitialized()
will drop and recreate the table using the v3 schema. Then, the second
thread will attempt to read from the newly created table using the v2
schema, which will fail.

This race condition was not introduced in 2.12 but was there already.
However, prior to 2.12, the code only dropped and re-created and the
table and did not attempt to read any data. Hence, if the race condition
happened, the code would drop and create the table twice, but no error
would occur.

Issue: #8420
#minor-release
PiperOrigin-RevId: 350745463
2021-01-08 15:33:21 +00:00
Alexey Rochev
ff8c8645ab Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572ef9ce79aacd667cfffa7d7468c8408a4

Issue: #8393
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ExoPlayer/pull/8401 from equeim:hevc-codecs e582fb91b73c7c95e754167140211d5473c36d14
PiperOrigin-RevId: 350738065
2021-01-08 15:33:09 +00:00
olly
eded1ca106 Update Styled non bottom buttons to be borderless.
This requires the parent of the background to draw and have padding large enough to support the size of the ripple.

The bottom buttons must remained bordered as the space around them is constrained.

PiperOrigin-RevId: 350590722
2021-01-08 15:32:58 +00:00
ibaker
1057f2e455 Remove mobile_test_v22 while the V22 tests are disabled
PiperOrigin-RevId: 350578598
2021-01-08 15:32:47 +00:00
tonihei
2480e0a477 Add option to align durations of MergingMediaSource.
Without this feature it's impossible to nicely merge multiple sources
with different durations if these durations are not known exactly
before the start of playback.

Issue: #8422
PiperOrigin-RevId: 350567625
2021-01-08 15:32:37 +00:00
tonihei
1ef06b8d92 Rename sample_mpd to sample_mpd_live
This helps to better disambiguate the file from other mpd files in the
directory.

PiperOrigin-RevId: 350552168
2021-01-08 15:32:26 +00:00
ibaker
a25ad03b9f Disable DashWidevineOfflineTest
These tests are performing offline-centric assertions using a streaming
licence. They need to be reconfigured to use a new offline-centric
licence that sets the correct duration fields (rental_duration_seconds
and playback_duration_seconds).

PiperOrigin-RevId: 350550971
2021-01-08 15:32:16 +00:00
tonihei
c2d7fae535 Add preferred MIME type(s) to DefaultTrackSelector parameters.
This allows to set preferences based on MIME type for video and audio.
The MIME type preference is applied after other explicit preferences
and restrictions (e.g. language or max resolution), but before implicit
preferences like bitrate.

Issue: #8320
PiperOrigin-RevId: 350550543
2021-01-08 15:32:05 +00:00
bachinger
6e8af81ddc Reload HLS media playlist when merging delta update fails
Issue: #5011
PiperOrigin-RevId: 350550204
2021-01-08 15:31:54 +00:00
krocard
6dec83238b Enable setOutputSurface workaround for Xiaomi Mi Box S
Reported by https://github.com/google/ExoPlayer/issues/8329.

PiperOrigin-RevId: 350547523
2021-01-08 15:31:43 +00:00
olly
a7cb6a02e4 Rollback of 1347d572ef
*** Original commit ***

Restore old SampleQueue exoMediaCryptoType behavior

***

PiperOrigin-RevId: 350545215
2021-01-08 15:31:32 +00:00
bachinger
b05fa731d8 Propagate segment properties when merging HLS delta updates
Issue: #5011
PiperOrigin-RevId: 350540152
2021-01-08 15:31:22 +00:00
christosts
fc3b91c96c Add assertion in MediaCodec adapter
Add assertion to check an output format has been propagated before
returning an output buffer when operating MediaCodec in asynchronous
mode.

PiperOrigin-RevId: 350534918
2021-01-08 15:31:10 +00:00
Alexey Rochev
377a3250f0 H265Reader: initialize correct Format.height for interlaced video 2021-01-07 20:15:14 +03:00
andrewlewis
456622a275 Deprecate stop(boolean)
`stop(true)` is almost the same as `clearMediaItems(); stop();`, except that
any player error isn't cleared. Clearing media items more clearly expresses the
intent.

PiperOrigin-RevId: 350516748
2021-01-07 10:45:02 +00:00
tonihei
2c925a4109 Fix MIGHT_NOT_USE_FULL_NETWORK_SPEED for VOD DASH streams.
The flag compared against the nowTime in the period that is only
set to a positive value for live streams.

PiperOrigin-RevId: 350514934
2021-01-07 10:44:53 +00:00
olly
855db95fb3 Update surface frame-rate based on fixed frame-rate estimate
PiperOrigin-RevId: 350442843
2021-01-07 10:44:44 +00:00
tonihei
25ed6b127d Clarify parameter Javadoc for playback speed values.
In many cases we just used "playback speed" as a detailed Javadoc
parameter or return type definition. This doesn't define which scale
the speed is using.

PlaybackParameters as the main point to set the speed already uses a
more precise wording to describe the value as a factor by which playback
will be sped up.

This change replaces other usages of "playback speed" with this wording
whereever we would usually add a unit, keeping "playback speed" for
summary statements etc to reference the general concept that doesn't
usually require a unit.

PiperOrigin-RevId: 350379139
2021-01-07 10:44:34 +00:00
olly
d1d28a418d Propagate audio session ID to MediaCodecVideoRenderer
Issue: #8190
PiperOrigin-RevId: 350357825
2021-01-07 10:44:25 +00:00
tonihei
aa2beb080c Turn on parallel video and audio adaptation by default.
The experimental setting shows positive results and can be turned
on by default. To avoid adaptation between HLS audio formats without
bitrates, we need to ensure that only formats with bitrates are
considered for adaptation.

Also added tests for these features.

Issue: #5111
PiperOrigin-RevId: 350315296
2021-01-07 10:44:15 +00:00
christosts
51d90a40ba Keep pending output format after multiple flushes
The AsynchronousMediaCodecCallback has logic to retain a pending
output format in case flush() is called. This commit fixes a case where
calling flush() again while an output format is pending would nullify
the pending output format.

A unit test is added in AsynchronousMediaCodecCallback but not the
AsynchronousMediaCodecAdapter. That is because the adapter operates
directly on top of MediaCodec, but Robolectric's ShadowMediaCodec
produces an output format on every MediaCodec.start(). This is
unrealistic when operating MediaCodec in asynchronous mode where we
need to call MediaCodec.start() after every MediaCodec.flush().

PiperOrigin-RevId: 350176659
2021-01-07 10:44:05 +00:00
tonihei
a4fbc2c98d Clean up parallel adaptation code.
- The AdaptiveTrackSelection doesn't need to use the experimental
terminolgy because the code is always triggered if there are multiple
adaptive selections.

- It's also confusing to pass the state on the outside after the object
creation, so moving everything into a simple control flow again where
the adaptation checkpoints are passed in via the constructor.

- Instead of triple arrays, we can use more readable named structures.

- The calculation of the checkpoints can be cleaned up to be more
readable by moving things to helper methods.

- The reserved bandwidth from all fixed track selections is really just
a special case of multiple parallel adaptataions. So this logic doesn't
need to be separate.

- The whole logic also didn't have test coverage so far. Added tests
for the actual adaptation using these checkpoints and the builder
calculating the checkpoints.

Overall this should be a no-op change.

PiperOrigin-RevId: 350162834
2021-01-07 10:43:56 +00:00
olly
0901fe6e38 Remove internal renderer audio session ID propagation
Overriding this method will never be necessary or advisable once we
improve routing of audio session IDs

Issue: #8190
PiperOrigin-RevId: 350146302
2021-01-07 10:43:46 +00:00
Emanuele Tidó
6d4b364530
Update OkHttpDataSource.java 2021-01-06 00:19:06 +00:00