252 Commits

Author SHA1 Message Date
bachinger
9e35c6c28c Make all segment downloader use the media item
PiperOrigin-RevId: 311527440
2020-05-14 22:24:31 +01:00
tonihei
13c668f9e0 Fix Widevine offline test assertion for API29+.
The error type thrown when acquiring a license that has already
been released changed from MediaDrmStateException to IllegalStateException
from API 29.

Update the tests to assert the correct type of error based on API version.

PiperOrigin-RevId: 308239508
2020-04-27 10:41:50 +01:00
olly
6f2891e5c4 Remove usages of deprecated CacheDataSourceFactory
PiperOrigin-RevId: 307684243
2020-04-27 10:39:34 +01:00
olly
4abaaf138c Remove DownloadConstructorHelper
Something that helps a constructor always seemed a bit strange.
It's now possible to use CacheDataSource.Factory directly instead.

PiperOrigin-RevId: 307661930
2020-04-27 10:39:34 +01:00
kimvde
c13f41af0d Remove deprecated members in DefaultTrackSelector
PiperOrigin-RevId: 304986313
2020-04-06 13:28:28 +01:00
andrewlewis
2fdbe0fc56 Fix misc typos
PiperOrigin-RevId: 303719911
2020-03-30 17:17:18 +01:00
andrewlewis
4454520e93 Add overlay FrameLayout to hosted tests
PiperOrigin-RevId: 303283147
2020-03-27 23:31:46 +00:00
olly
dc33c0bdfb Improve logging II
- Show renderers with no tracks in EventLogger track logging
- Log renderer names in EventLogger track logging
- Add useful message to ExoPlaybackException instances (including
  renderer name for renderer errors)

PiperOrigin-RevId: 302421616
2020-03-25 13:03:12 +00:00
aquilescanta
aa9eb5abc9 Remove generics from DRM components
PiperOrigin-RevId: 301798563
2020-03-20 12:48:50 +00:00
tonihei
2e5444b49b Add option to use a custom DrmSessionManager into OfflineLicenseHelper
This allows to customize the DrmSessionManager, e.g. with a
LoadErrorHandlingPolicy.

Issue:issue:#7078
PiperOrigin-RevId: 301571783
2020-03-19 00:50:14 +00:00
olly
3acc85c2df Re-split ExoHostedTest.onTestFinished into logMetrics and assertPassed
This is a partial revert of <unknown commit>. The split and the order is important. For
example, as things are currently, if playback fails for a test that makes additional
assertions in onTestFinished, the visible reason the test failed is quite likely to
be one of the additional assertions, rather than the error that actually caused the
playback to fail. I think we probably also don't want to log metrics if playback
fails.

PiperOrigin-RevId: 300733109
2020-03-19 00:47:41 +00:00
olly
beab272a8c Drop prefix test- from test methods under v2/playbacktests
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300537212
2020-03-19 00:46:32 +00:00
ibaker
eeab811301 Add EventDispatcher to DrmSession(Manager) acquire & release calls
This is passed in but not currently used. I'll use it in follow-up
changes.

Pre-work for issue:#6765

PiperOrigin-RevId: 299314341
2020-03-10 10:20:01 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
aquilescanta
5c3c803460 Remove DRM management from Renderers
PiperOrigin-RevId: 295569075
2020-02-17 17:40:30 +00:00
krocard
ebce903aaf Allow writing multiple frame in a buffer
Currently only one access unit can be written per
buffer write. This has been found to be power
inefficient in an offload situation.

#exo-offload

PiperOrigin-RevId: 294886188
2020-02-13 15:45:56 +00:00
ibaker
b6bd57ab12 Replace most usages of @TargetApi with @RequiresApi
We keep @TargetApi where the method is a safe no-op on
older versions due to an in-line version check.

PiperOrigin-RevId: 292878727
2020-02-03 11:21:21 +00:00
olly
ccce9948a9 Align media2 extension tests with other tests
PiperOrigin-RevId: 289494365
2020-01-16 13:50:36 +00:00
tonihei
6512e320fb Simplfify codec state reset methods in MediaCodecRenderer
Currently, resetting the internal state related to the codec in done in 4 places
in MediaCodecRenderer:
 1. In the constructor to set some sensible initial default.
 2. In flushOrReleaseCodec to reset state after flushing
 3. In releaseCodec to reset state to default values for a released codec.
 4. In initCodec to reset state to defaul values for a new codec.

There are actuall only two types of state reset operations:
 1. Resetting state for a released codec, so that a new codec isn't influenced by
    previous codecs.
 2. Resetting state after flushing an existing codec. This is a subset of (1).

So to simplify the class, this change moves all state resets to two methods
corresponding to the two cases above.

PiperOrigin-RevId: 285731913
2019-12-18 18:50:20 +00:00
tonihei
72d5b425d3 Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-05 10:20:15 +00:00
kimvde
c8170e18d0 Update AndroidX Test versions to latest
Split the version of the sublibraries because their latest version
number is different. See
https://developer.android.com/jetpack/androidx/releases/test#1.2.0.

PiperOrigin-RevId: 278585090
2019-11-05 16:18:38 +00:00
olly
9842ea7f22 Move classes that don't belong in testutils out of testutils
PiperOrigin-RevId: 278401000
2019-11-05 16:18:24 +00:00
andrewlewis
149ea90541 Fix throws in DashStreamingTest
Some methods marked as throwing DecoderQueryException actually
did not throw it. Switch to marking throws Exception
everywhere.

PiperOrigin-RevId: 277674401
2019-11-05 16:13:33 +00:00
andrewlewis
7701c883de Add new MIME types to EnumerateDecodersTest
PiperOrigin-RevId: 277489763
2019-11-05 16:12:54 +00:00
aquilescanta
fa803967f2 Remove mediaDrm methods from DefaultDrmSessionManager
DrmSessionManagers may now be in released state, in which case they
may release their MediaDrm. In that case, it would be invalid to
forward method calls to the underlying MediaDrms. Users should
instead call these methods directly on the MediaDrm.

Issue:#4721
PiperOrigin-RevId: 270963393
2019-10-02 21:26:04 +01:00
aquilescanta
cc8b774b41 Remove DefaultDrmSessionManager factory methods that enforce MediaDrm leaks
Inline invocations of these methods, which still leaks the MediaDrms.
However, it will be fixed once the DefaultDrmSessionManager API is finalized
and ExoMediaDrm.Providers are introduced.

Issue:#4721
PiperOrigin-RevId: 270681467
2019-10-02 21:25:31 +01:00
olly
2d0b10a73a Use constant to define androidx annotation version
PiperOrigin-RevId: 266801762
2019-09-05 10:45:08 +01:00
olly
d720d2c3f6 Simplify androidTest manifests & fix links to use https
PiperOrigin-RevId: 266396506
2019-09-01 22:02:17 +01:00
aquilescanta
6a122f4740 Document injection of DrmSessionManagers into MediaSources instead of Renderers
PiperOrigin-RevId: 263532499
2019-08-15 14:41:52 +01:00
tonihei
cd4571161a Add builders for SimpleExoPlayer and ExoPlayer.
The current ExoPlayerFactory is growing too big and usage becomes increasingly
complicated because it's not possible to set individual components without
specifying many other defaults.

Adding new builder classes makes building easier and more future-proof.

PiperOrigin-RevId: 263339078
2019-08-15 14:41:51 +01:00
olly
fb0481c520 Bump annotations dependency + update release notes
PiperOrigin-RevId: 261353271
2019-08-02 19:04:56 +01:00
olly
d77d661e52 Default viewport constraints to match primary display
PiperOrigin-RevId: 260479923
2019-07-29 21:27:46 +01:00
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