2585 Commits

Author SHA1 Message Date
olly
701b013cdd Rollback of 9f0fd870e7
*** Original commit ***

Port Exo v1 work around for frame synchronization issue in KitKat to Exo v2.

***

PiperOrigin-RevId: 275372272
2019-10-18 17:42:27 +01:00
bachinger
0c0a67bb93 Fail at preparation when trying to download live content.
PiperOrigin-RevId: 275293735
2019-10-18 17:42:11 +01:00
bachinger
36f8bd78f7 Rollback of 4ad4e3e4fc
*** Original commit ***

Rollback of 3b22db33ba

*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161

***

***

PiperOrigin-RevId: 275276158
2019-10-18 17:42:03 +01:00
olly
d874656e8a Round impossible H264 resolutions up to valid values for capabilities check
If an odd resolution is impossible in the specification itself, then we know
that the caller is passing invalid data. Round up on the assumption it's a
rounding error so that playback can proceed.

Issue: #6551
PiperOrigin-RevId: 275226813
2019-10-17 11:52:50 +01:00
Oliver Woodman
23f545a0a4 Merge pull request #6528 from julioz:log-param
PiperOrigin-RevId: 275014741
2019-10-16 14:02:21 +01:00
samrobinson
841b3a8bc7 Add AUDIO_BECOMING_NOISY handling to SimpleExoPlayer.
Feature enabled through the SimpleExoPlayer.setHandleAudioBecomingNoisy.

PiperOrigin-RevId: 274988924
2019-10-16 14:02:11 +01:00
tonihei
03e3ceaedb Align PlaybackSuppressionReason java doc with method doc.
Same change as done in c49388aca2.

PiperOrigin-RevId: 274894288
2019-10-15 23:08:45 +01:00
ibaker
fc95d07a94 Remove HlsChunkSource from null-checking blacklist
PiperOrigin-RevId: 274789337
2019-10-15 23:08:00 +01:00
kimvde
a10fea30c9 Enable setOutputSurfaceWorkaround for some devices
The corresponding devices are Wiko FEVER l5460 and Huawei Honor 8X.

Issue:#6503
PiperOrigin-RevId: 274753710
2019-10-15 23:07:30 +01:00
olly
d36abf966e Fix broken Javadoc
PiperOrigin-RevId: 274564800
2019-10-14 14:18:49 +01:00
olly
c49388aca2 Clean up playback suppression
PiperOrigin-RevId: 274561876
2019-10-14 13:58:11 +01:00
ibaker
eb677eb4b9 Add a Util.nullSafeArrayAppend and use it in HlsSampleStreamWrapper
I could do this with nullSafeArrayConcat but this saves allocating a throw-away
single-element array.

PiperOrigin-RevId: 274545815
2019-10-14 13:58:04 +01:00
ibaker
498a23e328 Add null-checker annotations to HlsSampleStreamWrapper
PiperOrigin-RevId: 274545728
2019-10-14 13:57:56 +01:00
olly
b71b9f7c58 Bump version to 2.10.6
PiperOrigin-RevId: 274534626
2019-10-14 13:57:41 +01:00
andrewlewis
d52f06e611 Clean up surface on setting renderer
If a surface was previously passed to the player then an output buffer
renderer was set, we would remove surface callbacks but not clear the
surface on renderers that accept MSG_SET_SURFACE.

PiperOrigin-RevId: 274532266
2019-10-14 13:57:33 +01:00
olly
ce01c79e01 Add a javadoc explanation for ProgressiveDownloader that explains that it tries to skip downloading already cached bytes.
download calls through to CacheUtil#cache, which handles skipping already downloaded bytes.

It is useful for callers to know that ProgressiveDownloader has this behavior - otherwise, they might reimplement the logic themselves.

I hope this behavior is something that can be part of the public API :)

PiperOrigin-RevId: 274202995
2019-10-13 12:41:55 +01:00
andrewlewis
1c66010b4a Add MediaFormat on video frame metadata listener
This is useful for apps that want to access HDR metadata that MediaCodec puts
in its output format.

PiperOrigin-RevId: 274169985
2019-10-13 12:41:47 +01:00
olly
4ae79105de Make FileDataSourceFactory an inner class
This is a proof of concept for cleanup we should do for all of
our DataSource implementations as we move toward stabilizing
parts of the API.

- Move all XDataSourceFactory classes to be inner classes.
- Remove chained constructors for XDataSourceFactory classes. Keep
  required args going through constructors. Use setters for the
  rest.
- Not applicable in this case, but we probably want to deprecate
  all but the no-arg method for instantiating eac XDataSource
  instance (with the all-arg method kept but with the intention
  of making it package private).

PiperOrigin-RevId: 274162076
2019-10-13 12:41:39 +01:00
olly
a268e1b63f Test audio focus denial
- Verifies that playWhenReady doesn't become true if audio focus
  is denied.
- Also verifies there's no suppression reason in this case, because
  the denial is permanent rather than temporary.

PiperOrigin-RevId: 274141099
2019-10-13 12:41:00 +01:00
olly
46c6f260f5 Add test action for setting audio attributes
Also removed "to be executed" from all the comments, since it
didn't seem to add value.

PiperOrigin-RevId: 274139837
2019-10-13 12:40:52 +01:00
olly
3f7c3bb085 Don't set a playback suppression reason for permanent audio focus loss
It's documented to be for temporary loss only (i.e. the case where
externally reported playWhenReady is still true)

PiperOrigin-RevId: 274129922
2019-10-13 12:40:44 +01:00
Julio Zynger
706668fde3 Name logged fields in EventLogger 2019-10-10 19:49:09 +02:00
sofijajvc
62618f24ec Remove copybara exclusions and add extension to the demo app
Issue: #3353
PiperOrigin-RevId: 273949689
2019-10-10 14:46:16 +01:00
sofijajvc
5cf82a5079 Support GL rendering with SimpleExoPlayer and PlayerView
PiperOrigin-RevId: 273760294
2019-10-10 14:45:14 +01:00
olly
3d0886f458 Fix bogus reporting of audio focus loss
Playback cannot be suppressed if playWhenReady=false

PiperOrigin-RevId: 273726084
2019-10-10 14:44:39 +01:00
andrewlewis
fab2a0d55e Fix VideoDecoderOutputBuffer supplemental data
The limit of this.supplementalData was not reset.

PiperOrigin-RevId: 273515718
2019-10-08 20:55:15 +01:00
olly
b052ea9bed Parse Label elements for adaptation sets
Issue: #6297
PiperOrigin-RevId: 273297284
2019-10-07 16:32:50 +01:00
samrobinson
a8adb97b5d Move AudioFocusManager to different package & made default visibility.
PiperOrigin-RevId: 273263822
2019-10-07 16:32:03 +01:00
sofijajvc
fa06f0b4cc Fix video decoder GL rendering
Calculate stride and width ratio per each plane.

PiperOrigin-RevId: 272916423
2019-10-07 16:31:47 +01:00
sofijajvc
8f3a363dd2 Add OpenGL support to av1 extension: Libgav1VideoRenderer
Move reusable code from LibvpxVideoRenderer to SimpleDecoderVideoRenderer.
Pass outputBuffer to renderOutputBuffer method instead of keeping the reference in the renderer.

PiperOrigin-RevId: 272899549
2019-10-07 16:31:39 +01:00
samrobinson
27b90fba0e Make WakeLockManager package private.
PiperOrigin-RevId: 272888174
2019-10-07 16:31:31 +01:00
tonihei
4297800f38 Update logic to set isLoading.
We currently set it to shouldContinueLoading, which isn't correct if
shouldContinueLoading is set to false and we still have an ongoing load.

Change it to also be true if the media period is still loading.

PiperOrigin-RevId: 272823473
2019-10-04 13:32:34 +01:00
aquilescanta
69cf7d130e Fix acquisition of placeholder sessions
Issue:#4867
PiperOrigin-RevId: 272698404
2019-10-04 13:32:27 +01:00
andrewlewis
3d5ab29da7 Add @RequiresApi(18) for FrameworkMediaDrm
Without this Android Studio shows a warning for newInstance.

PiperOrigin-RevId: 272660373
2019-10-04 13:32:12 +01:00
aquilescanta
433526e034 Deprecate DefaultDrmSessionManager factory methods and migrate main demo app
PiperOrigin-RevId: 272643202
2019-10-04 13:31:56 +01:00
sofijajvc
737b5cd82d Fix GL error logging
Log only if an error occured.

PiperOrigin-RevId: 272618322
2019-10-04 13:31:48 +01:00
olly
3c235dfc1f Make factories return specific types
PiperOrigin-RevId: 272614917
2019-10-04 13:31:40 +01:00
olly
fbb4715646 Minor upstream cleanup
PiperOrigin-RevId: 272614610
2019-10-04 13:31:25 +01:00
tonihei
4f640bc62e Add SequencableLoader.isLoading
This method allows the player to figure out whether we still have an ongoing
load even if LoadControl.shouldContinueLoading returns false.

PiperOrigin-RevId: 272445577
2019-10-02 21:30:07 +01:00
tonihei
bc9a0860e0 Clear renderedFirstFrame at stream changes even if no reconfiguration is needed
This ensures a more consistent playback behavior no matter if an item is the
first playlist item or a later one. For example, each playlist item gets its
own onRenderedFirstFrame callback and other logic within the renderer that
force renders the first frame more quickly is also triggered.

PiperOrigin-RevId: 272434814
2019-10-02 21:29:52 +01:00
ibaker
f7b8d07cd2 Add specific error message if file-not-found for path with fragment or query
This doesn't change the current behaviour, just adds a clear error message
to the developer with instructions on how to avoid it.

Issue:#6470
PiperOrigin-RevId: 272405556
2019-10-02 21:29:45 +01:00
ibaker
6780b802e0 Pass the raw ICY metadata through IcyInfo
The ICY 'spec' isn't really clear/tight enough to do anything more
specific than this I think.

Issue:#6476
PiperOrigin-RevId: 272405322
2019-10-02 21:29:37 +01:00
ibaker
db68aa9490 Rollback of 01f484cbe9
*** Original commit ***

Modify EventMessageDecoder to return null if decoding fails (currently throws exceptions)

This matches the documentation on MetadataDecoder.decode:
"@return The decoded metadata object, or null if the metadata could not be decoded."

***

PiperOrigin-RevId: 272405287
2019-10-02 21:29:30 +01:00
samrobinson
f5873b8f00 WakeLock handling
Created the WakeLockManager for use in SimpleExoPlayer.
Added a setter in SimpleExoPlayer to adjust this functionality.

Issue:#5846
PiperOrigin-RevId: 272176998
2019-10-02 21:29:21 +01:00
aquilescanta
af9ce21e2f Log failures when instantiating Framework MediaDrms
PiperOrigin-RevId: 272166041
2019-10-02 21:29:06 +01:00
tonihei
7d8bee799b Add convenience Player.isCurrentWindowLive method.
PiperOrigin-RevId: 272005632
2019-10-02 21:28:51 +01:00
tonihei
dd4f9bcaae Add Timeline.Window.isLive
This flag is currently merged into Window.isDynamic, which isn't always true
because
1. A window can be dynamic for other reasons (e.g. when the duration is still
missing).
2. A live stream can be become non-dynamic when it ends.

Issue:#2668
Issue:#5973
PiperOrigin-RevId: 271999378
2019-10-02 21:28:43 +01:00
tonihei
26dd4aad68 Add missing methods to EventLogger.
PiperOrigin-RevId: 271998087
2019-10-02 21:28:36 +01:00
tonihei
6a2d04e3ce Reflect playback suppression in PlaybackStats states.
Also split existing SUSPENDED state into ABANDONED and INTERUPTED_BY_AD for
more clarity.

PiperOrigin-RevId: 271997824
2019-10-02 21:28:28 +01:00
tonihei
9cc927bc64 Don't block on a dead thread when waiting for messages.
PiperOrigin-RevId: 271983192
2019-10-02 21:28:13 +01:00