2311 Commits

Author SHA1 Message Date
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
sofijajvc
7c199eb1ad Move vpx constant for setting output renderer to common constants file
This will be used by both av1 and vp9 extensions.

PiperOrigin-RevId: 271949754
2019-10-02 21:28:05 +01:00
ibaker
bab12af597 Tweak Id3Decoder error message to print hex instead of int
Before: "Unexpected first three bytes of ID3 tag header: 6845556"
After: "Unexpected first three bytes of ID3 tag header: 0x687474"
PiperOrigin-RevId: 271949486
2019-10-02 21:27:57 +01:00
andrewlewis
9f8002f16a Update LINT.IfChange for extension constants
PiperOrigin-RevId: 271617996
2019-10-02 21:27:42 +01:00
aquilescanta
b50da6d72e Add DefaultDrmSessionManager.Builder
Issue:#6334
Issue:#4721
Issue:#6334
Issue:#4867
PiperOrigin-RevId: 271577773
2019-10-02 21:27:35 +01:00
sofijajvc
22c3be75ea Extract vpx code used for GL rendering to common classes
This will be used by both vp9 and av1 Exoplayer extensions.

PiperOrigin-RevId: 271568429
2019-10-02 21:27:27 +01:00
aquilescanta
d632cb86c1 Make multisession work well with placeholder session
Issue:#4867
PiperOrigin-RevId: 271404942
2019-10-02 21:27:19 +01:00
aquilescanta
5a8c4b90f4 Add getFlags implementation to DefaultDrmSessionManager
Issue:#4867
PiperOrigin-RevId: 271348533
2019-10-02 21:26:56 +01:00
tonihei
d185cea73b Forward isPlaying/playbackSuppressionReason changes to analytics listeners.
PiperOrigin-RevId: 271347407
2019-10-02 21:26:49 +01:00
tonihei
004b9e8e8c Add EventListener.onPlaybackSuppressionReasonChanged
Adding this callback makes sense for completeness (we have similar callbacks
for all other playback state properties), and also to detect audio focus loss
while buffering which would currently trigger no callback because isPlaying
is still false.

Issue:#6203
PiperOrigin-RevId: 271347351
2019-10-02 21:26:41 +01:00
sofijajvc
60a9cf68c9 Add OpenGL support to av1 extension: jni library
Update native gav1GetFrame method.

PiperOrigin-RevId: 271160989
2019-10-02 21:26:34 +01:00
aquilescanta
c2bab7a745 Introduce ExoMediaDrm.Provider into DefaultDrmSessionManager
Issue:#4721
PiperOrigin-RevId: 271127127
2019-10-02 21:26:19 +01:00
olly
e4cabcac0f Try initializing ADAPTATION_WORKAROUND_BUFFER as a byte[]
PiperOrigin-RevId: 270999947
2019-10-02 21:26:11 +01:00
aquilescanta
fa803967f2 Remove mediaDrm methods from DefaultDrmSessionManager
DrmSessionManagers may now be in released state, in which case they
may release their MediaDrm. In that case, it would be invalid to
forward method calls to the underlying MediaDrms. Users should
instead call these methods directly on the MediaDrm.

Issue:#4721
PiperOrigin-RevId: 270963393
2019-10-02 21:26:04 +01:00
bachinger
4ad4e3e4fc 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: 270728267
2019-10-02 21:25:39 +01:00
aquilescanta
cc8b774b41 Remove DefaultDrmSessionManager factory methods that enforce MediaDrm leaks
Inline invocations of these methods, which still leaks the MediaDrms.
However, it will be fixed once the DefaultDrmSessionManager API is finalized
and ExoMediaDrm.Providers are introduced.

Issue:#4721
PiperOrigin-RevId: 270681467
2019-10-02 21:25:31 +01:00
tonihei
c8ea831a1e Change default bandwidth fraction in AdaptiveTrackSelection.
A reduced fraction of 0.7 was shown to better balance the rebuffer/quality
trade-off.

PiperOrigin-RevId: 270670465
2019-10-02 21:25:15 +01:00
christosts
5695bae9d8 Remove DataSpec.FLAG_ALLOW_ICY_METADATA
Remove the flag DataSpec.FLAG_ALLOW_ICY_METADATA. Instead, set the
header IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_NAME in the DataSpec
httpRequestHeaders.

BUG:134034248
PiperOrigin-RevId: 270662676
2019-10-02 21:25:07 +01:00
aquilescanta
18b9304f25 Call prepare and release from MediaSources
Issue:#4721
PiperOrigin-RevId: 270342454
2019-09-22 00:16:07 +01:00
aquilescanta
7fc9c848c6 Add prepare and release to DrmSessionManager
The added methods will manage ExoMediaDrms instances.

Issue:#4721
PiperOrigin-RevId: 270335916
2019-09-22 00:15:59 +01:00
bachinger
216f74ecc7 avoid unexpected state changes with certain playlist states
With the internal playlist some new situation may happen that were not possible before:

- handlePlaylistInfoRefreshed in EPII called in IDLE state
- handlePlaylistInfoRefreshed in EPII called in ENDED state with an empty playlist
- seeks in ENDED state with an empty playlist

PiperOrigin-RevId: 270316681
2019-09-22 00:15:43 +01:00
tonihei
0cc0444af8 Restructure setup of default values in track selection parameter builders.
PiperOrigin-RevId: 270250456
2019-09-20 17:21:01 +01:00
tonihei
31b9280e0e Add track selection option to use accessiblity captioning manager settings
This option allows to set the preferred text language and role flags based
on the user's accessiblity captioning settings.

Issue:#5749
PiperOrigin-RevId: 270233205
2019-09-20 17:21:01 +01:00
tonihei
531c5638a2 Rename DEFAULT_WITHOUT_VIEWPORT to DEFAULT_WITHOUT_CONTEXT.
PiperOrigin-RevId: 270227069
2019-09-20 17:21:01 +01:00
bachinger
852c3a53e7 copy masked timeline before notifying listeners
PiperOrigin-RevId: 270221478
2019-09-20 17:21:01 +01:00