136 Commits

Author SHA1 Message Date
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
olly
a24f2b75b0 Host GTS content ourselves + prevent spurious test passes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165561808
2017-08-17 22:54:12 +01:00
olly
cf6534ea5b SegmentDownloader loadManifest cleanup.
- HlsDownloader.loadManifest (previously called getHlsPlaylist)
  suppressed errors for the offline case, where-as the DashUtil
  equivalent method did not. This change makes them consistent
  and moves both other to use ParsingLoadable.
- Enable GZIP for manifest loads in both cases.
- Use Uri rather than String to represent Uris. Previously the
  strings were parsed into Uris quite deep in the code, which
  isn't ideal if the parsing fails; you'd probably prefer the
  error to occur early at the top level.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165181398
2017-08-17 22:32:57 +01:00
olly
40f34956a8 Bump minimum and target API levels + support lib version
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164863447
2017-08-11 15:01:43 +01:00
aquilescanta
a82e51070b Add playback tests for CENC/DASH streams.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160825705
2017-07-05 15:02:39 +01:00
olly
4a59c7cf40 Make it easier to use ExoPlayer modules in other projects II
With this change, it becomes possible to depend on ExoPlayer
locally in settings.gradle by doing:

gradle.ext.exoplayerRoot = 'path/to/exoplayer/root'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')

You can optionally add a prefix onto ExoPlayer's module names
by adding:

gradle.ext.exoplayerModulePrefix = 'prefix'

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160277967
2017-06-28 22:26:05 +01:00
olly
2a8eb5a2a1 Make it easier to use ExoPlayer modules in other projects
It's currently difficult to use ExoPlayer modules in other gradle
projects because they rely on constants and dependencies defined
in our own top level gradle file. This change moves the constants
into a separate file referenced directly from each module. It also
removes the need for the top level gradle file to declare a
dependency on com.novoda:bintray-release. This is now only needed
if "exoplayerPublishEnabled = true" is specified.

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160272072
2017-06-28 22:26:05 +01:00
tonihei
cdad6a4ef1 Move playback test utils to testutils.
This allows other tests to reuse the util classes without having to link to playbacktests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158214560
2017-06-12 10:18:50 +01:00
tonihei
edbc2046e2 Clean-up manifest merge attributes.
1. Remove tools:replace in manifest files. This attribute is only needed to establish priority when two manifests are merged and have the same attribute with different values.
As this is not happening here, the attributes can be removed.

2. Some BUILD files also define a deprecated manifest merge strategy different from the android default merge strategy. For consistency these are set to "android'.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158075128
2017-06-06 16:38:45 +01:00
olly
e98bee6163 Add surface attach/detach to *WithRendererDisabling tests
This will cause the test to exercise the code path of
instantiating a DummySurface, rendering to it for 10
seconds, then re-targeting the real surface again. For
secure content tests the code path is only exercised if
DummySurface.SECURE_SUPPORTED is true. The logic for
checking this is within MediaCodecVideoRenderer itself,
rather than being part of the test.

Issue: #677

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157833026
2017-06-06 16:30:41 +01:00
tonihei
4d1826dd3d Add repeat mode mechanics to Exoplayer.
(Relating to GitHub Issue #2577)

All getter, setter and callbacks have been added and value of repeatMode is
passed to getNextXXXIndex methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155071985
2017-05-04 20:55:48 +01:00
olly
1e12c07954 Move renderer building into a factory class.
To inject custom renderers into SimpleExoPlayer, developers
currently need to extend SimpleExoPlayer and override the
renderer building methods. This is in contrast to the rest
of the library, where we use proper injection. This change
restores consistency. I think it's fine to make
SimpleExoPlayer final again, but if we find people extending
it for non-renderer purposes, we can revert that part of the
change.

ExoPlayerFactory now has analogous methods for the simple
and non-simple cases, which is a nice outcome.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154295726
2017-04-26 15:49:35 +01:00
eguven
103c3b631b Add DashDownloader helper class to download dash streams
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151456161
2017-03-31 19:07:59 +01:00
andrewlewis
0e6ef0edf6 Add Sonic library for audio speed adjustment.
Add methods to ExoPlayer for setting/getting the playback speed, using
SonicAudioProcessor.

Remove PlaybackParams support, as the AudioTrack timestamp does not work
reliably on Marshmallow. The platform also uses Sonic and performance
should be comparable between the Java and native versions on recent Android
runtimes.

In a later change, SonicAudioProcessor will be made public so it can
be used in conjunction with other processors.

Issue: #26

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151027121
2017-03-23 19:14:48 +00:00
olly
7ce8125194 Split DASH into a separate module
Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150762237
2017-03-22 19:09:04 +00:00
olly
b1a2ae1856 Remove DRM->DASH dependency in prep for DASH module split
Also renamed releaseResources->release to be consistent with the
rest of the library, and added some synchronization to ensure
correct usage.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150753414
2017-03-22 19:07:53 +00:00
olly
25a093b37c Split HLS into a separate module
Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150643456
2017-03-22 18:59:56 +00:00
eguven
2fe478ad6a Invert DashHostedTest and inner class Builder to make the design more natural
Builder class was renamed to DashTestRunner and DashHostedTest moved
into it as an inner class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150307988
2017-03-16 16:15:22 +00:00
aquilescanta
ce5c0c18f9 Rename AdaptiveVideoTrackSelection to AdaptiveTrackSelection
This will allow us to use the same class for Audio adaptation.

Issue:#1975

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150302561
2017-03-16 16:13:03 +00:00
olly
70926057c5 Fix some more incorrect playback test stream IDs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150080957
2017-03-15 15:49:13 +00:00
olly
a26cb9cc3c No-op fix for playback tests
super.onQueueInputBuffer is no longer a no-op in all
configurations. It doesn't make any difference in practice
for these tests, but for completeness we should call up.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150056224
2017-03-15 15:47:03 +00:00
olly
204537ed40 Pre-modularization cleanup
- Use a variable for the (default) minSdkVersion. There will
  be more modules that need it, and it'll be easier to manage
  if it's in one place.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150050663
2017-03-15 15:44:46 +00:00
olly
4b1410bced Simplify + Fix WV encrypted playback tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149993442
2017-03-15 15:42:36 +00:00
mishragaurav
15aad266b6 Use separate Widevine license keys to package test audio for Exoplayer GTS.
Android doesn't support secure decoding for audio. Hence use Audio keys that always require L3 support only.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149764063
2017-03-13 15:54:10 +00:00
eguven
af98ca661a Refactor DashTest class
Moved DashHostedTest to top level classes. Added DashHostedTest.Builder. Move widevine offline tests to separate class with custom setUp and tearDown methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146118310
2017-02-15 16:36:24 +00:00
olly
25c18ca1b4 Re-add playback tests to Moe migration
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145583193
2017-01-25 20:56:20 +00:00
eguven
9ac0add4be Add a BUILD file with mobile harness target to playbacktests/src/androidTest folder
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145267137
2017-01-24 14:25:47 +00:00
olly
1eede5d5bb Fix gradle/proguard setup
- Add proguard rules for libraries/extensions into .aar files
- Add proguard rules to retain CEA608/708 decoder constructors
- Remove lots of default config from gradle files
- Remove disabling of abort on lint error
- Enable optimizations on release builds of demo app

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144350233
2017-01-13 17:27:25 +00:00
olly
e125ed705e Report tunneling support via RendererCapabilities API
Also revert ability to query for a decoder that explicitly
supports tunneling, since in the new design we'll just be
querying the first decoder provided by the MediaCodecSelector
and then reporting what it supports. This is in line with
what we do when reporting support for adaptive switching.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144315746
2017-01-13 17:27:25 +00:00
eguven
9d5c750fe9 Support offline drm key downloading and restoring
Renamed StreamingDrmSessionManager to DefaultDrmSessionManager and added functionality to download, restore, renew and release offline keys. Added a utility class, OfflineLicenseHelper, to facilitate use of DefaultDrmSessionManager for downloading, renewing and releasing offline keys.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143769955
2017-01-06 16:56:31 +00:00
olly
9f81b72291 Fix GTS playback test timestamp verifications
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143549680
2017-01-04 23:07:57 +00:00
olly
46245251e1 Fix bad indent + clean up Format formatting
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143469714
2017-01-04 23:04:07 +00:00
ojw28
163a3a7bb8 Delete HlsTest.java 2016-12-21 00:51:30 +00:00
Oliver Woodman
86adc64403 Delete CS classes 2016-12-14 23:00:10 +00:00
olly
88d2a6a348 Bump version + update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142015031
2016-12-14 16:22:48 +00:00