237 Commits

Author SHA1 Message Date
ibaker
710dff0388 Disable setOutputSurface workaround for all codecs in GTS tests
Issue: #8427
PiperOrigin-RevId: 355381785
2021-02-03 15:03:24 +00:00
olly
a1f06987eb Replace non-inclusively named constant
Issue: #7565
PiperOrigin-RevId: 353649187
2021-01-25 17:38:26 +00:00
krocard
ec43735054 Split mutations method out of TrackSelection
`TrackSelection` had mutation methods which were to be called only
internally by ExoPlayer components but were exposed in the
public `Player` interface.

The mutation methods have been moved out of `TrackSelection`
to a new class `ExoTrackSelection`.

Current track related read-only method have also been moved out,
because they are actually something quite unclear.
Even for a single item playlist, it's the track being buffered rather
than the track being played, which is unclear.
But when you have a playlist it starts to get really confusing,
because if the next item is being buffered, then it's actually
the last track to be buffered in the currently playing item.
As a final aside, the implementations don't do proper thread synchronization
to ensure visibility of updated state by the calling thread.

Exposing those mutable methods in the public `Player` interface
was problematic because they leaking internal concepts of `ExoPlayer`.
This is also required to minimize the `Player` interface for long term
stability.

`ExoTrackSelection` is a subclass of `TrackSelection`.
This is not ideal as an `TrackSelection` implementation could
break the current immutability.
This was done in order for this refactor to be simpler.
A future patch will fully split the two classes.

All `MediaPeriod` and `Sources` had to be updated to use the new
`TrackSelection` dynamic aspect class name.
An alternative would have been to break ExoPlayer's public API, keeping
`TrackSelection` as the dynamic aspect name, and calling the public static
aspect class `TrackSelectionState` or similar.
Nevertheless, while it would have impacted less files, it would have
many more small apps and casual users of ExoPlayer.

#player-to-common

PiperOrigin-RevId: 353637924
2021-01-25 15:37:38 +00:00
ibaker
71c2b8a76c Re-add the v22 and v29 test targets
PiperOrigin-RevId: 351393044
2021-01-13 00:04:06 +00:00
ibaker
704f006be1 Remove mobile_test_v29 while the V29 tests are disabled
PiperOrigin-RevId: 351117930
2021-01-11 18:05:14 +00:00
ibaker
1057f2e455 Remove mobile_test_v22 while the V22 tests are disabled
PiperOrigin-RevId: 350578598
2021-01-08 15:32:47 +00:00
ibaker
a25ad03b9f Disable DashWidevineOfflineTest
These tests are performing offline-centric assertions using a streaming
licence. They need to be reconfigured to use a new offline-centric
licence that sets the correct duration fields (rental_duration_seconds
and playback_duration_seconds).

PiperOrigin-RevId: 350550971
2021-01-08 15:32:16 +00:00
krocard
538445572d Move FormatSupport in common
#player-to-common

PiperOrigin-RevId: 344558028
2020-11-30 09:33:11 +00:00
olly
c47e62209d Report reasons for not being able to reuse decoders
PiperOrigin-RevId: 342344090
2020-11-16 16:49:48 +00:00
ibaker
99b87139df Change Truth assertions in DashWidevineOfflineTest to increase clarity
PiperOrigin-RevId: 342040610
2020-11-13 14:55:01 +00:00
christosts
1d4321b86e Move ownership of MediaCodec to MediaCodecAdapter
Move ownership of MediaCodec to MediaCodecAdapter so that all MediaCodec
interactions go through MediaCodecAdapter.

PiperOrigin-RevId: 341066926
2020-11-11 09:49:21 +00:00
ibaker
32194def67 Exclude PC devices from H.265 GTS tests
PiperOrigin-RevId: 333031399
2020-09-25 16:29:53 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
samrobinson
99dbb76455 Allow Format change in GTS test for MediaFormat time check.
PiperOrigin-RevId: 330348510
2020-09-07 20:43:19 +01:00
samrobinson
d1631cf86f Disable MediaFormat time check GTS test temporarily.
PiperOrigin-RevId: 329956142
2020-09-07 20:42:51 +01:00
samrobinson
0f29b9e84d Change GTS test boolean to a final variable.
PiperOrigin-RevId: 329714283
2020-09-07 20:41:46 +01:00
ibaker
5b80eb8ecc Enable multidex for the playback tests
PiperOrigin-RevId: 329527311
2020-09-07 20:40:23 +01:00
ibaker
91185500a1 Remove usage of assertThrows from ExoPlayer GTS tests
The environment these tests are executed in is only using JUnit 4.10,
which doesn't have assertThrows.

PiperOrigin-RevId: 329462985
2020-09-07 20:39:55 +01:00
andrewlewis
d881a675d0 Check output format change timing after API 30
PiperOrigin-RevId: 327795332
2020-08-26 16:38:57 +01:00
andrewlewis
0d8f016d33 Assume software decoder fix will happen before API 31 too
PiperOrigin-RevId: 327782731
2020-08-21 12:55:37 +01:00
samrobinson
7abece9a39 Add a software decoder check to MediaFormat change GTS test.
PiperOrigin-RevId: 327620772
2020-08-21 12:51:42 +01:00
ibaker
3af82b2a8b Skip WV tests on devices where WV is unsupported
PiperOrigin-RevId: 327392056
2020-08-21 12:50:47 +01:00
olly
7588c26b60 Remove support for cbc1 and cens encryptions schemes
PiperOrigin-RevId: 327199833
2020-08-21 12:48:39 +01:00
samrobinson
1b9992cf7a Add a GTS test for MediaFormat change occurring at the correct time.
PiperOrigin-RevId: 326428782
2020-08-17 16:12:12 +01:00
aquilescanta
fcb263a407 Make DrmSessionManager take a Format instead of DrmInitData
Skipping acquirePlaceholderSession which will be removed
in a following change.

PiperOrigin-RevId: 326402746
2020-08-17 16:11:17 +01:00
ibaker
fda3b3d8ec Use static imports for methods that make sense without their class name
PiperOrigin-RevId: 323349585
2020-07-27 23:59:52 +01:00
ibaker
161dea661f Assorted deprecation fixes/migrations/suppressions
These were missed on the first pass

PiperOrigin-RevId: 321553847
2020-07-24 10:37:41 +01:00
ibaker
ab95e3f388 Migrate usages of deprecated SimpleCache constructors
I duplicated some methods in SimpleCacheTest to ensure we keep testing
the deprecated code paths for now.

PiperOrigin-RevId: 321548802
2020-07-24 10:37:14 +01:00
ibaker
5c4b8085a0 Migrate usages of DefaultDrmSessionManager constructor to Builder
PiperOrigin-RevId: 321174738
2020-07-24 10:34:21 +01:00
ibaker
2f19b63ca0 Add package-info files to packages that only exist in tests
This doesn't affect the nullness checker or Kotlin, but it does make
weird warnings appear in Android Studio. It seems mildly preferable to
have the same spurious warnings in these files that we have in other
tests, rather than different spurious warnings.

PiperOrigin-RevId: 321173760
2020-07-24 10:34:12 +01:00
ibaker
fa594489d9 Completely separate MediaSource & DrmSession EventDispatchers
PiperOrigin-RevId: 319989989
2020-07-08 13:55:38 +01:00
samrobinson
81b0b53a37 Propagate gapless audio delay & padding.
MediaCodec does not need to be re-created in the
event of gapless metadata.

PiperOrigin-RevId: 318439694
2020-06-26 11:23:19 +01:00
tonihei
4138e28d62 Move common gradle setup to a setting file.
This removes a lot of duplication from the module configuration,
avoids divergence, and makes sure that only the important differences
to the default are visible in each module file.

PiperOrigin-RevId: 318024823
2020-06-26 11:13:25 +01:00
christosts
41d4a132c4 Add configure() in MediaCodecAdapter
The correct order of initializing the MediaCodec should be (as per
documentation
https://developer.android.com/reference/android/media/MediaCodec#initialization)

"create -> setCallback -> configure -> start"

but the MediaCodecRenderer currently does

"create -> configure -> setCallback -> start"

MediaCodec implementations did not complain about this so far, but the
wrong sequence does not work with the MediaCodec in block mode (new mode
in Android R) and also the ShadowMediaCodec won't operate in
asynchronous mode otherwise. To initialize the MediaCodec in the correct
order, this commit adds configure() in the MediaCodecAdapter so the
MediaCodecRenderer can do:

adapter.configure(); // sets the callback and then configures the codec
adapter.start();     // starts the codec

PiperOrigin-RevId: 316127680
2020-06-17 14:28:57 +01:00
ibaker
b9157a9e23 Add Guava dependency to ExoPlayer
Guava is heavily optimized for Android and the impact on binary size
is minimal (and outweighed by the organic growth of the ExoPlayer
library).

This change also replaces Util.toArray() with Guava's Ints.toArray()
in order to introduce a Guava usage into a range of modules.

PiperOrigin-RevId: 312449093
2020-05-21 17:08:33 +01:00
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