10340 Commits

Author SHA1 Message Date
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
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
Emanuele Tidó
75b222d8d4
Update DefaultHttpDataSource.java 2021-01-06 00:17:13 +00:00
Emanuele Tidó
91a09ea320
Update OkHttpDataSource.java
set responseBody to Util.EMPTY_BYTE_ARRAY when an IOException occurs trying to get his value from inputStream
2021-01-06 00:12:55 +00:00
Emanuele Tidó
654890846a
Update DefaultHttpDataSource.java
set responseBody to Util.EMPTY_BYTE_ARRAY when an IOException occurs trying to get his value from inputStream
2021-01-06 00:10:56 +00:00
olly
6d2d2e31ef Fix DownloadManager assertion failure
Issue: #8419
#minor-release
PiperOrigin-RevId: 350134719
2021-01-05 16:04:46 +00:00
Ian Baker
a9a150a1d3 Merge pull request #8397 from equeim:avc-codecs
PiperOrigin-RevId: 350105847
2021-01-05 12:00:21 +00:00
andrewlewis
47b95fe9e1 Remove duplicate xmlns attributes in testdata
PiperOrigin-RevId: 350100601
2021-01-05 12:00:09 +00:00
andrewlewis
97d3e52340 Move XML parsing utils to common module
This is in preparation for using them from the extractor module.

PiperOrigin-RevId: 349571390
2021-01-05 11:59:58 +00:00
Emanuele Tidó
ee0d4a5b3e
Update DefaultHttpDataSource.java 2020-12-30 17:01:36 +00:00
Emanuele Tidó
15a59d93ee
throw exception improved
if responseCode and responseMessage ara available always throws an InvalidResponseCodeException instead of HttpDataSourceException, so in onPlayerError method the http status code and message can be used to decide what will be the next step.
2020-12-30 16:57:50 +00:00
Emanuele Tidó
625c46e963
throw InvalidResponseCodeException instead of HttpDataSourceException
if responseCode and responseMessage ara available always throws an InvalidResponseCodeException instead of HttpDataSourceException, so in onPlayerError method the http status code and message can be used to decide what will be the next step.
2020-12-30 16:50:04 +00:00
Haruki Hasegawa
d522dbaf44
Add SessionPlayer#movePlaylistItem(int, int) support 2020-12-30 17:22:39 +09:00
Alexey Rochev
78a975c268 Initialize Format.codecs from AVC SPS NAL unit (#8393)
This will allow ExoPlayer to check if video track's profile
and level are supported by decoder when playing progressive media sources.

Also fix typo in AvcConfig.
2020-12-24 20:30:35 +03:00
olly
1347d572ef Restore old SampleQueue exoMediaCryptoType behavior
PiperOrigin-RevId: 348818482
2020-12-23 22:54:07 +00:00
olly
3abdec17ca Some no-op cleanup to bypass mode
PiperOrigin-RevId: 348795995
2020-12-23 22:53:59 +00:00
olly
5f3d1c1bc8 Fix bypass mode when the stream is empty
#minor-release
Issue: #8374
PiperOrigin-RevId: 348792965
2020-12-23 22:53:50 +00:00
olly
e71ce06722 Add e2e test for playing SilenceMediaSource
PiperOrigin-RevId: 348789555
2020-12-23 22:53:41 +00:00
olly
cc6638d12e Disable flaky media2 test
PiperOrigin-RevId: 348784475
2020-12-23 22:53:33 +00:00
olly
d01093d711 Rollback of dd7b379dc0
*** Original commit ***

DataSource.open() throws if already opened.

Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

***

PiperOrigin-RevId: 348783425
2020-12-23 22:53:24 +00:00
ibaker
653d180d4c Add 302 redirect test to DefaultHttpDataSourceContractTest
PiperOrigin-RevId: 348760170
2020-12-23 22:53:15 +00:00
ibaker
f44e5bd292 Add a DefaultHttpDataSource contract test
Also add a MockWebServer Dispatcher that can be customised with
different resources and behaviours for different paths.

PiperOrigin-RevId: 348759662
2020-12-23 22:53:06 +00:00
ibaker
e154cb1787 Fix calls to readExactly in DataSourceContractTest
The length needs to change depending on the positition/length parameters
passed to DataSpec, so it doesn't really make sense to keep this private
method - it's clearer to in-line the calls in each test.

PiperOrigin-RevId: 348749254
2020-12-23 22:52:57 +00:00
bachinger
525f151f21 Check whether drm session manager of sample queue is null
PiperOrigin-RevId: 348688419
2020-12-23 22:52:48 +00:00
tonihei
ab4c92e9da Add release notes for low-latency features.
Issue: #4904
Issue: #5011
PiperOrigin-RevId: 348655288
2020-12-23 22:52:39 +00:00
tonihei
c7af1e12de Fix nullness warnings.
These two things were reported by the nullness checker as warnings.

PiperOrigin-RevId: 348650535
2020-12-23 22:52:30 +00:00
christosts
dd7b379dc0 DataSource.open() throws if already opened.
Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

PiperOrigin-RevId: 348609860
2020-12-23 22:52:21 +00:00
tonihei
0226543090 Remove experimental method to disable stuck buffering detection.
PiperOrigin-RevId: 348462189
2020-12-23 22:52:12 +00:00
olly
85d094a2b6 Move surface frame-rate adjustment into the helper
Estimating the playback frame-rate, querying the display refresh rate, and
setting the surface frame-rate, are all closely related to one another. In
particular because setting the surface frame-rate can directly cause the
display refresh rate to change. It therefore makes sense to move surface
frame-rate adjustment into the helper.

This also makes it easier to re-use the logic in other video renderers.

PiperOrigin-RevId: 348455864
2020-12-23 22:52:04 +00:00
tonihei
696bb34ac6 Fix second sync point calculation for unbounded live streams.
We currently use INDEX_UNBOUNDED for the calculation and don't
offset the index by the firstSegmentNum if not unbounded.

PiperOrigin-RevId: 348445797
2020-12-23 22:51:55 +00:00
olly
686d11de1b 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
2020-12-23 22:51:46 +00:00
bachinger
62720858ed Make CronetDataSourceFactory an inner class of CronetDataSource
#exofixit

PiperOrigin-RevId: 348444280
2020-12-23 22:51:38 +00:00
ibaker
df0b74e4c4 DataSourceContractTest: Add tests for reading subranges
PiperOrigin-RevId: 348443305
2020-12-23 22:51:29 +00:00