657 Commits

Author SHA1 Message Date
zhihuichen
b14b3d43de Expose OnKeyStatusChange events, this is required to learn the usabilities of the keys.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170268043
2017-10-03 08:45:53 +01:00
tonihei
52de36c5eb Add abstract, default Player event listener.
This allows simplified listener implementations as most listeners
will not listen to all possible notifications.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
2017-10-03 08:44:33 +01:00
andrewlewis
06f7b6be6a Use IntDef for AudioTrack.startMediaTimeState
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169880369
2017-09-26 14:00:59 +01:00
eguven
1f8a8dbfa3 Add version number to serialized DownloadAction data
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169681768
2017-09-26 13:57:32 +01:00
aquilescanta
4fb18453e1 Add a "forceLowestBitrate" option to DefaultTrackSelector
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169668371
2017-09-26 13:56:04 +01:00
aquilescanta
25a9177ce3 Deduplicate DefaultTrackSelector javadocs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169552239
2017-09-26 13:54:10 +01:00
olly
ce7aaab3c6 Handle bracket params on the end of SmoothStreaming URLs
Issue: #3230

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169421873
2017-09-20 19:29:17 +01:00
aquilescanta
6314a0ec82 Add support for Widevine encrypted HLS
This includes both cbcs and cenc. Will only work for streams that require a single
pssh.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169382884
2017-09-20 19:28:02 +01:00
olly
67567ffa6c TsExtractor: Do less work if payload reader does not exist
There's no reason to perform the discontinuity check or skip
the adaptation field if we don't have a payload reader for
the packet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169374609
2017-09-20 11:57:47 +01:00
olly
ed76882271 Bump version + release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169257339
2017-09-19 18:26:05 +01:00
olly
d346266dc9 Workaround Samsung tablet reboot playing adaptive secure content
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169256059
2017-09-19 18:23:28 +01:00
olly
89f66924d5 Use IntDef for MediaCodecRenderer internal states
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169254794
2017-09-19 18:22:03 +01:00
eguven
09248608c0 Notify span listeners even if index store fails in SimpleCache.removeSpan
This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails.

Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache
constructor so mock index can be injected.

Issue: #3260

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249517
2017-09-19 18:20:34 +01:00
eguven
8a0e148041 Workaround a cipher issue in Android 4.3
[]

Issue: #2755

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249093
2017-09-19 18:19:08 +01:00
eguven
9bdf1ee944 Check if the cache is already empty before trying to evict more span
This case may happen if the max span size is more than the max size the
evictor is configured.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169101093
2017-09-19 18:14:54 +01:00
aquilescanta
5e2c7d967a Fix 2 CEA decoder bugs
1- Avoid dropped buffers by using a PriorityQueue instead of a set.
2- Process the end of stream after non-EOS buffers.

Issue:#3250

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169077365
2017-09-19 18:13:31 +01:00
andrewlewis
457d0ba1b9 Work around broken AAC decoders on Galaxy S6
Issue: #3249

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168844850
2017-09-15 23:49:34 +01:00
aquilescanta
6592a6474e Improve documentation for SCTE35-related metadata
Also expose break_durations in microseconds instead of 90kHz.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168816992
2017-09-15 23:47:12 +01:00
olly
a3a2fb506c Provisioning: Fix some (admittedly quite theoretical) issues:
1. Only tell sessions that want provisioning when provisioning occurs.
2. Also propagate failure to provision to these sessions.
3. If a session responsible for provisioning is released, start
   provisioning using another session instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168713918
2017-09-15 23:44:38 +01:00
olly
a479afff5f Fix potential NPE/ThreadSafety issues with MediaDrm listener
- MediaDrmEventListener.onEvent is typically called on the
  app's main thread. mediaDrmHandler is instantiated on the
  playback thread. Hence mediaDrmHandler should be volatile
  to ensure visibility.
- Nulling mediaDrmHandler could result in a NPE in onEvent.
  Instantiate mediaDrmHandler (and don't null it again) to
  avoid this. MediaDrmHandler.handleMessage will correctly
  discard any events for sessions that are now closed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168707938
2017-09-15 23:43:18 +01:00
andrewlewis
58293abc11 Remove IMA dependency and add AdsMediaSource
AdsMediaSource lives in the core library so only ImaAdsLoader remains in
the ima extension. AdsMediaSource takes an AdsLoader implementation.

ImaAdsMediaSource is deprecated rather than removed for now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168707921
2017-09-15 23:41:59 +01:00
hoangtc
b3004ab1c3 Do not apply SampleStream skip-ahead for NoSampleRenderer.
Currently, to make transition to next media period seamless, after the renderer
has read until the end of the current SampleStream, we may send it the next
SampleStream so the renderer may read from the next SampleStream ahead of the
transition.
For NoSampleRenderer, we should avoid doing this: skipping ahead for such
renderer doesn't have any benefit (the renderer does not consume data from
SampleStream), and it will change the provided rendererOffsetUs while the
renderer is still rendering from the playing media period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168669800
2017-09-15 23:38:06 +01:00
tonihei
7d59383cc4 Add reason to onPositionDiscontinuity.
This allows listeners to easily determine the source of the discontinuity.
Reasons can be period transitions, seeks, and internal reasons.

Listeners still using the deprecated ExoPlayer.EventListener interface were
updated to Player.EventListener.

GitHub: #3252

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168549612
2017-09-15 23:36:46 +01:00
andrewlewis
872cbec9e1 Add TrimmingAudioProcessor for gapless
Remove gapless functionality that relies on MediaCodec, and implement this in
an AudioProcessor instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168547487
2017-09-15 23:35:33 +01:00
hoangtc
c9591d7617 Added support for No-Sample Renderer.
Currently our Renderer is always associated with and consume data from
some SampleStreams, which were constructed from the provided MediaSource.
There are use-cases, in which the users want to have simple Renderer
implementation that does not consume data from SampleStream at all, but
render using their custom logic at each rendering position - they mostly just
need ExoPlayer to keep track of the playback position and enable/disable the
renderer.
This CL adds support for such Renderer by adding a TRACK_TYPE_NONE.
Renderer of such type will be:
- Associated with null TrackSelection as the result of track-selection
operation.
- Associated with EmptySampleStream.

GitHub: #3212

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168545749
2017-09-15 23:34:21 +01:00
hoangtc
5019da3e7b Update ABR logic in AdaptiveTrackSelection for live streaming case
In live streaming, if the playback position is very close to live edge,
the buffered duration will never reach minDurationForQualityIncreaseMs,
which prevents switching from ever happening. So we will provide the
durationToLiveEdgeUs to AdaptiveTrackSelection in live streaming case,
so it can handle this edge case.

GitHub: #3017

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168535969
2017-09-15 23:33:10 +01:00
aquilescanta
f257300d8e Add tv module for USB tuner support + demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168366847
2017-09-15 23:30:41 +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
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
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
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
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