4682 Commits

Author SHA1 Message Date
tonihei
0145edb60d Move MediaSource masking code into separate class.
The masking logic for unprepared MediaSources is currently part of
ConcatanatingMediaSource. Moving it to its own class nicely separates the
code responsibilities and allows reuse.

PiperOrigin-RevId: 256360904
2019-07-05 17:31:11 +01:00
olly
7964e51e0e Remove more classes from nullness blacklist
PiperOrigin-RevId: 256202135
2019-07-05 17:30:19 +01:00
aquilescanta
7408b4355a Add DRM format support checks for MediaSource provided DRM
PiperOrigin-RevId: 256161522
2019-07-02 17:50:06 +01:00
Oliver Woodman
16bf7f9106 Merge pull request #5908 from sr1990:dev-v2
PiperOrigin-RevId: 256147805
2019-07-02 17:49:45 +01:00
olly
6febc88dce FLV extractor fixes
1. Only output video starting from a keyframe
2. When calculating the timestamp offset to adjust live streams to start
   at t=0, use the timestamp of the first tag from which a sample is actually
   output, rather than just the first audio/video tag. The test streams in
   the referenced GitHub issue start with a video tag whose packet type is
   AVC_PACKET_TYPE_SEQUENCE_HEADER (i.e. does not contain a sample) and whose
   timestamp is set to 0 (i.e. isn't set). The timestamp is set correctly on
   tags that from which a sample is actually output.

Issue: #6111
PiperOrigin-RevId: 256147747
2019-07-02 17:49:24 +01:00
tonihei
04959ec648 Remove unnecessary variables from ConcatenatingMediaSource.
The total window and period count, as well as the period offset for each holder
are not actually needed and can be removed.

Also added a TODO to remove two other variables if possible.

PiperOrigin-RevId: 255945584
2019-07-02 17:48:04 +01:00
tonihei
71de1d37ac Don't consume touch events if no controller is attached.
Issue:#6109
PiperOrigin-RevId: 255933121
2019-07-02 17:47:45 +01:00
andrewlewis
6fe70ca43d Use the floor of the frame rate for capability checks
PiperOrigin-RevId: 255584000
2019-07-02 17:47:26 +01:00
andrewlewis
244c202c56 Fix hidden API warnings from Metalava
PiperOrigin-RevId: 255442455
2019-07-02 17:46:49 +01:00
tonihei
2a765f6b5a Visibility clean-up: Don't extend visibility of protected methods in overrides.
PiperOrigin-RevId: 255412493
2019-07-02 17:46:30 +01:00
tonihei
1bd73eb70e Cleanup: Remove DynamicConcatenatingMediaSource
PiperOrigin-RevId: 255410268
2019-07-02 17:46:10 +01:00
olly
cf68d4eb47 Cleanup: Remove deprecated text and metadata output interfaces
PiperOrigin-RevId: 255380951
2019-07-02 17:45:51 +01:00
olly
1d36edc214 Remove unnecessary FileDescriptor sync
PiperOrigin-RevId: 255380796
2019-07-02 17:45:32 +01:00
olly
2a366e76b7 Cleanup: Remove deprecated message sending functionality
PiperOrigin-RevId: 255379393
2019-07-02 17:45:13 +01:00
olly
c974f74b1f Cleanup: Remove deprecated DataSpec.postBody
PiperOrigin-RevId: 255378274
2019-07-02 17:44:55 +01:00
olly
3c2afb16e6 Cleanup: Remove deprecated ChunkSampleStream constructor
PiperOrigin-RevId: 255377347
2019-07-02 17:44:36 +01:00
tonihei
8faac0344b Fix checkerframework 2.8.2 warnings.
The updated version issues more warnings than before.
Most of the changes are related to annotation placement.

PiperOrigin-RevId: 255371743
2019-07-02 17:44:17 +01:00
olly
40d44c48e5 Add threading model note to hello-word page
Also add layer of indirection between code and the guide, to
make moving content easier going forward.

PiperOrigin-RevId: 255182216
2019-07-02 17:43:58 +01:00
tonihei
4e504bc485 Rename DeferredMediaPeriod to MaskingMediaPeriod.
This better reflects its usage and fits into our general naming pattern.

PiperOrigin-RevId: 255157159
2019-07-02 17:43:38 +01:00
olly
883b3c8783 Update isMediaCodecException to return true for generic ISE on API 21+ if the
stack trace contains MediaCodec.

PiperOrigin-RevId: 254781909
2019-07-02 17:43:19 +01:00
aquilescanta
0ddd3c2bd0 Implement DecryptableSampleQueueReader.isReady
PiperOrigin-RevId: 254746146
2019-07-02 17:43:00 +01:00
sr1990
ec6604b4f7 [Patch V4] Support signalling of last segment number via supplemental descriptor in mpd. 2019-06-26 20:29:37 -07:00
sr1990
5f6a7fc7f1 [Patch V3] Support signalling of last segment number via supplemental descriptor in mpd. 2019-06-22 18:56:06 -07:00
aquilescanta
88f1dfcbc1 Add generic DrmSessionManager.getDummyDrmSessionManager
PiperOrigin-RevId: 254372134
2019-06-21 18:23:39 +01:00
aquilescanta
04aaf25aa2 Add DecryptableSampleQueueReader
Reads from a SampleQueue, associating each read format with a
DrmSession, if needed.

PiperOrigin-RevId: 254192562
2019-06-21 18:23:20 +01:00
aquilescanta
acad64cae8 Rename FormatHolder.decryptionResourceIsProvided to FormatHolder.includesDrmSession
PiperOrigin-RevId: 254187403
2019-06-21 18:23:01 +01:00
Oliver Woodman
ae969397bb Merge pull request #6055 from xirac:dev-v2
PiperOrigin-RevId: 254182080
2019-06-21 18:22:42 +01:00
tonihei
1701a5f329 PUBLIC: Update ExoPlayer dependency and remove legacy method.
PiperOrigin-RevId: 254172906
2019-06-21 18:22:20 +01:00
aquilescanta
6838b0b29c Relax DrmSessionManager-in-Renderer requirement for MediaSource-provided DRM
PiperOrigin-RevId: 254048233
2019-06-21 18:21:41 +01:00
tonihei
ba5e2a4a77 Fix test build.
Builds now fail when raw generics are used.

PiperOrigin-RevId: 253969682
2019-06-19 16:37:54 +01:00
bachinger
aaf57c76cf allow multiple style rules in a STYLE block of a webvtt file
PiperOrigin-RevId: 253959976
2019-06-19 16:37:35 +01:00
bachinger
1952988f84 keep notification when stop(false) is called
ISSUE: #6041
PiperOrigin-RevId: 253958225
2019-06-19 16:37:15 +01:00
olly
b9859c4787 [Checker Framework Upgrade] Suppress warnings emitted by Checker Framework version 2.8.2
More information (LSC)
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    tap_presubmit: http://test/OCL:253818309:BASE:253788332:1560879553629:9dc07a48
    Some tests failed; test failures are believed to be unrelated to this CL
PiperOrigin-RevId: 253858263
2019-06-19 16:36:56 +01:00
tonihei
9ed7b42af6 Prevent negative renderer timestamps when seeking back.
We are currently queuing periods in a way such that the new start position
lines up with the end of the previous period (to ensure continuous playback).
However, if the start position of the new period is larger than the total of
all previously played period durations, we may end up with negative renderer
timestamps when seeking back to the beginning of this new period. Negative
timestamps should be avoided as most decoders have problems handling them
correctly.

This change forces a renderer reset if we detect such a seek to a negative
renderer time and also resets the renderer offset to 0 every time all
renderers are disabled, as this is the only time where we can savely change
the offset of an existing media period.

Also, if playback starts with an ad, we choose the content position as
renderer offset to prevent the whole issue from occurring for the seek-behind-
midroll case.

Issue:#6009
Issue:#5323
PiperOrigin-RevId: 253790054
2019-06-18 17:49:29 +01:00
olly
38000b8786 Let AudioTrack write headers on SDK_INT >= 26
Issue: #6031
PiperOrigin-RevId: 253784986
2019-06-18 17:49:10 +01:00
aquilescanta
5aeaa6e8bf Fix application of maxAudioBitrate for adaptive audio track groups
Issue:#6006
PiperOrigin-RevId: 253781533
2019-06-18 17:48:51 +01:00
tonihei
b89dc8fbfd Prevent negative total buffered duration at the point where it is calculated.
In some edge cases the renderer position may be slightly ahead of the
buffered position and the total buffered duration is thus negative. We already
filter that in ExoPlayerImpl for the publicly accessible value. However, we
forward the unfiltered value to other components like the LoadControl, which
may be confusing.

Issue:#6015
PiperOrigin-RevId: 253780460
2019-06-18 17:48:32 +01:00
aquilescanta
e174d8a989 Remove unused variable
PiperOrigin-RevId: 253762488
2019-06-18 17:48:14 +01:00
tonihei
0a74e36f7b Gracefully handle revoked ACCESS_NETWORK_STATE permission.
This permission has normal access right and can't be revoked by the user.
However, an app can choose to revoke it when using ExoPlayer, e.g. if
no network is required and the app doesn't want to list this permission.

Support this use case by gracefully catching the exception in the relevant
places.

Issue:#6019
PiperOrigin-RevId: 253759332
2019-06-18 17:47:56 +01:00
aquilescanta
af5eb5e552 Add DummyDrmSessionManager
Avoids nullable DrmSessionManagers and simplifies sample reading.
To be used as default value for MediaSources.

PiperOrigin-RevId: 253624465
2019-06-18 17:47:37 +01:00
aquilescanta
3204cf8ffa Make DrmSessionException extend IOException
Makes it throwable from SampleStream.maybeThrowError

PiperOrigin-RevId: 253600396
2019-06-18 17:47:19 +01:00
tonihei
1266d5967b Fix all FIXME comments.
These are mostly nullability issues.

PiperOrigin-RevId: 253537068
2019-06-18 17:45:59 +01:00
Yannick RUI
b29731d501 Parse text track subtype into Format.roleflags. 2019-06-18 11:27:37 +02:00
Toni
da1f3f01fa Merge pull request #6036 from angelrc96:dev-v2
PiperOrigin-RevId: 253228214
2019-06-14 16:50:13 +01:00
arodriguez
2ce28a1620 Support for UDP data source 2019-06-14 16:34:53 +01:00
aquilescanta
3fcae68432 Add flags to DrmSessionManager
PiperOrigin-RevId: 253006112
2019-06-14 16:34:53 +01:00
olly
cc337a3e2d Update nullness annotations.
PiperOrigin-RevId: 252127811
2019-06-14 16:33:47 +01:00
tonihei
3bff79f56f Wrap MediaCodec exceptions in DecoderException and report as renderer error.
We currently report MediaCodec exceptions as unexpected exceptions instead of
as renderer error. All such exceptions are now wrapped in a new DecoderException
to allow adding more details to the exception.

PiperOrigin-RevId: 252054486
2019-06-14 16:33:47 +01:00
olly
8a2871ed51 Allow protected access to surface in MediaCodecVideoRenderer
PiperOrigin-RevId: 251961318
2019-06-14 16:33:10 +01:00
olly
1fb105bbb2 Attach timestamp to ExoPlaybackException
PiperOrigin-RevId: 251748542
2019-06-14 16:32:51 +01:00