2986 Commits

Author SHA1 Message Date
gyumin
dbfb6b183c Implement DeviceComponent of SimpleExoPlayer
PiperOrigin-RevId: 305460260
2020-04-08 21:48:27 +01:00
christosts
7504ce763e Add QoePingStore and QoePingItem
This is the first CL for the offline qoe reporting
feature. Refer to the design doc for full information.

Design doc: go/exoplayer-offline-qoe

PiperOrigin-RevId: 305459231
2020-04-08 21:48:18 +01:00
christosts
e7fd6a0e01 SimpleExoplayer Builder for testing
Create a Builder that creates SimpleExoPlayer instances with fake
components, suitable for testing.

Basically extracts the Builder from ExoPlayerTestRunner to a standalone
class that can be re-used.

PiperOrigin-RevId: 305458419
2020-04-08 21:48:08 +01:00
bachinger
4e2a0f6032 simplify PlayerActivity towards using the media item only
PiperOrigin-RevId: 305300409
2020-04-08 21:47:48 +01:00
bachinger
8f24db73f1 rename Playlist to MediaSourceList
This CL is a renaming only. It's mostly about finding a decent naming for the internal Playlist class. The plan is to have a public Playlist class in the converged Player API, so we need to rename the internal one.

PiperOrigin-RevId: 305266196
2020-04-07 17:07:20 +01:00
olly
07f059116b Clean up AudioFocusManagerTest
PiperOrigin-RevId: 305235961
2020-04-07 13:39:39 +01:00
olly
20cadd6e04 Audio focus: Restore full volume if focus is abandoned when ducked
If we're in the ducked state and updateAudioFocus is called with a
new state for which focus is no longer required, we should restore
the player back to full volume.

Issue: #7182
PiperOrigin-RevId: 305232155
2020-04-07 13:39:30 +01:00
ibaker
5a7dbae18c Use Android's Color.argb() and Color.rgb() methods in ColorParser
PiperOrigin-RevId: 305216138
2020-04-07 13:39:22 +01:00
ibaker
8df6a4b301 Remove nullness warning suppressions from Matcher.group
These were introduced in c7164a30a0

In each case I checked that the groups are not optional,
so if they match they must be non-null.

PiperOrigin-RevId: 305213293
2020-04-07 13:39:13 +01:00
olly
8d2bc7d182 Audio focus: Re-request audio focus if in a transient loss state
This avoids cases where audio focus is never successfully acquired
because another app is holding on to transient audio focus indefinitely.

Issue: #7182
PiperOrigin-RevId: 305108528
2020-04-07 13:38:42 +01:00
andrewlewis
dc813eca41 Fix stuck ad playbacks with DRM-protected content
When ClippingMediaPeriod first tried to read a buffer, if its end
position was before the end of the stream and it was buffered to its end
position, it would sometimes erroneously signal end-of-stream for
protected content because the sample queue might be waiting for DRM keys
at this point.

Work around the issue temporarily by signaling this specific case back
to ClippingMediaPeriod via the DecoderInputBuffer.

There will likely be a cleaner fix as a result of adding support for
dynamic clip end points in the future, at which point this can be
reverted.

issue:#7188
PiperOrigin-RevId: 305081757
2020-04-07 13:38:33 +01:00
Oliver Woodman
8991586c3b Merge pull request #7034 from TiVo:p-exception-unreported-discontinuity
PiperOrigin-RevId: 305006564
2020-04-06 13:28:40 +01:00
kimvde
c13f41af0d Remove deprecated members in DefaultTrackSelector
PiperOrigin-RevId: 304986313
2020-04-06 13:28:28 +01:00
bachinger
fc785871b3 add start and end position to media item
PiperOrigin-RevId: 304795753
2020-04-06 13:28:18 +01:00
olly
8583cd92c7 Suppress warnings in preparation for Checker Framework 3.2.0 upgrade.
In particular, replace @SuppressWarnings("initialization") with
@SuppressWarnings("nullness"); see
https://github.com/typetools/checker-framework/issues/3212.

More information: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:304697666:BASE:304680497:1585968008044:f0c4fd6c
PiperOrigin-RevId: 304751415
2020-04-06 13:28:07 +01:00
ibaker
bdffab1200 Support multiple <rt> nodes inside <ruby> in WebVTT
This is supported (despite what my now-deleted comment says), see the
example here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt

PiperOrigin-RevId: 304612099
2020-04-06 13:27:48 +01:00
olly
fb0330d4db Propagate playback position through LoadControl shouldContinueLoading.
PiperOrigin-RevId: 304420177
2020-04-06 13:27:37 +01:00
bachinger
fe013979c2 use an unmodifiable map with a copy of the license request headers
PiperOrigin-RevId: 304356504
2020-04-06 13:27:16 +01:00
ibaker
f3c7c88d7c Tweak Cue.line javadoc again to reflect WebVTT spec
It's interesting WebVTT explicitly handles line & position differently
in horizontal-rl/lr and vertical-lr/rl contexts. position is always
measured from the left of the viewport, even for rtl text, but line in
vertical-rl is measured from the right of the viewport.

We don't have to make Cue match WebVTT (I can go change the WebVTT
decoding instead) but it seems a reasonable 'default' to follow.

PiperOrigin-RevId: 304353900
2020-04-06 13:26:40 +01:00
bachinger
dc4118da7b add clearTrackTypes and playClearContentWithoutKey to DrmConfiguration
With these additional properties, we can declare the behaviour for clear tracks and clear content on a media item level.

PiperOrigin-RevId: 304351716
2020-04-06 13:26:29 +01:00
kimvde
c9a89bee1c Remove thread checks in player constructor
SimpleExoPlayer instances don't have to be created from the application
thread.

PiperOrigin-RevId: 304190901
2020-04-01 22:39:03 +01:00
ibaker
8cb7907e71 Expand Cue.line and Cue.position javadoc to cover vertical text
PiperOrigin-RevId: 304164078
2020-04-01 22:38:36 +01:00
aquilescanta
41853169a7 Remove loadTaskId to Loader.Callback
Partial rollback of ca799716b8. We'll have to plumb
the id manually, like the rest of the LoadEventInfo
members.

PiperOrigin-RevId: 304067761
2020-04-01 22:37:43 +01:00
krocard
78c103e7ea Remove passthrough from MediaCodecInfo
Selection of a passthrough codec will rarely (if ever) need to be customized, so
remove this capability from MediaCodecInfo.

Applications can still customize whether passthrough is used by overriding
MediaCodecAudioRenderer.usePassthrough, which now also checks for a passthrough
codec.

#exo-offload

PiperOrigin-RevId: 303964682
2020-04-01 22:37:23 +01:00
Oliver Woodman
918172cca7 Merge pull request #7099 from matamegger:feature/fix_pssh_v1_on_firetv
PiperOrigin-RevId: 303937576
2020-03-31 12:35:44 +01:00
ibaker
823666587b Replace CachedContentIndex usage of Random with SecureRandom
This is used to generate the initialization vector for encrypting the
cache contents.

Startblock:
   <unknown commit> is submitted
   and then
   3w have passed
PiperOrigin-RevId: 303932151
2020-03-31 12:35:33 +01:00
ibaker
3aac5b58b8 Fix up some duplicate javadoc on Cue
This was messed up by me in a035c2e20a

PiperOrigin-RevId: 303930392
2020-03-31 12:35:19 +01:00
olly
b6ebd48506 Remaining thread name cleanup
PiperOrigin-RevId: 303829900
2020-03-31 12:35:09 +01:00
Steve Mayhew
48592071a3 Move back to UnexpectedDiscontinuityException extending a RuntimeException
This avoids massive changes to method signatures to add throws.  Also, took suggestion to make it an `IllegalStateException`.

Move the catch outside of the finally that sets `nextLoadPosition` (this allows for possible recovery by reseting the `Extractor` and `TimestampAdjuster`).

Lastly, took the suggestion to make a minimum value for the tolerance (especially usefull for very short i-Frame only segments).
2020-03-30 14:40:02 -07:00
andrewlewis
685bb77297 Move PlaybackStatsListener to non-deprecated state events
PiperOrigin-RevId: 303764399
2020-03-30 19:21:00 +01:00
bachinger
315ba6f324 add subtitle to the media item
PiperOrigin-RevId: 303753642
2020-03-30 17:17:44 +01:00
andrewlewis
0782c5f247 Fix PlaybackStatsListener behavior when not keeping history
issue:#7160
PiperOrigin-RevId: 303747338
2020-03-30 17:17:35 +01:00
aquilescanta
f500110ccf Use MediaLoadData and LoadEventInfo in LoadErrorInfo
PiperOrigin-RevId: 303717642
2020-03-30 17:17:09 +01:00
ibaker
c7164a30a0 Suppress go/nullness warnings caused by Matcher#group(String) and Matcher#group(int)
This is required to align google3's stub (currently marked non-null) with Checker Framework's.

More information: go/matcher-nullness-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:303344687:BASE:303326748:1585344475427:29edc250
PiperOrigin-RevId: 303709053
2020-03-30 17:17:00 +01:00
gyumin
fd03949f85 Add DeviceComponent to Player interface
PiperOrigin-RevId: 303655497
2020-03-30 17:16:51 +01:00
aquilescanta
ca799716b8 Add loadTaskId to Loader.Callback
PiperOrigin-RevId: 303447837
2020-03-30 17:16:41 +01:00
olly
1c11febf3f Workaround C2 AAC decoder flush problem on Android 10
Issue: #6671
PiperOrigin-RevId: 303364788
2020-03-27 23:33:23 +00:00
olly
46a40c6026 Skip aliases of other codecs
- They are always listed with their canonical names
- Considering aliases means that blacklisting a decoder can end up
  not actually blacklisting it, since it may still be accessible
  via an alias. It also means that our decoder fallback logic can
  end up falling back to a decoder that we've already tried!

PiperOrigin-RevId: 303348297
2020-03-27 23:33:07 +00:00
Oliver Woodman
750396c90f Merge pull request #7153 from friederbluemle:fix-gradle-ext
PiperOrigin-RevId: 303319078
2020-03-27 23:32:48 +00:00
tonihei
c4a93b6420 Simplify/avoid usages of onSeekProcessed in ExoPlayer code.
This callback will be deprecated, so moving all usages to better callbacks.
Some usages are still remaining that are less straight-forward to update.

PiperOrigin-RevId: 303298834
2020-03-27 23:32:20 +00:00
tonihei
af05ceac61 Call onSeekProcessed immediately after seek command.
OnSeekProcessed is documented to be called as soon as all neccessary state changes
as a result of the seek have been made. As we now mask the state changes directly
when calling seekTo, we can also call this callback immediately without changing
the semantics of the method.

Our tests often use this callback as a way to wait for the internal player
to receive all pending commands and then report back. This is a special test
requirement for cases where we want to make sure no further updates happen as
a result of the player handling commands. To facilitate that, a new action is
added with a more descriptive name that achieves the same goal.

PiperOrigin-RevId: 303296210
2020-03-27 23:32:03 +00:00
bachinger
25d9f76a07 deprecate createMediaSource with uri argument
PiperOrigin-RevId: 303217607
2020-03-27 23:31:37 +00:00
ibaker
2842eb3eb4 Make milliseconds optional in SubRip (SRT) subtitles
issue:#7122
PiperOrigin-RevId: 303154493
2020-03-27 23:31:21 +00:00
ibaker
47d5dd911c Document ExoMediaDrm listener methods as optional
Also document FrameworkMediaDrm overrides as dependent on API level.

These two methods call through to equivalent methods on MediaDrm that
were added in 23:
https://developer.android.com/reference/android/media/MediaDrm#setOnExpirationUpdateListener(java.util.concurrent.Executor,%20android.media.MediaDrm.OnExpirationUpdateListener)

PiperOrigin-RevId: 303102370
2020-03-27 23:31:12 +00:00
bachinger
d0fc83ed8a Playlist API: move media item based API to Player
This moves the playlist API methods to the Player interface. Implementation is moved from ExoPlayerImpl to BasePlayer where possible.

Further the CastPlayer is changed to implement the Player interface. Proper migration of the Playermanager to not use the ConcatenatingMediaSource anymore follows in a separate, future CL.

PiperOrigin-RevId: 302937779
2020-03-27 23:30:46 +00:00
ibaker
4ff04696c4 Remove unneeded unchecked warning suppressions
Most of these are no longer needed since aa9eb5abc9

Cleanup change automatically generated by error-prone refactoring
//java/com/google/devtools/staticanalysis/errorprone:UnnecessaryJavacSuppressWarnings_refactoring on targets third_party/java_src/android_libs/exoplayer/v2/... java/com/google/android/libraries/exoplayer/v2/...

PiperOrigin-RevId: 302916092
2020-03-27 23:30:37 +00:00
Frieder Bluemle
d24f37cdd7
Check if exoplayerModulePrefix is set 2020-03-27 00:53:01 -07:00
olly
2555fb36b4 Resample float audio to 16-bit by default to enable audio processing
This is less confusing than having audio processing functionality (e.g., playback
speed adjustment) just "not work" for some pieces of media.

If this change is merged, I will update #6749 to also track making DefaultAudioSink
intelligently enable/disable float output depending on how the audio processors are
configured.

Issue: #7134
PiperOrigin-RevId: 302871568
2020-03-25 13:06:17 +00:00
tonihei
46a10ec01a Fix some EventListener logic in ExoPlayerImpl
We currently have multiple places in ExoPlayerImpl that assign PlaybackInfo
instances and then inform listeners of all current changes. This is not ideal
because it causes multiple issues:
 1. Some changes may easily be forgotten, e.g. there are clearly some checks
    missing to see if isPlaying changed (e.g. in seekTo or setMediaSources)
 2. Some callbacks didn't check if the value actually changed before sending
    the callback (e.g. for the timeline change in setMediaSources - if the
    timeline is still the same, we shouldn't send a onTimelineChanged event).
 3. Having multiple callbacks in a single Runnable changes the order of
    listener invocations slightly: Currently all events for one listener will
    be send first before moving to the next listener. It should however send
    a single event to all listeners first before moving to the next event.

All these issues can be solved by always using updatePlaybackInfo and never
assigning playbackInfo directly in another place.

Some tests needed to be updated as well because of issues (2) and (3). Also
added a new test to cover issue (1).

PiperOrigin-RevId: 302844981
2020-03-25 13:05:59 +00:00
olly
3a6a037520 DefaultAudioSink: Fix issue if last processor is not active
It's incorrect to use an AudioFormat returned from AudioProcessor.configure
unless the AudioProcessor is active.

Issue: #7134
PiperOrigin-RevId: 302674132
2020-03-25 13:05:32 +00:00