747 Commits

Author SHA1 Message Date
bachinger
877923ce5f fix typo in release notes
PiperOrigin-RevId: 257185017
2019-07-09 16:15:55 +01:00
olly
65d9c11027 Bump version to 2.10.3
PiperOrigin-RevId: 257161518
2019-07-09 11:54:39 +01:00
tonihei
e3af045adb CEA608: Fix repeated Special North American chars.
We currently handle most the control code logic after handling special
characters. This includes filtering out repeated control codes and checking
for the correct channel. As the special character sets are control codes as well,
these checks should happen before parsing the characters.

Issue:#6133
PiperOrigin-RevId: 256993672
2019-07-08 19:42:09 +01:00
tonihei
81e7b31be1 Apply playback parameters in a consistent way.
Currently, we sometimes apply new playback parameters directly and sometimes
through the list of playbackParameterCheckpoints. Only when using the checkpoints,
we also reset the offset and corresponding position for speedup position
calculation. However, these offsets need to be changed in all cases to prevent
calculation errors during speedup calculation[1].

This change channels all playback parameters changes through the checkpoints to
ensure the offsets get updated accordingly. This fixes an issue introduced in
31911ca54a.

[1] - The speed up is calculated using the ratio of input and output bytes in
SonicAudioProcessor.scaleDurationForSpeedUp. Whenever we set new playback
parameters to the audio processor these two counts are reset. If we don't reset
the offsets too, the scaled timestamp can be a large value compared to the input
and output bytes causing massive inaccuracies (like the +20 seconds in the
linked issue).

Issue:#6117
PiperOrigin-RevId: 256533780
2019-07-05 17:32:21 +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
andrewlewis
9905432546 Fix ad pod index offset calculation without preroll
Issue: #5928
PiperOrigin-RevId: 254379085
2019-06-21 18:23:57 +01:00
Oliver Woodman
ae969397bb Merge pull request #6055 from xirac:dev-v2
PiperOrigin-RevId: 254182080
2019-06-21 18:22:42 +01:00
olly
0b7227ece5 Release notes language tweaks
PiperOrigin-RevId: 254156143
2019-06-21 18:22:00 +01:00
olly
9308ff26bc Update release notes for 2.10.2 cherrypicks
PiperOrigin-RevId: 253808562
2019-06-18 17:55:03 +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
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
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
Toni
da1f3f01fa Merge pull request #6036 from angelrc96:dev-v2
PiperOrigin-RevId: 253228214
2019-06-14 16:50:13 +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
aquilescanta
8bd2b5b3d7 Fix detection of current window index in CastPlayer
Issue:#5955
PiperOrigin-RevId: 251616118
2019-06-06 17:35:25 +01:00
eguven
e4feaa68f2 Add VR player demo
PiperOrigin-RevId: 251460113
2019-06-06 17:35:06 +01:00
tonihei
be88499615 Display last frame when seeking to end of stream.
We currently don't display the last frame because the seek time is behind the
last frame's timestamps and it's thus marked as decodeOnly.

This case can be detected by checking whether all data sent to the codec is
marked as decodeOnly at the time we read the end of stream signal. If so, we
can re-enable the last frame. This should work for almost all cases because the
end-of-stream signal is read in the same feedInputBuffer loop as the last
frame and we therefore haven't released the last frame buffer yet.

Issue:#2568
PiperOrigin-RevId: 251425870
2019-06-06 17:34:47 +01:00
olly
871a88a921 Clean up release notes
PiperOrigin-RevId: 251269746
2019-06-03 19:16:42 +01:00
olly
a9de1477ee Bump to 2.10.2
PiperOrigin-RevId: 251216822
2019-06-03 19:15:42 +01:00
tonihei
090f359895 Make parallel adaptive track selection more robust.
Using parallel adaptation for Formats without bitrate information currently
causes an exception. Handle this gracefully and also cases where all formats
have the same bitrate.

Issue:#5971
PiperOrigin-RevId: 250682127
2019-05-30 15:28:23 +01:00
eguven
f9d6f314e2 Fix misreporting cached bytes when caching is paused
When caching is resumed, it starts from the initial position. This makes
more data to be reported as cached.

Issue:#5573
PiperOrigin-RevId: 250678841
2019-05-30 15:28:23 +01:00
tonihei
fd1179aaa1 Add remaining PlaybackStatsListener metrics.
This adds all the non-playback-state metrics, like format, error, bandwidth and
renderer performance metrics.

PiperOrigin-RevId: 250668854
2019-05-30 15:28:23 +01:00
olly
6e7012413b Keep controller visible on d-pad key events
PiperOrigin-RevId: 250661977
2019-05-30 15:26:32 +01:00
eguven
42ba6abf5a Fix CacheUtil.cache() use too much data
cache() opens all connections with unset length to avoid position errors.
This makes more data then needed to be downloading by the underlying
network stack.

This fix makes makes it open connections for only required length.

Issue:#5927
PiperOrigin-RevId: 250546175
2019-05-30 15:26:32 +01:00
aquilescanta
71418f9411 Fix TTML bitmap subtitles
+ Use start for anchoring, instead of center.
+ Add the height to the TTML bitmap cue rendering layout.

Issue:#5633
PiperOrigin-RevId: 250519710
2019-05-30 15:26:32 +01:00
andrewlewis
90325c699e Allow enabling decoder fallback in DefaultRenderersFactory
Also allow enabling decoder fallback with MediaCodecAudioRenderer.

Issue: #5942
PiperOrigin-RevId: 250301422
2019-05-30 15:25:28 +01:00
aquilescanta
3314391932 Add basic DRM support to CastPlayer's demo app
PiperOrigin-RevId: 249624829
2019-05-30 15:09:52 +01:00
tonihei
cfefdbc134 Release DownloadHelper automatically if preparation failed.
This prevents further unexpected updates if the MediaSource happens to
finish its preparation at a later point.

Issue:#5915
PiperOrigin-RevId: 249439246
2019-05-23 13:29:49 +01:00
olly
37fc1d879d Propagate attributes to DefaultTimeBar
Issue: #5765
PiperOrigin-RevId: 249251150
2019-05-23 13:26:50 +01:00
tonihei
9aeaf2dbb0 Add ResolvingDataSource for just-in-time resolution of DataSpecs.
Issue:#5779
PiperOrigin-RevId: 249234058
2019-05-21 13:53:14 +01:00
bachinger
a458635540 Add ProgressUpdateListener
Issue: #5834
PiperOrigin-RevId: 249067445
2019-05-21 13:52:14 +01:00
andrewlewis
bfeec25b2a Add SilenceMediaSource
Issue: #5735
PiperOrigin-RevId: 248745617
2019-05-20 15:13:36 +01:00
bachinger
128ded5ba0 add playWhenReady to prepareXyz methods of PlaybackPreparer.
Issue: #5891
PiperOrigin-RevId: 248541827
2019-05-20 15:13:17 +01:00
Oliver Woodman
92532d3ac5 Merge pull request #5617 from loki666:workmanager
PiperOrigin-RevId: 248533906
2019-05-20 15:12:57 +01:00
olly
b5a512b673 Bump release to 2.10.1 and update release notes
PiperOrigin-RevId: 248503235
2019-05-16 13:40:23 +01:00
olly
9d450e52f2 Allow empty values in ICY metadata
Issue: #5876
PiperOrigin-RevId: 248119726
2019-05-15 18:13:49 +01:00
bachinger
14915fd148 Fix rendering DVB subtitle on API 28.
Issue: #5862
PiperOrigin-RevId: 248112524
2019-05-15 18:13:31 +01:00
aquilescanta
50c9ae0efc Assume that encrypted content requires secure decoders in renderer support checks
Issue:#5568
PiperOrigin-RevId: 247973411
2019-05-15 18:13:12 +01:00
olly
0612d9f6d5 Allow line terminators in ICY metadata
Issue: #5876
PiperOrigin-RevId: 247935822
2019-05-15 18:12:35 +01:00
andrewlewis
a849f43e6d Work around broken raw audio decoder on Oppo R9
Issue: #5782
PiperOrigin-RevId: 247934223
2019-05-15 18:12:16 +01:00
tonihei
23fa53bf0b Add setCodecOperatingRate workaround for 48KHz audio on ZTE Axon7 mini.
Issue:#5821
PiperOrigin-RevId: 247621164
2019-05-15 18:10:26 +01:00
tonihei
34dd4b1441 Fix NPE in HLS deriveAudioFormat.
Issue:#5868
PiperOrigin-RevId: 247613811
2019-05-15 18:10:07 +01:00
tonihei
b3ae1d3fed Add option to clear all downloads.
Adding an explicit option to clear all downloads prevents repeated database
access in a loop when trying to delete all downloads.

However, we still create an arbitrary number of parallel Task threads for this
and seperate callbacks for each download.

PiperOrigin-RevId: 247234181
2019-05-15 18:08:08 +01:00
Oliver Woodman
faecef0bef Merge pull request #5807 from zsmatyas:dev-v2
PiperOrigin-RevId: 246132620
2019-05-02 13:04:34 +01:00
aquilescanta
f64011ae04 Prevent index out of bounds exceptions in some live HLS scenarios
Can happen if the load position falls behind in every playlist and
when we try to load the next segment, the adaptive selection logic
decides to change variant.

Issue:#5816
PiperOrigin-RevId: 245923006
2019-04-30 22:07:28 +01:00
olly
880f403181 Fix line break
PiperOrigin-RevId: 245448908
2019-04-30 22:05:51 +01:00
eguven
3e519824ff Downloading documentation
PiperOrigin-RevId: 245443109
2019-04-26 18:35:34 +01:00
andrewlewis
1bc279795b Log warnings when extension libraries can't be used
Issue: #5788
PiperOrigin-RevId: 245440858
2019-04-26 18:35:15 +01:00
olly
61f28f8107 Link blog post from release notes
PiperOrigin-RevId: 245411528
2019-04-26 18:34:55 +01:00
tonihei
21b2a471bb Toggle playback controls according to standard Android click handling.
We currently toggle the view in onTouchEvent ACTION_DOWN which is non-standard
and causes problems when used in a ViewGroup intercepting touch events.

Switch to standard Android click handling instead which is also what most
other player apps are doing.

Issue:#5784
PiperOrigin-RevId: 245219728
2019-04-26 18:32:42 +01:00