2683 Commits

Author SHA1 Message Date
olly
0adb4502f6 Ignore all-zero defaultKid
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168259911
2017-09-15 23:29:28 +01:00
olly
340d0be40a Bump to 2.5.2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168155713
2017-09-10 16:48:39 +01:00
olly
5a4155f09f Destroy EGLSurface during DummySurface cleanup
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168020525
2017-09-08 22:28:10 +01:00
tonihei
ec38d0d8ab Check thread is still alive before sending message in Loader.
The release callback handler in Loader might not be alive
anymore. Catch this case to prevent warnings about sending
messages on dead threads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167996538
2017-09-08 22:25:37 +01:00
andrewlewis
7c3fe19d3f Migrate remaining tests to Robolectric
Remaining instrumentation tests either use android.os.Handler or rely on assets.
In the latter case, the tests are difficult to migrate due to differences
between the internal and external build systems, and configuration needed in
Android Studio. In addition, SimpleCacheSpanTest remains as an instrumentation
test because it fails due to a problem with string encoding on the internal
build (and two other tests in its package are kept with it because they depend
on it).

This test removes a dependency from testutils on Mockito, as a different
version of Mockito needs to be used for instrumentation tests vs Robolectric
tests, yet both sets of tests need to rely on testutils. Mockito setup is now
done directly in the tests that need it.

Move OggTestData to testutils so it can be used from both instrumentation and
Robolectric tests.

It may be possible to simplify assertions further using Truth but this is left
for possible later changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167831435
2017-09-08 22:21:33 +01:00
olly
7d4190f3c8 Regroup final/non-final vars
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167717715
2017-09-06 15:56:48 +01:00
olly
c6fa034eba DecryptionException cleanup + add missing header
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167711928
2017-09-06 15:55:21 +01:00
olly
d66143d96d Add full stops
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167711267
2017-09-06 15:53:57 +01:00
olly
e7992513d3 Remove references to MediaDrm from DefaultDrmSession classes
Everything should go through the ExoMediaDrm layer. We still
need to abstract away the android.media exception classes, but
this is left as future work.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167710213
2017-09-06 15:52:28 +01:00
olly
013379fd3e Workaround for SurfaceView not being hidden properly
This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.

Issue: #3160

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070
2017-09-06 15:51:01 +01:00
olly
17232f58a3 Fix position reporting during ads when period has non-zero window offset.
Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: #3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
2017-09-06 15:49:34 +01:00
andrewlewis
8ef6a2e7bd Clear gapless playback metadata for clipped media
Also pass an unresolved end point to ClippingMediaPeriod. This removes some
assertions checking timestamps in the ClippingMediaPeriod, but makes it
possible to identify when the end point is at the end of the media.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167683358
2017-09-06 15:48:05 +01:00
olly
fb023da529 Fix attr inheritance in SimpleExoPlayerView
When creating PlaybackControlView inside SimpleExoPlayerView,
we want certain attributes to be passed through. This lets you
set control attributes on the SimpleExoPlayerView directly. We
don't want all attributes to be propagated though; only our own
custom ones.

Not sure if there's a cleaner way to do this. Pragmatically this
solution seems ... ok :)?

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167619801
2017-09-06 15:46:44 +01:00
zhihuichen
b62eab63a4 Implement multi session to support DRM key rotation.
Spec: https://storage.googleapis.com/wvdocs/Widevine_DRM_Android_Using_Key_Rotation.pdf

1. Implement multisession to support drm key rotation
2. Put MediaDrmEventListener back to manager since this is a per mediaDrm thing.
3. It seems diffrenciate between single/multi session is unnecessary.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167602965
2017-09-06 15:45:22 +01:00
olly
0183a83047 Don't use MediaCodec.setOutputSurface on Nexus 7 with qcom decoder
Issue: #3236

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167581198
2017-09-05 16:47:55 +01:00
tonihei
2f4a3fe1f3 Add postDelayed operation to Clock interface.
The default implementation is just calling through to handler.postDelayed,
while the fake clock uses its internal time value to trigger the handler
calls at the correct time.

This is useful to apply a fake clock in situations where a handler is used to
post delayed messages.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167567914
2017-09-05 16:34:44 +01:00
olly
bec5e6e2b2 Rewrite logic for enabling secure DummySurface
Issue: #3215

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167505797
2017-09-05 16:31:44 +01:00
olly
a0df5bb50a Be robust against unexpected EOS in WebvttCueParser
Issue: #3228

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167504122
2017-09-05 16:30:19 +01:00
olly
472df08f08 Additional secure DummySurface device exclusions
Merge: https://github.com/google/ExoPlayer/pull/3225

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167502127
2017-09-05 16:28:46 +01:00
hoangtc
0d86f4475c Remove the resampling to 16bit step from FlacDecoder.
Currently FlacDecoder/FlacExtractor always perform resampling to 16bit. In some
case (with 24bit audio), this might lower the audio quality if the system
supports 24bit audio.
Since AudioTrack implementation supports resampling, we will remove the
resampling step, and return an output with the same bits-per-sample as the original stream.
User can choose to re-sample to 16bit in AudioTrack if necessary.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167494350
2017-09-04 16:30:37 +01:00
andrewlewis
bab2ce817e Allow EXIF tracks to be exposed
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167493800
2017-09-04 16:29:11 +01:00
olly
ab1e4df11a Update moe eqiuvalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167488837
2017-09-04 16:27:40 +01:00
ojw28
0da8e1af67 Merge pull request #3225 from dbrain/3215_additional_dummy_secure_surface_exclusions
#3215 Additional secure DummySurface device exclusions
2017-09-04 15:28:50 +01:00
Oliver Woodman
74b8c45e6d Minor cleanup to AspectRatioFrameLayout 2017-09-04 11:34:57 +01:00
ojw28
1a6a6c901f Merge pull request #3223 from Shyri/vp09-support
Add support for new codecs parameter string
2017-09-04 10:33:02 +01:00
ojw28
21363d2f8e Merge pull request #3187 from stellabei/stellabei/aspect-ratio-crop
Support zoom mode for AspectRatioFrameLayout
2017-09-04 10:31:21 +01:00
olly
ca2bfbc56e DashManifestParser: Move schemeType up to DrmInitData
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167171407
2017-09-04 10:23:33 +01:00
andrewlewis
daafbb1f1c Add missing Robolectric test path to codebase
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167151714
2017-09-04 10:22:17 +01:00
andrewlewis
f15ce81c47 Move some unit tests to use Robolectric
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167148146
2017-09-04 10:20:59 +01:00
olly
6bd0ba887c Allow more aggressive switching for HLS with independent segments
We currently switch without downloading overlapping segments, but
we do not actually switch more aggressively. This change fixes
this. Note there's an implicit assumption made that if one media
playlist declares independent segments, the others will too. This
is almost certainly true in practice, and if it's not the penalty
isn't too bad (the player may try and switch to a higher quality
variant one segment's worth of buffer too soon).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167120992
2017-08-31 16:33:43 +01:00
andrewlewis
0b78837f35 Fix ContentDataSource bytesRemaining calculation
The bytesRemaining didn't always take into account any skipped bytes, which
meant that reaching the end of the file was not correctly detected in read().

Issue: #3216

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167016672
2017-08-31 16:32:28 +01:00
andrewlewis
e80a93d799 Use UTF-8 everywhere
UTF-8 is the default charset on Android so this should be a no-op change, but
makes the code portable (in case it runs on another platform).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167011583
2017-08-31 16:29:44 +01:00
Danny Brain
0c7f11606f #3215 Additional secure DummySurface device exclusions 2017-08-31 14:31:18 +10:00
Shyri Villar
49c2926e45 Add support for new codecs parameter string 2017-08-30 16:25:50 +02:00
olly
6bf0b7f3de Fix moe config II
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166916769
2017-08-29 23:56:36 +01:00
olly
b0df6dce98 Fix moe config
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166914821
2017-08-29 23:55:19 +01:00
olly
5bed2bf503 Don't copy primary-track format to non-primary tracks
This time plumbing the track type in from the other side.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166898172
2017-08-29 23:17:16 +01:00
olly
d9cd13ce74 Automated rollback of changelist 166843123.
*** Reason for rollback ***

Doesn't work because trackOutputProvider can be null when extracting init data.

*** Original change description ***

Don't copy primary-track format to non-primary tracks

Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166883654
2017-08-29 23:14:33 +01:00
olly
55e928f75a Make LeanbackPlayerAdapter use a ControlDispatcher + Misc cleanup
1. Make LeanbackPlayerAdapter use a ControlDispatcher. This
   allows apps to suppress control events in some circumstances,
   and is in-line with our mobile controls.
2. Misc simplifications and cleanup to LeanbackPlayerAdapter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852816
2017-08-29 23:13:13 +01:00
olly
44dc3c3ab3 Make all renderers DRM aware
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852758
2017-08-29 23:11:55 +01:00
olly
b2c245281a Parse SchemeData from urn:mpeg:dash:mp4protection:2011 element
Issue: #3138

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166849631
2017-08-29 23:10:36 +01:00
aquilescanta
aafdd2267a Add media queue support to CastPlayer
Also workaround the non-repeatable queue and fix other minor issues.

Issue:#2283

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166848894
2017-08-29 23:09:03 +01:00
olly
f44e30c754 Fix mapping CLEARKEY_UUID to COMMON_PSSH_UUID
This mapping when we call into platform components also needs
to be applied when creating the MediaCrypto instance. The fix
is to stop propagating the UUID through all the createMediaCrypto
methods. This is unnecessary, since the eventual target already
knows its own UUID!

Issue: #3138

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843372
2017-08-29 23:07:39 +01:00
olly
3e76227006 Don't copy primary-track format to non-primary tracks
Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843123
2017-08-29 23:06:16 +01:00
andrewlewis
ba6d208fe9 Use Math.abs in Sonic.java
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166820970
2017-08-29 23:04:52 +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
30b31b5679 Support empty concatenations and empty timelines in concatenations.
Both cases were not supported so far. Added tests which all failed in the
previous code version and adapted the concatenated media sources to cope with
empty timelines and empty concatenations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166480344
2017-08-29 23:01:41 +01:00
tonihei
1b9c904dba Add UI for shuffle mode.
This includes an option to show and hide the shuffle mode button. When
pressing the button, the shuffle mode of the player is toggled.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166455759
2017-08-29 22:58:42 +01:00
olly
6907ffb285 Remove unnecessary view casts
findViewById is now defined using generics, which allows
the types to be inferred.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166355555
2017-08-29 22:57:17 +01:00
olly
6e03dcdfa1 Add LocalMediaDrmCallback. Useful for providing local keys.
Issue: #3178

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166330215
2017-08-29 22:55:51 +01:00