1105 Commits

Author SHA1 Message Date
Oliver Woodman
dcd549bd3e Fix release branch 2018-07-23 14:06:29 +01:00
Oliver Woodman
50c8197004 Widen setOutputSurface workaround 2018-07-23 14:03:59 +01:00
tonihei
e03623f701 Fix issue with keeping window sequence number after repeated seeks.
The number is shelved in calls to queue.clear() to keep it for the next
media period. However, the queue may also become empty by repeated calls to
advancePlayingPeriod which may happen when seeking to an unprepared period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205376036
2018-07-23 13:58:04 +01:00
andrewlewis
0a46e74105 Ignore all edit lists if one track's edits can't be applied
Issue: #4348

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204261718
2018-07-23 13:54:12 +01:00
eguven
2f6273c9fc Fix DownloadService doesn't stop when the app is killed
Also fixed showing "remove notification" when download is completed.

Issue:#4469
Issue:#4488

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203927268
2018-07-23 13:53:52 +01:00
olly
44c45fd18d Move subsampleOffset in Format
It's no longer text specific (it's used for metadata as well, and
in theory could apply to any stream in which samples contain multiple
sub-samples)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203767825
2018-07-23 13:53:38 +01:00
olly
d49c5a476d Tweak DefaultTrackSelector documentation
Viewport constraints apply to adaptive content even if the
actual playback isn't adaptive (i.e. because the selector
ends up making a fixed track selection).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203726831
2018-07-23 13:53:10 +01:00
Drew Hill
7207665ce0 flip flag values to their proper names so that trackselector parameters can be useful 2018-07-23 13:52:55 +01:00
tonihei
f2f149adca Add workaround for unmatched track indices in tkhd and tfhd.
If there is only one track, we can assume that both boxes refer to the same track
even if the track indices don't match.

Issue:#4083

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203485872
2018-07-23 13:52:49 +01:00
olly
6ad98405a3 Avoid providing invalid responses to MediaDrm
MediaDrm.provideXResponse methods only accept the response
corresponding to the most recent MediaDrm.getXRequest call.
Previously, our code allowed the following incorrect call
sequence:

a = getKeyRequest
b = getKeyRequest
provideKeyResponse(responseFor(a));

This would occur in the edge case of a second key request
being triggered whilst the first was still in flight. The
provideKeyResponse call would then fail.

This change fixes the problem by treating responseFor(a)
as stale. Note that a slightly better fix would be to
defer calling getKeyRequest the second time until after
processing the response corresponding to the first one,
however this is significantly harder to implement, and is
probably not worth it for what should be an edge case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203481685
2018-07-23 13:52:41 +01:00
tonihei
a50d31a70b Add workaround for unmatched track indices in trex and tkhd.
Both boxes should contain the same list of track indices. However, if only one
track index in each list does not match, we can just assume that these belong
together.

Issue:#4477

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203481258
2018-07-23 13:52:33 +01:00
olly
165fef8782 Fix application of styles for CEA-608
Issue: #4321

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202660712
2018-07-23 13:50:23 +01:00
olly
3c4384ddd9 Simplify DefaultTrackSelector documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202623116
2018-07-23 13:48:50 +01:00
olly
6cdaf593e0 Improve DefaultTrackSelector documentation
It's quite hard to find the defaults currently. Placing them
on each variable makes them easier to find.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202495929
2018-07-23 13:48:43 +01:00
tonihei
186711287b Add some leeway for finding additional tracks in PsExtractor.
Currently we immediately stop searching after we found one video and one
audio track. This change adds some leeway to detect additional tracks.

Issue:#4406

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202455491
2018-07-23 13:48:18 +01:00
tonihei
a0810856e7 Add DRM workaround for Asus Zenfone 2.
Issue: #4413

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202277924
2018-07-23 13:47:53 +01:00
Keith Thompson
4a8bd911cf Add withSkippedAd method to AdPlaybackState. Currently it is only possible to skip entire ad groups but not individual ads within a given ad group. 2018-07-23 13:45:08 +01:00
Arek Karbowy
cbfa602866 opt out of using DummySurface on specific Fire TV device 2018-07-23 13:44:53 +01:00
olly
9c76ba0603 Wait for DRM keys before codec configuration on FireOS devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695876
2018-07-23 13:44:36 +01:00
olly
0a80b47edb Extract scheme specific data from PSSH for some FireOS devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201679215
2018-07-23 13:43:50 +01:00
olly
9b4981df8a Add some FireOS workarounds for max input buffer size limitations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201678686
2018-07-23 13:43:28 +01:00
olly
5992b310ad Enable EOS workaround for FireTV Gen 2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201678261
2018-07-23 13:43:22 +01:00
aquilescanta
5f79aa253b Add license server URL to SchemeData
Allows DrmInitData to carry a license server URL when the media declares one.

Issue:#3393

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199643743
2018-07-23 13:43:03 +01:00
andrewlewis
680d3fda3e Fix download cancellation
Issue: #4403

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201525284
2018-06-25 22:46:53 +01:00
andrewlewis
b7d149604e Fully clean up resources in EGLSurfaceTexture
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201376315
2018-06-25 22:45:39 +01:00
andrewlewis
1776e6e5b0 Make no context current when releasing DummySurface
This avoids a small native leak.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200955086
2018-06-18 11:33:37 +01:00
olly
3570232cf0 CEA608 - Add space when handling mid-row codes
Issue: #3906

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200526335
2018-06-18 11:33:24 +01:00
andrewlewis
799d281e58 Add support for registering custom MIME types
Also add a few missing MP4 object types.

Issue: #4264

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199778373
2018-06-18 11:29:23 +01:00
andrewlewis
3f2d20140f Fix some javadoc errors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199650794
2018-06-18 11:27:42 +01:00
andrewlewis
ef8a47ba7d Fix some categories of error prone warnings
When switching from Stack to ArrayDeque, calls to add() need to be replaced by
calls to push() because ArrayDeque treats the first element in the list as the
top of the stack.

String.split() has counterintuitive default behavior; see
https://github.com/google/error-prone/blob/master/docs/bugpattern/StringSplitter.md.
I've switched usages to pass limit = -1 argument, which means empty elements are
no longer removed from the end of the returned array.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199472592
2018-06-06 19:13:05 +01:00
olly
1481801891 Bump version + update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199453125
2018-06-06 19:12:45 +01:00
Oliver Woodman
a877bbaf7b Remove NullableType usage from release branch 2018-06-05 22:37:50 +01:00
Oliver Woodman
97e68ecc31 Fix release branch 2018-06-05 22:30:58 +01:00
Oliver Woodman
615b2b1039 Fix punctuation 2018-06-05 22:28:50 +01:00
Anton Potekhin
4998354cb1 Blacklist Moto C from setOutputSurface
Issue: #4315
2018-06-05 22:28:30 +01:00
tonihei
3c6ca19c85 Fix track selection nullability issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199266768
2018-06-05 15:18:39 +01:00
olly
6a82f99ca1 Explicitly null MediaPeriod callbacks on release
If a MediaPeriod uses a Loadable, then there are typically
reference chains of the form:

LoadingThread[GCroot]->Loadable->MediaPeriod->Player

Where the player is the MediaPeriod callback. When the
player is released, this reference chain prevents the
player from being GC'd until Loadable cancellation
completes, which may not always be fast. This in turn
will typically prevent the application's activity from
being GC'd, since it'll normally be registered as a
listener on the player (directly or indirectly via
something like a view).

This change mitigates the issue by removing references
that the MediaPeriod holds back to the player. The
MediaPeriod will still not be eligible for GC, but the
player and application activity will be, which in most
cases will be most of the leak (in terms of size).

Issue: #4249

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199143646
2018-06-05 15:18:33 +01:00
eguven
5a6507b72d Fix starting the download service in the background throw exception
This happens when the device screen is locked.

This fixes a previous attempt to fix the problem.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199130325
2018-06-05 15:18:24 +01:00
andrewlewis
0d59dc4c43 Fix variable name
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199120421
2018-06-05 15:18:15 +01:00
tonihei
b68dcb0b5b Allow setting player lazily in AnalyticsCollector.
This helps to use the AnalyticsCollector without SimpleExoPlayer. Currently,
that may be problematic, if the contructor needs the player, but in order to
create the player, one already needs the AnalyticsCollector as a listener for
the renderers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199105012
2018-06-05 15:17:46 +01:00
olly
7621a71bc3 Remove Loadable.isLoadCanceled
This simplifies Loadable implementations, and also removes the
possibility of an incorrect Loadable implementation causing the
wrong Loader.Callback method being called (perviously, for the
correct method to be called, we relied on isLoadCanceled being
implemented correctly).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198871133
2018-06-05 15:17:26 +01:00
eguven
3670111310 Avoid starting RequirementsWatcher if there is no download task
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198860680
2018-06-05 15:17:17 +01:00
tonihei
928cbfa7bc Replace hash by Object reference for uids.
There is the small (but unlikely) chance that the uids clash because the
Objects have the same hash code.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198855724
2018-06-05 15:16:58 +01:00
olly
7d0769249f Avoid possibility of leaking an activity/service context
The bug here was that we'd create a VideoFrameReleaseTimeHelper
using whatever context DefaultRenderersFactory has, and it would
then hold a reference to that context via DisplayManager. A leak
could then occur if the player outlived the life of the context
used to create it (which would be strange/unusual, but not
impossible).

Issue: #4249

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198747599
2018-06-05 15:15:49 +01:00
olly
4ecce9802b Explicitly null out LoadTask.callback on release
As highlighted by the ref'd issue, we can end up with
memory leaks if Loadable.load implementations take a long
time to return upon cancelation. This change cuts off one
of the two problematic reference chains.

This doesn't do much about the ref'd issue, since there's
a second reference chain that's much harder to deal with:
Thread->LoadTask->loadable. But since it's easy just to
cut this one off, I figure it makes sense to do so.

Issue: #4249

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198735386
2018-06-05 15:15:41 +01:00
tonihei
cd65cc85e2 Clarify threading requirements for the player in the doc.
This makes the requirement that all calls are made on one thread more
explicit and also mentions this in the Getting Started guide.

Issue:#4278

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198694579
2018-06-05 15:15:32 +01:00
sammon
cd7f1b9558 Explicitly support MediaChunk.chunkIndex = C.INDEX_UNSET. This is common in
Manifestless streams.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198445216
2018-06-05 15:15:00 +01:00
olly
059f810774 Make BaseMediaChunkOutput properly public
I think it was just wrong that it was package private before, since
it resulted in our public API referencing something that's not part
of the public API:

https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/source/chunk/BaseMediaChunk.html#init-com.google.android.exoplayer2.source.chunk.BaseMediaChunkOutput-

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198396555
2018-06-05 15:14:51 +01:00
eguven
1d7ecd73b7 Roll forward of []
Set content length and redirect uri in a single transaction.

New: Fixed the code where DataSpec.uri is set to null in []

Automated g4 rollback of changelist 196765970.

*** Reason for rollback ***

Fixed the code where DataSpec.uri is set to null in []

*** Original change description ***

Automated g4 rollback of changelist 194932235.

*** Reason for rollback ***

This CL breaks the playability of Mango's offlined progressive videos.

*** Original change description ***

Set content length and redirect uri in a single transaction

NORELNOTES=true
NO_BUG

***

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198370211
2018-06-05 15:14:37 +01:00
sammon
3974a8464a Exposing BaseMediaChunkOutput as public so that BaseMediaChunk.init() is unit testable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198062017
2018-06-05 15:14:29 +01:00