170 Commits

Author SHA1 Message Date
andrewlewis
a849f43e6d Work around broken raw audio decoder on Oppo R9
Issue: #5782
PiperOrigin-RevId: 247934223
2019-05-15 18:12:16 +01:00
olly
82061e9afb 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:24:11 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
andrewlewis
53934c13b2 Select non-primary tunneling decoder
Issue: #3100
Issue: #5547
PiperOrigin-RevId: 243181217
2019-04-13 01:40:43 +01:00
tonihei
8e80acd18f Use androidx.test and extensions.
This replaces the deprecated usages of RobolectricTestRunner and
RuntimeEnvironent and fully migrates the tests to androidx.

PiperOrigin-RevId: 238011667
2019-03-15 04:53:12 +00:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
olly
355b3d6334 Increase minSdkVersion to 16
The combination of pre-16 API levels accounting for ~0.5% of the device
population, and that the most important components in ExoPlayer (e.g.
the MediaCodec renderers) have always required API level 16, mean it's
very unlikely this will negatively impact on anyone.

PiperOrigin-RevId: 230701808
2019-01-29 16:41:45 +00:00
eguven
527f2cf730 Add TrackSelection.Factory createTrackSelections
createTrackSelections decides whether to create an adaptive or a fixed track seletion to create.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222231011
2018-11-20 17:43:01 +00:00
tonihei
53e06e636d Clean up ExoHostedTest.
Some test specific things, like adding an extra listener or adding decoder
counters are currently handled by ExoHostedTest. They can be moved to the
classes actually using them to clean up ExoHostedTest.

This also adds more flexibility to further generic clean-up in onTestFinished.

Also, reorder player setup to what ExoPlayerTestRunner is doing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219446276
2018-10-31 13:57:37 +00:00
andrewlewis
4170c79a4b Add ACCESS_NETWORK_STATE permission for MH tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218058185
2018-10-24 18:27:31 +01:00
aquilescanta
db33b3bbd1 Allow HlsSampleStreamWrapper to cancel partial media chunk loads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213439145
2018-09-20 12:16:47 +01:00
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
olly
38f2f352f9 Move playback tests off deprecated APIs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210077548
2018-08-24 16:05:40 +01:00
olly
2b8938533f Put all DASH gts URLs in the same place
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209752603
2018-08-24 15:42:51 +01:00
andrewlewis
e56a9d1bb5 Add missing API level checks in EnumerateDecodersTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209414373
2018-08-24 15:27:27 +01:00
andrewlewis
5c2dd9ca42 Move all tests to JUnit 4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209412403
2018-08-24 15:25:56 +01:00
andrewlewis
11bf7ae03d Add GTS test that enumerates decoders
Decoder capabilities are logged via MetricsLogger.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207514564
2018-08-06 11:35:48 +01:00
andrewlewis
5715960304 Add Context to SimpleExoPlayer factory methods
This is needed for implementing (optional) support for audio focus handling in a
later change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206899837
2018-08-01 13:49:21 +01:00
tonihei
ffdc17d0e0 Remove generic type parameter from TransferListener.
All known instances use DataSource as generic type and thus code can be simplified
by removing the generic type altogether.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205798542
2018-07-24 14:56:45 +01:00
eguven
a406dc8bee Use TrackKey in place of RepresentetionKey, StreamKey, RenditionKey
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199767518
2018-06-18 10:58:52 +01:00
aquilescanta
17ab9da5b6 Enable java 8 for some missing projects
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199265539
2018-06-05 12:44:56 +01:00
olly
051da40dc3 Misc cleanup
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195552434
2018-05-07 07:17:33 +01:00
olly
c5bf7f4513 Further clean up DownloadActions + DownloadActivity
- Made parts of DownloadActions public that were previously hidden.
  This is necessary so that when an app is listening to the
  DownloadManager, it can tell something about the tasks.
- Simplified DownloadActivity some more. The helpers may migrate
  into their corresponding modules at some point, and also be
  converted to return structured TrackGroupArrays rather than a
  flat list of Formats.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195269824
2018-05-07 06:53:59 +01:00
olly
175a0100d0 Remove ability to query Downloader implementations
This was adding a lot of code, and the multiple use cases
for Downloader was pretty confusing (in particular the
ordering of method calls was unclear). It's also not
performant (e.g. it requires loading/parsing manifest(s)
and initialization segments from disk).

In practice I think apps will need to keep a record of
what's offlined in their app's database (or equivalent),
which they can update by registering as a listener on
DownloadManager. This will be done for the demo app in
a subsequent change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194932876
2018-05-07 06:43:25 +01:00
olly
b77d6c4ef4 Remove Downloader.ProgressListener
ProgressiveDownloader never implemented this properly, and we
don't use it in DownloadManager/DownloadService, both of which
use a polling model. A polling model is also what's used elsewhere,
for example to query the current playback position.

This is effectively doing the TODO in ProgressiveDownloader.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194214579
2018-05-07 06:13:24 +01:00
olly
7d6b0e1fda Move renderer flags, overrides and tunneling ID into Parameters
- This is needed to make DefaultTrackSelector properly thread
  safe, and enable atomic changes to the selector that, for
  example, disable a renderer and enable another one at the same
  time.

- This change also saves/restores parameters and the start
  position in PlayerActivity, resolving the ref'd issue.

Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193913350
2018-05-07 05:56:48 +01:00
olly
d3cdf52591 Sanitize MappedTrackInfo API
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193897041
2018-05-07 05:53:05 +01:00
olly
67cde97a70 Move code unrelated to mapping to DefaultTrackSelector
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192759210
2018-04-16 10:47:55 +01:00
olly
3568dca3b1 Make tests use DefaultTrackSelector
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192259167
2018-04-11 00:29:53 +01:00
tonihei
66d2b76a6c Remove test max SDK version overrides.
These don't seem to be needed anymore. All tests run without them in gradle
and Blaze.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191867518
2018-04-08 16:39:57 +01:00
tonihei
3cbe91a3b0 Pass DrmSessionManager through SimpleExoPlayer.
This will allow SimpleExoPlayer to auto-register its own listener before the
drm session manager is used to set-up the renderers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190478174
2018-03-28 00:43:07 +01:00
tonihei
40947d52f0 Support multiple DefaultDrmSessionManager listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190236842
2018-03-28 00:34:25 +01:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
eguven
168a5d63c5 Remove empty CachedContent in SimpleCache.releaseHoleSpan()
In startReadWrite*() methods a new CachedContent is created if the there
isn't one already for the given key. If the span is release without
writing any content, this fix removes the added CachedContent.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183666821
2018-02-01 15:00:35 +00:00
tonihei
e991a8015b Use Truth instead of framework asserts in all tests.
This achieves two things:
1. All our tests use the same type of assertions.
2. The tests currently run as instrumentation test can be moved to
   Robolectric without changing the assertions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182910542
2018-01-23 19:29:12 +00:00
andrewlewis
e419154b86 Make DashMediaSource.Builder a factory for DashMediaSources
This is in preparation for supporting non-extractor MediaSources for ads in
AdsMediaSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178377627
2017-12-12 19:08:25 +00:00
olly
c06fe73b66 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-11-21 13:03:28 +00:00
hoangtc
0be4b46bb4 Introduce Builder pattern to create MediaSource.
Start with DASH MediaSource. The number of injected arguments is getting
out-of-control.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175529031
2017-11-13 17:08:24 +00:00
andrewlewis
9306b24c65 Fix some Android Studio inspection warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
2017-10-27 15:54:17 +01:00
tonihei
f6821c6d95 Split playbacktests mobile_test into multiple version-dependent test targets.
MobileHarness allocates random devices for each test and repeats tests up to 5 times to
account for spurious test failures. Some of our tests automatically pass for SDK versions
below a certain threshold. Thus, even if such a version-guarded test would always fail,
the MobileHarness test is likely to succeed as it only needs one random allocation to a
device with a lower SDK version.

To prevent this behaviour and to make sure all tests are actually run, the mobile_test
target is split into multiple targets one for each minimum SDK version.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447046
2017-10-17 18:26:11 +01:00
tonihei
b71effb7b0 Fix MobileHarness playback tests.
This change fixes various issues:
 - MobileHarness sometimes allocated devices with SDK < 16. As we have no tests running
   on these SDKs, a new dimension filter for the mobile_test target ensures that only
   devices with SDK >= 16 are selected. A similar filter for SDK version is also added
   to the ABR playback tests to ensure no old devices are selected.
 - DRM specific tests are skipped for Api < 18, but were not able to run because the
   DashTestRunner class tried to link to the MediaDrm constructor. Moved the
   constructor to a seperate Builder class to allow execution on Api levels 16 and 17.
 - DashWidevineOfflineTest also tried to access code for Api >= 18 without checking
   the current level.
 - Action implementations which are waiting for events did not ensure that they have a
   nextAction to wait for. This caused NullPointerExceptions when this next action was
   scheduled.
 - DefaultDrmSession always restored the offline keys when a new license was requested,
   even if the keys were already restored. These repeated slow calls to restoreKeys
   resulted in high numbers of dropped buffers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171974859
2017-10-13 19:50:20 +01:00
andrewlewis
09165ab870 Rename droppedOutputBufferCount
Now this counter includes input buffers too, which are dropped as part of
skipping to keyframes for catch up.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171119930
2017-10-11 12:17:25 +01:00
tonihei
331c179a88 Wait until playback started in certain action schedules.
Some action schedules (especially those for real media with potentially
long initial buffering times) don't wait until the playback started
before executing the rest of the schedule.

Added waitForPlaybackStateChanged(STATE_READY) to all applicable action schedules.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171009434
2017-10-11 12:16:03 +01:00
tonihei
d7b4f8a645 Amend seek action in ActionSchedule to optionally wait until playback resumes.
This allows more deterministic action schedules, especially for real media
which may take an arbitrary amount of time to rebuffer after seeking.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171005231
2017-10-11 12:14:39 +01:00
eguven
8d739067ec Add HlsDownloadTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169064003
2017-09-19 18:12:01 +01:00
aquilescanta
b2bc4450df Run cbc1/cbcs tests from API 25 onwards
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168834998
2017-09-15 23:48:24 +01:00
eguven
cc58b515b7 Make Downloaders open source
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166486294
2017-08-29 23:03:08 +01:00
tonihei
10f1bd7396 Add shuffle mode parameter to Timeline interface methods.
This parameter is used by methods such as getNextWindowIndex
and getPreviousWindowIndex to determine the playback order.
Additionally, there are method to query the first and last
window index given the shuffle mode.

None of the timeline implementations nor the ExoPlayer
implementation supports shuffling so far.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166170229
2017-08-29 22:37:27 +01:00