2060 Commits

Author SHA1 Message Date
eguven
bbf8a9ac13 Simplify CacheUtil
PiperOrigin-RevId: 250654697
2019-05-31 23:01:15 +01:00
eguven
92e2581e23 Fix CacheUtil.cache() use too much data
cache() opens all connections with unset length to avoid position errors.
This makes more data then needed to be downloading by the underlying
network stack.

This fix makes makes it open connections for only required length.

Issue:#5927
PiperOrigin-RevId: 250546175
2019-05-31 23:01:01 +01:00
tonihei
b9f3fd429d Make parallel adaptive track selection more robust.
Using parallel adaptation for Formats without bitrate information currently
causes an exception. Handle this gracefully and also cases where all formats
have the same bitrate.

Issue:#5971
PiperOrigin-RevId: 250682127
2019-05-31 22:46:13 +01:00
aquilescanta
9da9941e38 Fix TTML bitmap subtitles
+ Use start for anchoring, instead of center.
+ Add the height to the TTML bitmap cue rendering layout.

Issue:#5633
PiperOrigin-RevId: 250519710
2019-05-31 22:41:10 +01:00
andrewlewis
082aee692b Allow passthrough of E-AC3-JOC streams
PiperOrigin-RevId: 250517338
2019-05-31 22:40:25 +01:00
andrewlewis
8bc14bc2a9 Allow enabling decoder fallback in DefaultRenderersFactory
Also allow enabling decoder fallback with MediaCodecAudioRenderer.

Issue: #5942
PiperOrigin-RevId: 250301422
2019-05-31 22:38:32 +01:00
olly
2e1ea379c3 Fix IndexOutOfBounds when there are no available codecs
PiperOrigin-RevId: 249610014
2019-05-31 22:34:50 +01:00
tonihei
cf93b8e73e Release DownloadHelper automatically if preparation failed.
This prevents further unexpected updates if the MediaSource happens to
finish its preparation at a later point.

Issue:#5915
PiperOrigin-RevId: 249439246
2019-05-31 22:34:01 +01:00
andrewlewis
9ec330e7c7 Fix platform scheduler javadoc
PiperOrigin-RevId: 248503971
2019-05-17 11:35:38 +01:00
olly
15b319cba2 Bump release to 2.10.1 and update release notes
PiperOrigin-RevId: 248503235
2019-05-17 11:35:22 +01:00
olly
7f89fa9a8c Add simpler HttpDataSource constructors
PiperOrigin-RevId: 248350557
2019-05-15 20:03:52 +01:00
olly
3ce0d89c56 Allow empty values in ICY metadata
Issue: #5876
PiperOrigin-RevId: 248119726
2019-05-15 20:03:39 +01:00
bachinger
cea3071b33 Fix rendering DVB subtitle on API 28.
Issue: #5862
PiperOrigin-RevId: 248112524
2019-05-15 20:03:25 +01:00
olly
48de1010a8 Allow line terminators in ICY metadata
Issue: #5876
PiperOrigin-RevId: 247935822
2019-05-15 20:02:34 +01:00
tonihei
1b9d018296 Fix Javadoc links.
PiperOrigin-RevId: 247630389
2019-05-15 20:00:06 +01:00
tonihei
6ead14880b Add setCodecOperatingRate workaround for 48KHz audio on ZTE Axon7 mini.
Issue:#5821
PiperOrigin-RevId: 247621164
2019-05-15 19:59:40 +01:00
andrewlewis
29add854af Update player accessed on wrong thread URL
PiperOrigin-RevId: 247418601
2019-05-15 19:55:30 +01:00
tonihei
ee5981c02d Ensure messages get deleted if they throw an exception.
If a PlayerMessage throws an exception, it is currently not deleted from the
list of pending messages. This may be problematic as the list of pending
messages is kept when the player is retried without reset and the message is
sent again in such a case.

PiperOrigin-RevId: 247414494
2019-05-15 19:55:20 +01:00
andrewlewis
85a86e434a Increase gapless trim sample count
PiperOrigin-RevId: 247348352
2019-05-15 19:55:07 +01:00
tonihei
0698bd1dbb Add option to clear all downloads.
Adding an explicit option to clear all downloads prevents repeated database
access in a loop when trying to delete all downloads.

However, we still create an arbitrary number of parallel Task threads for this
and seperate callbacks for each download.

PiperOrigin-RevId: 247234181
2019-05-15 19:54:27 +01:00
eguven
b626dd70c3 Add DownloadHelper.createMediaSource utility method
PiperOrigin-RevId: 245243488
2019-05-15 19:47:43 +01:00
olly
8b2d436d7c Prevent CachedContentIndex.idToKey from growing without bound
PiperOrigin-RevId: 246727723
2019-05-05 18:24:04 +01:00
Oliver Woodman
ce37c79968 Fix Javadoc 2019-05-03 21:12:02 +01:00
olly
71d7e0afe2 Add a couple of assertions to DownloadManager set methods
PiperOrigin-RevId: 246491511
2019-05-03 19:44:54 +01:00
olly
116602d8c0 Minor download documentation tweaks
PiperOrigin-RevId: 246333281
2019-05-03 19:44:49 +01:00
tonihei
241ce2df49 Post-submit fixes for eed5d957d8.
One wrong return value, a useless assignment, unusual visibility of private
class fields and some nullability issues.

PiperOrigin-RevId: 246282995
2019-05-02 13:14:05 +01:00
olly
9f9cf316bd Remove unnecessary logging
As justification for why we should not have this type of logging,
it would scale up to about 13K LOC, 1800 Strings, and 36K (after
pro-guarding - in the case of the demo app) if we did it through
the whole code base*. It makes the code messier to read, and in
most cases doesn't add significant value.

Note: I left the Scheduler logging because it logs interactions
with some awkward library components outside of ExoPlayer, so is
perhaps a bit more justified.

* This is a bit unfair since realistically we wouldn't ever add
  lots of logging into trivial classes. But I think it is fair
  to say that the deltas would be non-negligible.

PiperOrigin-RevId: 246181421
2019-05-02 13:13:59 +01:00
olly
214a372e06 Periodically persist progress to index whilst downloading
PiperOrigin-RevId: 246173972
2019-05-02 13:13:53 +01:00
olly
d215b81167 Rework DownloadManager to fix remaining TODOs
- Removed DownloadInternal and its sometimes-out-of-sync
  duplicate state
- Fixed downloads being in STOPPED rather than QUEUED state
  when the manager is paused
- Fixed setMaxParallelDownloads to start/stop downloads if
  necessary when the value changes
- Fixed isWaitingForRequirements

PiperOrigin-RevId: 246164845
2019-05-02 13:13:38 +01:00
olly
4a5b8e17de DownloadManager improvements
- Do requirements TODO
- Add useful helper method to retrieve not met requirements
- Fix WritableDownloadIndex Javadoc

PiperOrigin-RevId: 245922903
2019-04-30 22:13:41 +01:00
olly
6b34ade908 Rename DownloadThread to Task
This resolves some naming confusion that previously existed
as a result of DownloadThread also being used for removals.
Some related variables (e.g. activeDownloadCount) would refer
to both download and removal tasks, whilst others
(e.g. maxParallelDownloads) would refer only to downloads.
This change renames those that refer to both to use "task"
terminology.

This change also includes minor test edits.

PiperOrigin-RevId: 245913671
2019-04-30 22:13:35 +01:00
Oliver Woodman
590140c1a6 Fix bad merge 2019-04-26 20:41:29 +01:00
eguven
0128cebce1 Add simpler DownloadManager constructor
PiperOrigin-RevId: 245397736
2019-04-26 18:45:52 +01:00
tonihei
9463c31cde Update default min duration for playbacks with video to match max duration.
Experiments show this is beneficial for rebuffers with only minor impact
on battery usage.

Configurations which explicitly set a minimum buffer duration are unaffected.

Issue:#2083
PiperOrigin-RevId: 244823642
2019-04-26 18:45:07 +01:00
andrewlewis
f62fa434dd Log warnings when extension libraries can't be used
Issue: #5788
PiperOrigin-RevId: 245440858
2019-04-26 18:43:58 +01:00
olly
56520b7c73 Move DownloadManager internal logic into isolated inner class
There are no logic changes here. It's just moving code around and removing
the "internal" part of names where no longer required.

PiperOrigin-RevId: 245407238
2019-04-26 18:41:46 +01:00
olly
d187d9ec8f Post maxParallelDownload and minRetryCount changes
PiperOrigin-RevId: 245405316
2019-04-26 18:41:40 +01:00
olly
9d03ae4109 Add missing getters and clarify STATE_QUEUED documentation
PiperOrigin-RevId: 245401274
2019-04-26 18:41:30 +01:00
eguven
fc35d5fca6 Add simpler DownloadManager constructor
PiperOrigin-RevId: 245397736
2019-04-26 18:41:17 +01:00
eguven
c97ee9429b Allow content id to be set in DownloadHelper.getDownloadRequest
PiperOrigin-RevId: 245388082
2019-04-26 18:41:03 +01:00
eguven
4da14e46fa Add DownloadService SET_REQUIREMENTS action
PiperOrigin-RevId: 245014381
2019-04-26 18:38:56 +01:00
eguven
f7f6489f57 Add option to add entries in an ActionFile to DownloadIndex as completed
PiperOrigin-RevId: 244864742
2019-04-26 18:38:24 +01:00
tonihei
6155139856 Fix bug which logs errors twice if stack traces are disabled.
Disabling stack trackes currently logs messages twice, once with and once
without stack trace.

PiperOrigin-RevId: 244853127
2019-04-26 18:38:16 +01:00
tonihei
3d6407a58e Always update loading period in handleSourceInfoRefreshed.
This ensures we keep the loading period in sync with the the playing period in
PlybackInfo, when the latter changes to something new.

PiperOrigin-RevId: 244838123
2019-04-26 18:37:43 +01:00
olly
0d8146cbca Further improve DownloadService action names & methods
- We had buildAddRequest and sendNewDownload. Converged to
  buildAddDownload and sendAddDownload.
- Also fixed a few more inconsistencies, and brought the
  action constants into line as well.

PiperOrigin-RevId: 244274041
2019-04-18 23:47:19 +01:00
olly
b8cdd7e40b Fix lint warnings for 2.10
PiperOrigin-RevId: 244268855
2019-04-18 23:43:07 +01:00
olly
b30efe968b Clean up database tables for launch
PiperOrigin-RevId: 244267255
2019-04-18 23:43:02 +01:00
olly
54a5d6912b Improve progress reporting logic
- Listener based reporting of progress allows the content length
  to be persisted into the download index (and notified via a
  download state change) as soon as it's available.
- Moved contentLength back into Download proper. It should only
  ever change once, so I'm not sure it belongs in the mutable part
  of Download.
- Made a DownloadProgress class, for naming sanity.

PiperOrigin-RevId: 244242487
2019-04-18 23:42:57 +01:00
olly
7d67047e94 Support multiple DefaultDownloadIndex instances
PiperOrigin-RevId: 244226680
2019-04-18 23:42:51 +01:00
olly
38c5350c2c Simplify DownloadManager constructors
PiperOrigin-RevId: 244223870
2019-04-18 23:42:45 +01:00