4541 Commits

Author SHA1 Message Date
olly
90cb157985 Update translations
PiperOrigin-RevId: 246729123
2019-05-05 18:24:21 +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
aquilescanta
6c1065c6d2 Prevent index out of bounds exceptions in some live HLS scenarios
Can happen if the load position falls behind in every playlist and
when we try to load the next segment, the adaptive selection logic
decides to change variant.

Issue:#5816
PiperOrigin-RevId: 245923006
2019-04-30 22:13:47 +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
Oliver Woodman
cb13f2df0f Merge branch 'dev-v2-r2.10.0' of https://github.com/google/ExoPlayer into dev-v2-r2.10.0 2019-04-26 18:48:06 +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
Oliver Woodman
6473d46cbd Fix tests 2019-04-19 16:05:04 +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
olly
8c62408120 Rename start/stopDownloads to resume/pauseDownloads
PiperOrigin-RevId: 244216620
2019-04-18 23:42:40 +01:00
olly
138da6d519 Rename manualStopReason to stopReason
PiperOrigin-RevId: 244210737
2019-04-18 23:42:33 +01:00
eguven
6d8bd34590 Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:42:20 +01:00
aquilescanta
b6337adc47 Avoid selecting a forced text track that doesn't match the audio selection
Assuming there is no text language preference.

PiperOrigin-RevId: 244176667
2019-04-18 23:41:15 +01:00
eguven
a501f8c245 Fix flaky DownloadManagerDashTest
PiperOrigin-RevId: 244170179
2019-04-18 23:41:04 +01:00
aquilescanta
be0acc3621 Add test for HlsTrackMetadataEntry population in the HlsPlaylistParser
PiperOrigin-RevId: 244168713
2019-04-18 23:40:58 +01:00
andrewlewis
c2bbf38ee8 Extend Bluetooth dead audio track workaround to Q
PiperOrigin-RevId: 244139959
2019-04-18 23:40:36 +01:00
olly
0748566482 Remove TODOs we're not going to do
1. customCacheKey for DASH/HLS/SS is now asserted against
   in DownloadRequest
2. Merging of event delivery in DownloadManager is very
   tricky to get right and probably not a good idea

PiperOrigin-RevId: 244048392
2019-04-18 23:38:43 +01:00
eguven
289a8ffe4c Small javadoc fix for DownloadManager constructors
PiperOrigin-RevId: 244009343
2019-04-18 23:38:37 +01:00
olly
afd72839dc Disable cache span touching for offline
Currently SimpleCache will touch cache spans whenever it reads
from them. With legacy SimpleCache setups this involves a potentially
expensive file rename. With new SimpleCache setups it involves
a more efficient but still non-free database write.

For offline use cases, and more generally any use case where the
eviction policy doesn't use last access timestamps, touching is
not useful. This change allows the evictor to specify whether it
needs cache spans to be touched or not. SimpleCache will only touch
spans if the evictor requires it.

Note: There is a potential change in behavior in cases where a
cache uses an evictor that doesn't need cache spans to be touched,
but then later switches to an evictor that does. The new evictor
may temporarily make sub-optimal eviction decisions as a result.
I think this is a very fair trade-off, since this scenario is
unlikely to occur much, if at all, in practice, and even if it
does occur the result isn't that bad.
PiperOrigin-RevId: 244005682
2019-04-18 23:38:30 +01:00
olly
e15e6212f2 Fix playback of badly clipped MP3 streams
Issue: #5772
PiperOrigin-RevId: 243987497
2019-04-18 23:37:36 +01:00
olly
721e1dbfaf Add WritableDownloadIndex interface
One goal we forgot about a little bit was to allow applications
to provide their own index implementation. This requires the
writable side to also be defined by an interface.

PiperOrigin-RevId: 243979660
2019-04-18 23:37:28 +01:00
andrewlewis
6b0fd51378 Reset playback info but not position/state in release
ImaAdsLoader gets the player position after the app releases
the player to support resuming ads at their current position
if the same ads loader is reused.

PiperOrigin-RevId: 243969916
2019-04-18 23:37:06 +01:00
eguven
dcb8417a3c Assert customCacheKey is null for DASH, HLS and SmoothStreaming downloads
PiperOrigin-RevId: 243954989
2019-04-18 23:36:08 +01:00
tonihei
8e7a2ba958 Don't reset masking position when prepare fails.
The removed condition only applies when prepare fails and no timeline was or
is known. We should keep a pending seek position in such a case. The internal
player does the same thing already.

PiperOrigin-RevId: 243819466
2019-04-18 15:12:07 +01:00
olly
ee08e7dcac Fix key and accessibility scrubbing
Issue: #5767
PiperOrigin-RevId: 243811443
2019-04-16 16:42:08 +01:00
eguven
5856e75781 Rename DownloadAction to DownloadRequest
PiperOrigin-RevId: 243806888
2019-04-16 16:41:29 +01:00