3457 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
tonihei
f9661b5373 Use Handler callback instead of sleep() to catch InteruptedException.
The sleep used to simulate data load times is ignoring InterruptedExceptions.
(This is intended and in line with SystemClock.sleep()). However, when a
Loader cancels an ongoing load, it uses interrupts. To be able to catch these
and to immediately return from the reading data source, a handler callback
is used instead of the sleep() method which allows interuptable waiting.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168212652
2017-09-15 23:28:13 +01:00
tonihei
c4bf83dd1a Support stop() in FakeExoPlayer and release media properly.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168209817
2017-09-15 23:26:56 +01:00
tonihei
c181057550 Fix bug in ActionSchedule.
When having a repeat() action and another subsequent action,
the next action should only be scheduled once (and not repeatedly).
Thus, the "next" pointer in the repeated action needs to be nulled
in the first iteration to prevent repeated scheduling of the next action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168202212
2017-09-15 23:25:45 +01:00
tonihei
9a91482a1b Release streams in fake adaptive media period.
Releasing the media period should also release the sample streams
to allow resources to be cleaned up.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168201377
2017-09-15 23:24:28 +01:00
olly
75d5adce6f Update dependency versions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168194589
2017-09-15 23:23:16 +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
olly
40d443dc02 Enable rtmp in external demo app with extensions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168007345
2017-09-08 22:26:54 +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
tonihei
8f43dcd424 Clear buffer in fake renderer in each iteration.
This simulates reading from the buffer (which is what actual
renderers would do). Otherwise the buffer always gets expanded
and might cause memory issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167994899
2017-09-08 22:24:19 +01:00
tonihei
b2627d63fd Allow ExoPlayerTestRunner to end when Player.stop() is called.
In this case the playback state transitions to IDLE, which isn't
caught so far. (This code is equivalent to the one in ExoHostedTest.java)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167980981
2017-09-08 22:22:57 +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
Oliver Woodman
7053284b02 Merge branch 'release-v2' into dev-v2 2017-09-06 19:05:37 +01:00
olly
4869a25069 Pick up rtmpClient fix
Issue: #3156

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167718081
2017-09-06 15:58:02 +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
andrewlewis
e16610a82c Fix import formatting
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167584287
2017-09-06 15:44:01 +01:00
tonihei
8413dab9de Use clock in action schedule to handle delays.
This allows to use a fake clock and an action schedule with timed delays
together.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167582860
2017-09-06 15:42:39 +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
olly
a90cef0cb5 Upgrade gradle plugin / wrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167579719
2017-09-05 16:47:38 +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
tonihei
264f1c903d Fix bug in FakeChunkSource.
In order to retrieve the data set, the track selection index was used, but
the data set is actually indexed by track group indices.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167566049
2017-09-05 16:33:17 +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
andrewlewis
c9f31a41cd Adding missing license header in IMA build.gradle
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167496569
2017-09-04 16:31:51 +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
ba0bd72919 Fix typo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167474040
2017-09-04 10:28:54 +01:00
anjalibh
7804c2b079 HDR 10 bits: Use a separate sampler for U and V dithering.
Using the same sampler introduced some minor horizontal scratches.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167347995
2017-09-04 10:27:38 +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
bachinger
84c13ccbf3 Support setRepeatMode (and move shuffle action to PlaybackController)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167013507
2017-08-31 16:31:10 +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