4334 Commits

Author SHA1 Message Date
olly
22a8aa311b Clean up requesting non-media segments in downloader implementations
- Enable GZIP for media playlist + encryption key chunk requests in
  HLS, as we do during playback
- Pass around DataSpecs rather than Uris. This will be needed for if
  we add manifest cacheKey support (which seems like a good idea for
  completeness, if nothing else)

PiperOrigin-RevId: 224057139
2018-12-05 17:48:45 +00:00
olly
f8b85739b1 Fix race condition that could cause downloader not to be canceled
PiperOrigin-RevId: 224048465
2018-12-05 17:48:39 +00:00
olly
5bbe3ae7d6 Cache data with unknown length by default
We currently default to not caching data if the content length
cannot be resolved once the DataSource has been open. The
reason for this is to avoid caching progressive live streams.
By doing this we were accidentally not caching in other places
where caching is possible, such as DASH/SS/HLS segments during
playback if the server doesn't include a Content-Length header.
Also HLS encryption key chunks, which were very unlikely to be
cached during playback because we explicitly set FLAG_ALLOW_GZIP
(which normally stops content length from resolving) without
setting FLAG_ALLOW_CACHING_UNKNOWN_LENGTH.

It seems like a good idea to flip the default at this point,
and explicitly disable caching in the one case where we want
that to happen.

PiperOrigin-RevId: 223994110
2018-12-05 17:48:34 +00:00
tonihei
976a21f139 Add no-op defaults to Video(Audio)RendererEventListener.
This is in line with how Player.EventListener and AnalyticsListener methods are
defined and helps to only implement the callbacks needed.

PiperOrigin-RevId: 223991262
2018-12-05 17:48:28 +00:00
tonihei
8a566fb330 Converge DownloadHelper implementations.
Moving most of the logic to the base DownloaderHelper helps to implement track
selection for downloading in a single place instead of multiple places.

PiperOrigin-RevId: 223964869
2018-12-05 17:48:18 +00:00
olly
8de149eb78 Use custom cache key factory for removal as well as downloading
Issue #5013

PiperOrigin-RevId: 223838303
2018-12-04 06:02:33 +00:00
olly
87a74ee021 Simplify DownloadManager.Task to use external state
PiperOrigin-RevId: 223797364
2018-12-04 06:02:28 +00:00
olly
f196630863 Remove contentId from Representation creators/constructor
PiperOrigin-RevId: 223796377
2018-12-04 06:02:23 +00:00
eguven
500b1faf14 Add Downloader.getTotalBytes() method
PiperOrigin-RevId: 223787832
2018-12-04 06:02:18 +00:00
tonihei
9f1e32f112 Add experimental flag to AdaptiveTrackSelection.Factory to block fixed track bandwidth
This option to block bandwidth already exists on the AdaptiveTrackSelection itself
but it's not currently possible to forward the total fixed track bandwidth
automatically.

PiperOrigin-RevId: 223785139
2018-12-04 06:02:13 +00:00
olly
24f2cbb215 updateQueuedPeriods(): If known duration changed for a media period, remove all media periods after
PiperOrigin-RevId: 223603915
2018-12-04 06:02:07 +00:00
GiuseppePiscopo
a11a8716ef feat(MediaSource): provide getTag default implementation 2018-12-03 18:24:38 +01:00
GiuseppePiscopo
b278b02816 chore(MediaSource): move getTag after removeEventListener 2018-12-03 18:21:37 +01:00
GiuseppePiscopo
8a359bb1fb feat(MediaSource): client code can get the tag of a MediaSource 2018-12-03 15:17:36 +01:00
olly
ffbb0da893 Prevent Cea608Decoder from generating Subtitles with null Cues list.
PiperOrigin-RevId: 223580953
2018-12-01 00:08:21 +00:00
olly
d98ab35a61 Add several devices to setOutputSurface workaround:
- Asus ZenFone GO (ASUS_X00AD_2)
- Sugar S9 (i9031)
- Redmi Note 3 (kate)

These devices trigger native crashes similar to
https://github.com/google/ExoPlayer/issues/4460

I'm not sure why Asus Zenfone Go (model: ZB500KL, device: ASUS_X00AD_2) was removed here
73af056da3

PiperOrigin-RevId: 223580393
2018-12-01 00:08:16 +00:00
olly
d650f8e0e3 Remove ability to inject content-id via DashManifestParser
It doesn't make sense for multi-period manifest

PiperOrigin-RevId: 223537958
2018-12-01 00:08:10 +00:00
olly
a1b8e17ed1 Remove Representation.contentId. It doesn't really make sense.
PiperOrigin-RevId: 223535353
2018-12-01 00:08:05 +00:00
tonihei
8ffef3d632 Add clarification to TextOutput doc.
The list may be empty if no cues are available.

PiperOrigin-RevId: 223527105
2018-12-01 00:07:59 +00:00
olly
88af944891 Move CachedContentIndex and SimpleCacheSpan tests to robolectric
PiperOrigin-RevId: 223518390
2018-12-01 00:07:48 +00:00
olly
beae7c9df5 Don't resolve UtcTiming element for static manifests
It doesn't do anything useful in this case.

PiperOrigin-RevId: 223516909
2018-11-30 16:13:52 +00:00
tonihei
ea483f8c8e Fix some potential Uri nullness violations.
PiperOrigin-RevId: 223476569
2018-11-30 16:13:42 +00:00
andrewlewis
282cf303a4 Fix clearkey DRM UUID passed to MediaCrypto
PiperOrigin-RevId: 223324279
2018-11-29 12:35:30 +00:00
andrewlewis
699fee9727 Replace remaining stbl assertions with warnings
Issue: #5162
PiperOrigin-RevId: 223193019
2018-11-29 12:35:12 +00:00
olly
f45943b4fb Bump for 2.9.2
PiperOrigin-RevId: 223141203
2018-11-28 11:44:41 +00:00
andrewlewis
510749fa15 Handle metadata failing to decode in MetadataRenderer
Issue: #5149
PiperOrigin-RevId: 223121651
2018-11-28 09:32:17 +00:00
olly
05a79a417a Fall back to TYPE_ROTATION_VECTOR if TYPE_GAME_ROTATION_VECTOR unavailable
Issue: #5119
PiperOrigin-RevId: 222978448
2018-11-27 15:46:10 +00:00
olly
1ce33362c9 Strip private ID3 data from HLS sample formats
Issue: #5063
PiperOrigin-RevId: 222975020
2018-11-27 15:45:58 +00:00
olly
6819192690 Clean up CacheDataSourceTest
PiperOrigin-RevId: 222965111
2018-11-27 15:45:51 +00:00
olly
aacb212c17 Remove duplicate CacheAsserts class
PiperOrigin-RevId: 222963935
2018-11-27 15:45:45 +00:00
olly
e317305909 Remove custom data from remove actions
A remove action will eventually just be the unique ID of the download
that should be removed. This is a step toward that goal.

PiperOrigin-RevId: 222832456
2018-11-27 15:45:38 +00:00
Zsolt Matyas
d1e49f2074 CEA608: PAINT-ON Mode must keep the last shown captions on the screen
[Problem]
PAINT-ON mode is not implemented. From the compliance tests:
* RDC command has no effect except to select paint-on style.
* Next data are written directly to the display upon receipt.
* If other captioning is already on the screen, the four-row
limit is still in effect.

[Solution]
It is a rare use case, we do not support overriding characters in
existing cueBuilders as PAINT-ON would require. But several
compliance tests check if the screen is cleared when the mode
switch happens. We must keep the old captions when switching
to PAINT-ON mode

[Test]
- Live Over-the-Air content, beginning of commercials often uses
PAINT-ON mode
2018-11-26 11:39:02 -08:00
olly
f4d9deddaf Remove spurious VisibleForTesting annotation
It needs to have package visiblity, otherwise nothing can use it.

PiperOrigin-RevId: 222821546
2018-11-26 16:40:40 +00:00
olly
a31a3f3c73 Simplify DownloadActionTest legacy tests using assets
PiperOrigin-RevId: 222819933
2018-11-26 16:40:34 +00:00
olly
3e150b54f4 Assume text tracks in protected SmoothStreaming are not protected
Issue: #4838
PiperOrigin-RevId: 222805051
2018-11-26 16:40:21 +00:00
olly
d6b6600a28 Fix unnecessary media playlist requests when playing live streams
Issue: #5059
PiperOrigin-RevId: 222803511
2018-11-26 16:40:14 +00:00
olly
40c65dbcea Move deserialization code to a more natural location
- Add DownloadAction.fromByteArray for symmetry with toByteArray
- Make DownloadService call fromByteArray, for symmetry with calls
  to toByteArray

PiperOrigin-RevId: 222801703
2018-11-26 16:40:08 +00:00
Oliver Woodman
5284ad2e41 Merge pull request #5144 from google:dev-v2-vttfix
PiperOrigin-RevId: 222798467
2018-11-26 11:06:10 +00:00
olly
17eadcc433 Fix Cea608 caption valid
PiperOrigin-RevId: 222797622
2018-11-26 11:05:55 +00:00
Oliver Woodman
166acad93d Noop fix to WebvttDecoder
We already have tests for comment blocks, and they already
pass because we discard the comment when we fail to parse it
as a cue. We should just skip it directly, however.
2018-11-26 10:50:49 +00:00
olly
799bf16764 Pull reading of data bytes back above if(...){continue} clauses
PiperOrigin-RevId: 222633838
2018-11-23 17:59:27 +00:00
Oliver Woodman
e2e1c459c8 Merge #5140: Cea608 - Check parity and valid bits
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5140

https://github.com/google/ExoPlayer/pull/5086 moved onto the right branch.
Merge 8822e188d24c1d9b3ed101918763b16e46c8debc into 0c385a854d1c54f794789b390a5793a43a0eb147

PiperOrigin-RevId: 222633340
2018-11-23 17:47:40 +00:00
olly
1216068255 Add Lint.IfChange/ThenChange for repeat modes
PiperOrigin-RevId: 222630411
2018-11-23 17:40:54 +00:00
olly
ea8696d820 Ensure changes are reflected into attrs
PiperOrigin-RevId: 222628386
2018-11-23 17:40:42 +00:00
BrainCrumbz
d3095cccfe Merge #5126: fix(playlist): always call onCompletion when moving media sources
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5126

Closes #5125
Merge 55a4c1e15de7f100f37e38119f1da360910fd1e3 into fe41f17c387b7c18a818c8cf2a1ebcdfbd36836a

PiperOrigin-RevId: 222612873
2018-11-23 12:37:57 +00:00
aquilescanta
fe41f17c38 Move listener invocation classes to BasePlayer
PiperOrigin-RevId: 222609579
2018-11-23 12:31:35 +00:00
tonihei
1a9705e247 Fix show_buffering attribute values.
The corresponding IntDef has changed without updating the attribute values.

Issue:#5139
PiperOrigin-RevId: 222598044
2018-11-23 12:31:24 +00:00
tonihei
f8a3c135e5 Use overflow-save add operation for blacklisting duration.
This allows to specify open-ended blacklisting with Long.MAX_VALUE.

PiperOrigin-RevId: 222550939
2018-11-23 12:31:12 +00:00
Oliver Woodman
56e4860cb0 Remove stray proguard files 2018-11-23 12:28:23 +00:00
olly
dd2cba04dd Offline refactor step 1b - Consolidate tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222529260
2018-11-22 13:40:38 +00:00