12324 Commits

Author SHA1 Message Date
samrobinson
c3fbe2e1d3 Allow remove video transformer option.
PiperOrigin-RevId: 406849436
2021-11-09 10:07:30 +00:00
tonihei
90f74dc7a1 Suppress lint warning about wrong IntDef in FrameworkMuxer
The values are equivalent and we can suppress the warning.

PiperOrigin-RevId: 406839242
2021-11-09 10:07:30 +00:00
Ian Baker
302053c033 Merge pull request #9576 from TiVo:p-fix-duration-round
PiperOrigin-RevId: 406839109
2021-11-09 10:07:30 +00:00
tonihei
ea2851b56e Add missing IntDef constant.
The video scaling mode and stream type defines a default constant
that needs to be added to the IntDef definition to be assignable.

PiperOrigin-RevId: 406835696
2021-11-09 10:07:30 +00:00
tonihei
90a4383c6b Remove wrong IntDef usage.
The variable is storing OpenGL's draw mode, which is different from Projection.DrawMode.

PiperOrigin-RevId: 406820812
2021-11-09 10:07:30 +00:00
tonihei
665910ab76 Suppress lint warning about wrong IntDef assignment.
The return values of AudioManager.getPlaybackOffloadSupport are the same as the values defined in C.AudioManagerOffloadMode.

PiperOrigin-RevId: 406817413
2021-11-09 10:07:30 +00:00
olly
99ace2dbb1 Rename MediaFormatUtil constants
PiperOrigin-RevId: 406816023
2021-11-09 10:07:30 +00:00
tonihei
d1e13b629d Fix rounding error in fMP4 presentation time calculation
The presentation time in fMP4 is calculated by adding and subtracting
3 values. All 3 values are currently converted to microseconds first
before the calculation, leading to rounding errors. The rounding errors
can be avoided by doing the conversion to microseconds as the last step.

For example:
In timescale 96000:  8008+8008-16016 = 0
Rounding to us first: 83416+83416-166833=-1

#minor-release

PiperOrigin-RevId: 406809844
2021-11-09 10:07:30 +00:00
tonihei
7b84d6b051 Throw pending clipping errors created during period preparation.
Currently, clipping errors are never thrown if we already have a
MediaPeriod. This may happen for example for ProgressiveMediaSource
where we need to create a MediaPeriod before knowing whether clipping
is supported. Playback will still fail, but with unrelated assertion
errors that are hard to understand for users.

Fix this by setting the pending error on the ClippingMediaPeriod.

#minor-release

Issue: Issue: google/ExoPlayer#9580
PiperOrigin-RevId: 406809737
2021-11-09 10:07:30 +00:00
ibaker
15e2a13ea3 Re-position IntDefs in media3 stable API
These IntDefs are now annotated with TYPE_USE [1], so they can be moved
to directly before the type (int).

[1] Since https://github.com/androidx/media/commit/9ba21a75f

PiperOrigin-RevId: 406803555
2021-11-09 10:07:00 +00:00
ibaker
b3c8c2a06c Add TYPE_USE to IntDefs used in the media3 stable API
This allows the use of the intdef in parameterized types,
e.g. List<@MyIntDef Integer>

For IntDefs that are already released in ExoPlayer 2.15.1 we add
TYPE_USE in addition to all other reasonable targets, to maintain
backwards compatibility with Kotlin code (where an incorrectly
positioned annotation is a compilation failure). 'reasonable targets'
includes FIELD, METHOD, PARAMETER and LOCAL_VARIABLE but not TYPE,
CONSTRUCTOR, ANNOTATION_TYPE, PACKAGE or MODULE. TYPE_PARAMETER is
implied by TYPE_USE.

For not-yet-released IntDefs we just add TYPE_USE.

#minor-release

PiperOrigin-RevId: 406793413
2021-11-09 10:07:00 +00:00
olly
cc65daa7aa Upgrade gradle plugin version
PiperOrigin-RevId: 406789671
2021-11-09 10:07:00 +00:00
tonihei
10dcdd1df5 Add large renderer position offset.
This helps to prevent issues where decoders can't handle negative
timestamps. In particular it avoids issues when the media accidentally
or intentionally starts with small negative timestamps. But it also
helps to prevent other renderer resets at a later point, for example
if a live stream with a large start offset is enqueued in the playlist.

#minor-release

PiperOrigin-RevId: 406786977
2021-11-09 10:07:00 +00:00
ibaker
7115058ccd Remove unecessary warning suppression in PlaybackException
PiperOrigin-RevId: 406783965
2021-11-09 10:07:00 +00:00
ibaker
729b2b64f3 Don't pass deviceVolume as volume in MediaControllerImplLegacy
deviceVolume (int) and volume (float) are not the same. Elsewhere
MediaControllerImplLegacy doesn't support volume and defaults to 1
(setVolume, getVolume), so defaulting to 1 here seems correct.

PiperOrigin-RevId: 406780391
2021-11-09 10:07:00 +00:00
huangdarwin
bf18aae99d GL: Make ProjectionRenderer's GL Program @MonotonicNonNull.
PiperOrigin-RevId: 406385758
2021-11-09 10:07:00 +00:00
kimvde
8586127d88 WavExtractor: split read stages into states
This refactoring is the basis to support RF64 (see
Issue: google/ExoPlayer#9543).

#minor-release

PiperOrigin-RevId: 406377924
2021-11-09 10:07:00 +00:00
samrobinson
51aee84d13 Change Transformer to use Player.Listener.
AnalyticsListener should not be used for non-analytical actions.

PiperOrigin-RevId: 406355758
2021-11-09 10:07:00 +00:00
olly
a3b71d5400 Remove dependency from common tests to exoplayer
PiperOrigin-RevId: 406354526
2021-11-09 10:07:00 +00:00
ibaker
0d144366c3 Mark MediaSessionService.MediaNotification final
PiperOrigin-RevId: 406347510
2021-11-09 10:07:00 +00:00
christosts
2c98e8bb4f ExoPlayer.Builder: lazily initialize default components
Initialize default components lazily in ExoPlayer.Builder to avoid
redundant component instantiations, useful in cases where apps
overwrite default components with ExoPlayer.Builder setters.

The fields in ExoPlayer.Builder are wrapped in a Supplier (rather than
just making then nullable and initializing them in
ExoPlayer.Builder.build()) so that we maintain the proguarding
properties of this class.

PiperOrigin-RevId: 406345976
2021-11-09 10:06:11 +00:00
christosts
9d5fd4f402 DefaultExtractorsFactory: lazily load flac extension
PiperOrigin-RevId: 406332026
2021-11-09 10:06:11 +00:00
bachinger
80c5e00b18 Defer setting defaults for rendition reports until playlist is parsed
This makes sure that #EXT-X-RENDITION-REPORT tags can be placed before
the list of segments/parts as well. We were previously assuming that
these come at the end, which naturally would make sense and is done like
this in all examples, but it is not explicitly defined by the spec.

Issue: google/ExoPlayer#9592
PiperOrigin-RevId: 406329684
2021-11-09 10:05:40 +00:00
bachinger
222db48298 Make package in test manifest consistent
PiperOrigin-RevId: 406255369
2021-11-08 15:18:26 +00:00
ibaker
a60843ead5 Migrate callers of deprecated C.java methods to Util.java
#minor-release

PiperOrigin-RevId: 406166670
2021-11-08 15:17:26 +00:00
ibaker
67640dff0e Remove confusing @throws clauses from MediaLibrarySessionCallback
These seem to be describing an exception being thrown based on a
property of the value being returned from this method? Or is the
expectation that every implementation of this interface throws the
AssertionError themselves.

Given AssertionError is unchecked, and shouldn't be explicitly caught
anywhere, it seems easiest just to remove all this documentation?

PiperOrigin-RevId: 406107606
2021-11-08 15:16:11 +00:00
huangdarwin
7f64a5a1aa Transformer GL: Simplify GL program handling.
Relanding 9788750ddb, with some changes
applied to improve primarily readability, naming,
and nullness checks.

PiperOrigin-RevId: 406101742
2021-11-08 15:15:02 +00:00
ibaker
f37e980018 Migrate media3.session references from Window to MediaItem
#minor-release

PiperOrigin-RevId: 405927299
2021-11-08 15:13:41 +00:00
ibaker
d83fe03d88 Update most Player parameter & doc references from Window to MediaItem
Only deprecated references remain.

Usages of the deprecated methods will be migrated in a follow-up change.

#minor-release

PiperOrigin-RevId: 405927141
2021-11-08 15:12:32 +00:00
ibaker
b60acca872 Clarify that ExoPlayer.Builder constructor overloads only exist for R8
Also add a setRenderersFactory() method, so that all constructor-provided
components can also be passed via setters.

This comment already appears on the constructor that takes all
components, but it applies to these ones as well.

PiperOrigin-RevId: 405917343
2021-11-08 15:11:15 +00:00
andrewlewis
e6242690ff Elaborate migration info in media3 README
PiperOrigin-RevId: 405909676
2021-10-27 17:52:39 +01:00
hschlueter
399172d63f Refactor nullness checks in renderers.
`checkNotNull` should be avoided where possible.
This change adds `@EnsuresNonNull` or `@EnsuresNonNullIf` to configuration methods for fields they initialize.

`checkNotNull` is now avoided for the `@MonotonicNonNull` formats by adding `@RequiresNonNull` annotations.

`checkNotNull` is now avoided for the encoder and decoder in `feedMuxerFromEncoder()`, `feedEncoderFromDecoder()`, `feedDecoderFromInput()`, etc. by creating local variables for `encoder` and `decoder` in `render` after the configuration method calls and passing these as non-null parameters.

PiperOrigin-RevId: 405893824
2021-10-27 17:51:40 +01:00
ibaker
60a68f8891 Remove IntRange from Player.getMediaItemAt
No other index-related methods in Player are annotated, it's considered
obvious that these should be >=0.

PiperOrigin-RevId: 405882756
2021-10-27 17:50:41 +01:00
ibaker
d39ffa5a34 Add missing javadoc to new ExoPlayer.Builder constructors
Should have been part of
<unknown commit>

#minor-release

PiperOrigin-RevId: 405880982
2021-10-27 17:49:43 +01:00
ibaker
9a49a9ccda Remove all references to @NonNull
Our package-info.java files are annotated with @NonNullApi which results
in everything being non-null by default, so this annotation is never
needed.

#minor-release

PiperOrigin-RevId: 405864737
2021-10-27 17:48:40 +01:00
andrewlewis
651985b0ac Move doc-files to new package name
PiperOrigin-RevId: 405862549
2021-10-27 13:08:53 +01:00
ibaker
e8fdab353f Allow missing full_range_flag in colr box with type=nclx
Test file produced with:
$ MP4Box -add "sample.mp4#video:colr=nclc,1,1,1" -new sample_18byte_nclx_colr.mp4

And then manually changing the `nclc` bytes to `nclx`.

This produces an 18-byte `colr` box with type `nclx`. The bitstream of
this file does not contain HDR content, so the file itself is invalid
for playback with a real decoder, but adding the box is enough to test
the extractor change in this commit.

(aside: MP4Box will let you pass `nclx`, but it requires 4 parameters, i.e. it
requires the full_range_flag to be set, resulting in a valid 19-byte colr box)

#minor-release
Issue: #9332
PiperOrigin-RevId: 405842520
2021-10-27 13:04:55 +01:00
samrobinson
031f26ba61 Migrate SegmentSpeedProviderTest off deprecated method.
PiperOrigin-RevId: 405841397
2021-10-27 13:03:48 +01:00
ibaker
afdb712fff Remove extra word in media3 readme
PiperOrigin-RevId: 405837263
2021-10-27 13:02:40 +01:00
andrewlewis
5a7d3c7bee Update ADS talk link
PiperOrigin-RevId: 405825700
2021-10-27 09:24:27 +01:00
olly
aff15ae9ee Set assumedVideoMinimumCodecOperatingRate for all playbacks
PiperOrigin-RevId: 405736227
2021-10-27 09:23:28 +01:00
Andrew Lewis
933e207b3e Update to androidx.media3
PiperOrigin-RevId: 405656499
2021-10-27 09:12:46 +01:00
samrobinson
68729ecd49 Remove unneeded release notes.
PiperOrigin-RevId: 405626270
2021-10-26 14:23:32 +01:00
olly
f605165430 Add database module
PiperOrigin-RevId: 405626096
2021-10-26 14:19:43 +01:00
andrewlewis
a7aa674a29 Removed unused link
PiperOrigin-RevId: 405624136
2021-10-26 14:15:54 +01:00
samrobinson
74fb05cfbe Update MediaMetadata javadoc to clarify nuances.
PiperOrigin-RevId: 405616711
2021-10-26 14:12:10 +01:00
andrewlewis
0ad1cdbfa1 Tidy READMEs
PiperOrigin-RevId: 405598530
2021-10-26 14:08:21 +01:00
andrewlewis
0da494c613 Fix main demo gradle task name
PiperOrigin-RevId: 405592960
2021-10-26 14:04:30 +01:00
andrewlewis
241409a888 Remove resolved TODO
This has been done for (almost) all span types.

PiperOrigin-RevId: 405588294
2021-10-26 13:55:56 +01:00
olly
23b46d2e0c Move NAL unit utils to extractor module
PiperOrigin-RevId: 405473686
2021-10-25 21:39:11 +01:00