2065 Commits

Author SHA1 Message Date
arodriguez
28ee05f657 Support for UDP data source 2019-06-14 08:24:31 +02:00
olly
624bb6b8d1 Attach timestamp to ExoPlaybackException
PiperOrigin-RevId: 251748542
2019-06-06 17:36:22 +01:00
olly
cfa837df5c Don't throw DecoderQueryException from getCodecMaxSize
It's only thrown in an edge case on API level 20 and below. If it
is thrown it causes playback failure when playback could succeed,
by throwing up through configureCodec.

It seems better just to catch the exception and have the codec be
configured using the format's own width and height.

PiperOrigin-RevId: 251745539
2019-06-06 17:36:03 +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
9ca6f60c3a Preserve postBody in CacheDataSource when reading from upstream.
Set appropriate Content-Type when posting clientAbrState proto in post body.

PiperOrigin-RevId: 251322860
2019-06-06 17:34:08 +01:00
olly
a9de1477ee Bump to 2.10.2
PiperOrigin-RevId: 251216822
2019-06-03 19:15:42 +01:00
aquilescanta
7e187283cd Add MediaSource-provided-DRM support to Renderer implementations
PiperOrigin-RevId: 250719155
2019-06-03 19:15:04 +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
tonihei
77595da159 Add initial PlaybackStats listener version.
This version includes all playback state related metrics and the general
listener set-up.

PiperOrigin-RevId: 250668729
2019-05-30 15:28:23 +01:00
tonihei
b8ec05aea1 Handle gzip in DefaultHttpDataSource.
Setting the requested encoding in all cases ensures we receive the relevant
response headers indicating whether gzip was used. Doing that allows to
detect the content length in cases where gzip was requested, but the server
replied with uncompressed content.

PiperOrigin-RevId: 250660890
2019-05-30 15:26:32 +01:00
eguven
e2452f8103 Simplify CacheUtil
PiperOrigin-RevId: 250654697
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
olly
ed5ce2396d SimpleCache: Tweak comments related to blocking
"Write case, lock not available" was a bit confusing. When the
content is not cached and the lock is held, it's neither a read
or a write case. It's a "can't do anything" case. When blocking,
it may subsequently turn into either a read or a write.

PiperOrigin-RevId: 250530722
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
olly
1151848f59 No-op move of span touching into helper method
PiperOrigin-RevId: 250519114
2019-05-30 15:26:32 +01:00
andrewlewis
09b00c7fb0 Allow passthrough of E-AC3-JOC streams
PiperOrigin-RevId: 250517338
2019-05-30 15:26:32 +01:00
olly
94d668567c Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2. However, there is a
functional difference: ArgumentMatchers will reject `null` and check the type
if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will
remain to accept anything.

PiperOrigin-RevId: 250458607
2019-05-30 15:25:28 +01:00
aquilescanta
8912db5ed9 Remove DecryptionResource
Reference count was built into DrmSession

PiperOrigin-RevId: 250449988
2019-05-30 15:25:28 +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
04f3888550 Add allowOnlyClearBuffers to SampleQueue#read
Removes the need for duplicate calls to SampleQueue#read when
implementing DecryptionResources acquisition in the MediaSources.

PiperOrigin-RevId: 250298175
2019-05-30 15:25:28 +01:00
aquilescanta
47cc567dca Add reference counting to DrmSession
This CL should not introduce any functional changes.

PiperOrigin-RevId: 250277165
2019-05-30 15:25:28 +01:00
olly
3afdd7ac5a Put @Nullable annotation in the right place
PiperOrigin-RevId: 249828748
2019-05-30 15:10:55 +01:00
tonihei
3e990a3d24 Fix nullness warning for MediaSource/MediaPeriod classes.
PiperOrigin-RevId: 249652301
2019-05-30 15:10:24 +01:00
olly
14c46bc406 Remove contentTypePredicate from DataSource constructors
The only known use case for contentTypePredicate is to catch
the case when a paywall web page is returned via a DataSource,
rather than the data that was being requested. These days streaming
providers should be using HTTPS, where this problem does not exist.
Devices have also gotten a lot better at showing their own
notifications when paywalls are detected, which largely mitigates
the need for the app to show a more optimal error message or
redirect the user to a browser.

It therefore makes sense to deprioritize this feature. In
particular by removing the arg from constructors, where nearly
all applications are probably passing null.

PiperOrigin-RevId: 249634594
2019-05-30 15:10:08 +01:00
aquilescanta
8d329fb41f Move DefaultDrmSession resource acquisition to acquire
PiperOrigin-RevId: 249624318
2019-05-23 13:30:38 +01:00
olly
2f12374f1a Fix IndexOutOfBounds when there are no available codecs
PiperOrigin-RevId: 249610014
2019-05-23 13:30:24 +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
118218cc73 Remove cronet extension nullness blacklist
PiperOrigin-RevId: 249432337
2019-05-23 13:29:35 +01:00
olly
f74d2294be Remove media-session extension nullness blacklist
PiperOrigin-RevId: 249431620
2019-05-23 13:29:19 +01:00
olly
10ee7d8e86 Remove more classes from nullness blacklist
PiperOrigin-RevId: 249431027
2019-05-23 13:29:05 +01:00
olly
d836957138 Remove some DataSource implementations from nullness blacklist
PiperOrigin-RevId: 249419193
2019-05-23 13:28:50 +01:00
olly
21be284318 Replace runtime lookups of string integer codes
Make these values compile-time constants, which can be inlined.

PiperOrigin-RevId: 249327464
2019-05-23 13:28:06 +01:00
olly
3efe320535 Remove deprecated DataSource constructors
PiperOrigin-RevId: 249276112
2019-05-23 13:27:36 +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
andrewlewis
468296c2bc Suppress remaining ConstantCaseForConstant warnings
PiperOrigin-RevId: 249217126
2019-05-21 13:52:59 +01:00
tonihei
07c4569b5f Limit tests with specific SDK level to max=TARGET_SDK.
The unspecified default is the highest available SDK which may be larger
than TARGET_SDK (as specified by the manifest).

PiperOrigin-RevId: 249064173
2019-05-21 13:51:59 +01:00
tonihei
33c677846a Use versioned manifest in all Robolectric tests.
We are currently defaulting to targetSdk=1 as no targetSdk is specified. Only
tests which explicitly ask for another SDK use another test SDK. With the
versioned manifest, all tests run using the targetSDK by default.

PiperOrigin-RevId: 249060796
2019-05-21 13:51:43 +01:00
Oliver Woodman
e39996e95f Merge pull request #5907 from adamjrichter:dev-v2
PiperOrigin-RevId: 249044271
2019-05-20 15:40:01 +01:00
andrewlewis
bfeec25b2a Add SilenceMediaSource
Issue: #5735
PiperOrigin-RevId: 248745617
2019-05-20 15:13:36 +01:00
andrewlewis
835d1f3afe Fix platform scheduler javadoc
PiperOrigin-RevId: 248503971
2019-05-16 13:40:42 +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
Adam Richter
7f79db0724 Split a few assertThat(a && b).isTrue() calls into separate assertions for more precise diagnostics. 2019-05-15 13:44:26 -07:00
eguven
4ca670bed3 Use MediaSourceFactory interface to simplify DownloadHelper
PiperOrigin-RevId: 248367983
2019-05-15 20:13:59 +01:00
olly
8edce41ff3 Add simpler HttpDataSource constructors
PiperOrigin-RevId: 248350557
2019-05-15 18:14:25 +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