2254 Commits

Author SHA1 Message Date
tonihei
9ca5b0fc61 Add back deprecated getWindow to ForwardingTimeline.
Implementations of ForwardingTimeline may override any of the two variants of
this method. We need to ensure that the customized override is always called.

Add back the deprecated method and make it final to forward to the
non-deprecated method in all cases for ForwardingTimelines.

PiperOrigin-RevId: 265419830
2019-08-30 14:35:27 +01:00
christosts
ce37b7eea2 Add HTTP request parameters (headers) to DataSpec.
Adds HTTP request parameters in DataSpec. Keeps DataSpec behavior to be immutable as before.

PiperOrigin-RevId: 265087782
2019-08-30 14:35:07 +01:00
tonihei
d1084f2728 Do not compare bitrates of audio tracks with different languages.
The last selection criteria is the audio bitrate to prefer higher-quality
streams. We shouldn't apply this criterium though if the languages of the
tracks are different.

Issue:#6335
PiperOrigin-RevId: 265064756
2019-08-23 17:04:16 +01:00
andrewlewis
aae64151e0 Add @CallSuper annotations in SimpleDecoder
The implementation can't work properly unless these methods are called by
subclasses, so annotate them to require calling the super implementation when
overriding.

PiperOrigin-RevId: 265017433
2019-08-23 17:03:28 +01:00
tonihei
29af6899fe Move playback error into PlaybackInfo.
The error is closely related to the playback state IDLE and should be updated
in sync with the state to prevent unexpected event ordering and/or keeping the
error after re-preparation.

Issue:#5407
PiperOrigin-RevId: 265014630
2019-08-23 17:03:12 +01:00
olly
7883eabb38 Update comment to indicate correct int value of "FLAG_ALLOW_CACHE_FRAGMENTATION" in ExoPlayer2 upstream DataSpec
Currently the value of FLAG_ALLOW_CACHE_FRAGMENTATION is defined as "1 << 4" but commented as "8". Either the value of FLAG_ALLOW_CACHE_FRAGMENTATION should be "1 << 3", or the comment should be 16. Here I am modifying the comment since it does not affect any current behavior.

PiperOrigin-RevId: 265011839
2019-08-23 17:02:57 +01:00
andrewlewis
6748eeca6a Avoid potential ArrayStoreException with audio processors
The app is able to pass a more specialized array type, so the Arrays.copyOf call
produces an array into which it's not valid to store arbitrary AudioProcessors.

Create a new array and copy into it to avoid this problem.

PiperOrigin-RevId: 264779164
2019-08-23 17:02:41 +01:00
andrewlewis
f0aae7aee5 Support out-of-band HDR10+ metadata for VP9
Extract supplemental data from block additions in WebM/Matroska.

Allow storing supplemental data alongside samples in the SampleQueue and write
it as a separate field in DecoderInputBuffers.

Handle supplemental data in the VP9 extension by propagating it to the output
buffer.

Handle supplemental data for HDR10+ in MediaCodecVideoRenderer by passing it to
MediaCodec.setParameters, if supported by the component.

PiperOrigin-RevId: 264582805
2019-08-23 17:01:55 +01:00
tonihei
ebf8dc9973 Extend ExoPlayer builders with useLazyPreparations and AnalyticsCollector.
Both values are needed to set-up the ExoPlayer instances for playlists.

PiperOrigin-RevId: 264146052
2019-08-23 17:01:24 +01:00
ibaker
17d8e3728f Add support for the AOM scheme_id for ID3-in-EMSG
https://developer.apple.com/documentation/http_live_streaming/about_the_common_media_application_format_with_http_live_streaming

PiperOrigin-RevId: 264126140
2019-08-23 17:01:08 +01:00
tonihei
20fd4e16d2 Deprecate setTag parameter in Timeline.getWindow.
There is no point in having this parameter as the tag should always be a single
immutable object instantiated at the time the Timeline is created or earlier.

So there is no preformance benefit and it's error-prone in case people
forget to set setTag=true.

PiperOrigin-RevId: 264117041
2019-08-23 17:00:53 +01:00
tonihei
652c2f9c18 Advance playing period even if the next one isn't prepared yet.
This solves various issues around event association for buffering and
error throwing around period discontinuities.

The main changes are:
 - Logic around being "ready" at the end of a period no longer checks if the
   next period is prepared.
 - Advancing the playing period no longer checks if the next one is prepared.
 - Prepare errors are always thrown for the playing period.

This changes the semantics and assumptions about the "playing" period:
 1. The playing period can no longer assumed to be prepared.
 2. We no longer have a case where the queue is non-empty and the playing or
    reading periods are unassigned (=null).
Most other code changes ensure that these changed assumptions are handled.

Issue:#5407
PiperOrigin-RevId: 263776304
2019-08-23 17:00:37 +01:00
ibaker
14f77cb8b1 Unwrap SCTE-35 messages in emsg boxes
PiperOrigin-RevId: 263768428
2019-08-23 17:00:21 +01:00
ibaker
424f991079 Extend EventMessage.toString to include durationMs
This field is used in .equals(), so it makes sense to include it in toString() too.

PiperOrigin-RevId: 263768329
2019-08-23 17:00:06 +01:00
ibaker
01f484cbe9 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: 263767144
2019-08-23 16:59:50 +01:00
tonihei
89dd105034 Update window/period doc in Timeline.
Most users are likely to be only interested in the playlist items. So put the
Window definition first and explicitly mention that this is a playlist
item.

PiperOrigin-RevId: 263764515
2019-08-23 16:59:34 +01:00
tonihei
9dd04baef6 Rollback of 9f55045eeb
*** Original commit ***

Rollback of bbe681a904

*** Original commit ***

PiperOrigin-RevId: 263736897
2019-08-23 16:59:18 +01:00
aquilescanta
efb0549416 Remove 2 deprecated SimpleExoPlayer constructors
PiperOrigin-RevId: 263552552
2019-08-23 16:58:46 +01:00
ibaker
ebb72e358f Support unwrapping nested Metadata messages in MetadataRenderer
Initially this supports ID3-in-EMSG, but can also be used to support SCTE35-in-EMSG too.

PiperOrigin-RevId: 263535925
2019-08-15 14:41:52 +01:00
sofijajvc
567d078e9e Fix createDecoder method declaration
PiperOrigin-RevId: 263534628
2019-08-15 14:41:52 +01:00
aquilescanta
6a122f4740 Document injection of DrmSessionManagers into MediaSources instead of Renderers
PiperOrigin-RevId: 263532499
2019-08-15 14:41:52 +01:00
tonihei
bdc8790896 Remove experimental track bitrate estimator features.
We are not planning to use them in the near future, so remove the experimental
flags and related features.

PiperOrigin-RevId: 263356590
2019-08-15 14:41:52 +01:00
andrewlewis
76a6f5b0d0 Remove RenderersFactory from javadoc
The builder takes renderers instead of using a factory.

PiperOrigin-RevId: 263354003
2019-08-15 14:41:52 +01:00
tonihei
cd4571161a Add builders for SimpleExoPlayer and ExoPlayer.
The current ExoPlayerFactory is growing too big and usage becomes increasingly
complicated because it's not possible to set individual components without
specifying many other defaults.

Adding new builder classes makes building easier and more future-proof.

PiperOrigin-RevId: 263339078
2019-08-15 14:41:51 +01:00
ibaker
69965ddf26 Add Metadata.toString that prints the contents of entries
entries are used in .equals(), so it's good to have them printed in toString() too (for test failures) and it makes logging easier too.

PiperOrigin-RevId: 263335503
2019-08-15 14:41:51 +01:00
ibaker
5482bd05e4 Add description to TextInformationFrame.toString() output
This field is used in .equals(), we should print it in toString() too

PiperOrigin-RevId: 263335432
2019-08-15 14:41:51 +01:00
tonihei
6dd3d49093 Change default video buffer size to 32MB.
The current max video buffer is 13MB which is too small for high quality
streams and doesn't allow the DefaultLoadControl to buffer up to its default
max buffer time of 50 seconds.

Also move util method and constants only used by DefaultLoadControl into this
class.

PiperOrigin-RevId: 263328088
2019-08-15 14:41:51 +01:00
aquilescanta
a572fb3f22 Add a metadata argument to Format factory methods used in HLS
Required for propagation of HlsMetadataEntry's in chunkless preparation.

PiperOrigin-RevId: 263324345
2019-08-15 14:41:51 +01:00
sofijajvc
81a290f1ee Add internal method for format support
PiperOrigin-RevId: 263312721
2019-08-15 14:41:51 +01:00
tonihei
0e33123938 Turn on non-null-by-default for some core library packages.
And add missing some missing annotations to the publicly visible API of these
packages.

PiperOrigin-RevId: 263134804
2019-08-15 14:41:51 +01:00
sofijajvc
860aa2f952 Remove video decoder buffers from nullness blacklist
PiperOrigin-RevId: 263104935
2019-08-15 14:41:51 +01:00
olly
9f0fd870e7 Add haveRenderedFirstFrame
PiperOrigin-RevId: 263046027
2019-08-15 14:41:13 +01:00
tonihei
79c4f1878e Fix JavaDoc generation errors.
This fixes the errors that prevent the JavaDoc generation with the Gradle
script to run through.

PiperOrigin-RevId: 262930857
2019-08-15 14:23:29 +01:00
sofijajvc
5fcc4de1fd Add SimpleDecoder video base renderer
This renderer will be extended by both vp9 and av1 renderers.

PiperOrigin-RevId: 262900391
2019-08-15 14:23:08 +01:00
tonihei
e5fcee40e5 Make reset on network change the default.
PiperOrigin-RevId: 262886490
2019-08-15 14:22:46 +01:00
Yannick RUI
0c4df84eaa Merge remote-tracking branch 'upstream/dev-v2' into dev-v2
# Conflicts:
#	library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionParameters.java
2019-08-12 08:24:10 +02:00
tonihei
389eca6e07 Merge robolectric_testutils into testutils.
We no longer need two modules as AndroidX-Test takes care of the system
abstraction and we no longer have Robolectric Handler/Looper workarounds.

PiperOrigin-RevId: 262363201
2019-08-09 18:36:32 +01:00
olly
a14df33dc7 Only read from FormatHolder when a format has been read
I think we need to start clearing the holder as part of the
DRM rework. When we do this, it'll only be valid to read
from the holder immediately after it's been populated.

PiperOrigin-RevId: 262362725
2019-08-09 18:36:12 +01:00
olly
9f55045eeb Rollback of bbe681a904
*** Original commit ***

Make Kotlin JVM annotations available and use in ExoPlayer.

NoExternal

***

PiperOrigin-RevId: 262323737
2019-08-09 18:35:53 +01:00
tonihei
bbe681a904 Make Kotlin JVM annotations available and use in ExoPlayer.
NoExternal

PiperOrigin-RevId: 262316962
2019-08-09 18:35:34 +01:00
ibaker
79d627d441 Simplify EventMessageEncoder/Decoder serialization
We're no longer tied to the emsg spec, so we can skip unused fields
and assume ms for duration.

Also remove @Nullable annotation from EventMessageEncoder#encode, it
seems the current implementation never returns null

PiperOrigin-RevId: 262135009
2019-08-09 18:34:37 +01:00
ibaker
79e962c55a Expose a method on EventMessageDecoder that returns EventMessage directly
PiperOrigin-RevId: 262121134
2019-08-09 18:33:39 +01:00
tonihei
113e25dc74 Clean up documentation of DefaultTrackSelector.ParametersBuilder.
We don't usually refer to other classes when documenting method parameters
but rather duplicate the actual definition.

PiperOrigin-RevId: 262102714
2019-08-09 18:33:20 +01:00
tonihei
6617862f0b Add allowAudioMixedChannelCountAdaptiveness parameter to DefaultTrackSelector.
We already allow mixed mime type and mixed sample rate adaptation on request,
so for completeness, we can also allow mixed channel count adaptation.

Issue:#6257
PiperOrigin-RevId: 261930046
2019-08-09 18:33:01 +01:00
olly
fd803a39a3 Further MediaPeriod.selectTracks documentation tweak
PiperOrigin-RevId: 261917229
2019-08-09 18:32:41 +01:00
Yannick RUI
831de75f89 Missing documentation link 2019-08-09 10:42:12 +02:00
Yannick RUI
73d6a0f2bd Automatically show closed captioning/hearing impaired text track 2019-08-08 09:17:55 +02:00
tonihei
a9b93d7ec2 Fix some remaining extension API nullability issues.
PiperOrigin-RevId: 261910303
2019-08-06 15:54:08 +01:00
tonihei
b0330edc0b Fix some Android Studio nullness warning created by new @NonNullApi.
PiperOrigin-RevId: 261888086
2019-08-06 15:53:52 +01:00
ibaker
3b9288b805 Migrate literal usages of 1000 to (new) C.MILLIS_PER_SECOND
This only covers calls to scaleLargeTimestamp()

PiperOrigin-RevId: 261878019
2019-08-06 15:53:37 +01:00