12775 Commits

Author SHA1 Message Date
kimvde
fa98935c06 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-01 10:05:11 +00:00
samrobinson
288899ee9d Change Transformer to use Player.Listener.
AnalyticsListener should not be used for non-analytical actions.

PiperOrigin-RevId: 406355758
2021-11-01 09:59:14 +00:00
olly
8e2083a27b Remove dependency from common tests to exoplayer
PiperOrigin-RevId: 406354526
2021-11-01 09:54:23 +00:00
ibaker
405b811454 Update developer guide to use non-deprecated symbols
#minor-release

PiperOrigin-RevId: 406347412
2021-11-01 09:49:37 +00:00
christosts
a0f8ac7503 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. The exception is
ExoPlayer.Builder.AnalyticsCollector which became nullable and is
initialized in ExoPlayer.Builder.build() in order to use any Clock
that has been set separately with ExoPlayer.Builder.setClock().

#minor-release

PiperOrigin-RevId: 406345976
2021-11-01 09:44:39 +00:00
tonihei
1648b7d062 Merge branch 'release-v2' into dev-v2 2021-11-01 09:27:57 +00:00
christosts
8acce1b5c2 DefaultExtractorsFactory: lazily load flac extension
PiperOrigin-RevId: 406332026
2021-10-29 12:56:35 +01:00
bachinger
dacdf5c42d 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-10-29 12:53:02 +01:00
bachinger
7975182856 Make package in test manifest consistent
PiperOrigin-RevId: 406255369
2021-10-29 11:35:26 +01:00
ibaker
1c824561c6 Migrate callers of deprecated C.java methods to Util.java
#minor-release

PiperOrigin-RevId: 406166670
2021-10-29 11:31:50 +01:00
ibaker
689a92c9ae Update the UI Components dev guide page to use MediaItem API
#minor-release

PiperOrigin-RevId: 406163529
2021-10-29 11:28:15 +01:00
huangdarwin
dcdcb919f4 Transformer GL: Simplify GL program handling.
Relanding 9788750ddb, with some changes
applied to improve primarily readability, naming,
and nullness checks.

PiperOrigin-RevId: 406101742
2021-10-29 11:24:38 +01:00
ibaker
ad39f38995 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-10-29 11:21:00 +01:00
ibaker
6285564904 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-10-29 11:17:27 +01:00
hschlueter
9e8bcc9587 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-29 11:13:49 +01:00
ibaker
3ef7b70c29 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-29 11:10:14 +01:00
ibaker
09c6ccfb66 Add missing javadoc to new ExoPlayer.Builder constructors
Should have been part of
98200c2692

#minor-release

PiperOrigin-RevId: 405880982
2021-10-29 11:06:38 +01:00
ibaker
9c9671a0af 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-29 11:03:05 +01:00
ibaker
39639f8df0 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:25:27 +01:00
samrobinson
3bc0fae708 Migrate SegmentSpeedProviderTest off deprecated method.
PiperOrigin-RevId: 405841397
2021-10-27 13:22:12 +01:00
olly
310f268a62 Set assumedVideoMinimumCodecOperatingRate for all playbacks
PiperOrigin-RevId: 405736227
2021-10-27 13:11:54 +01:00
aquilescanta
383bad80ce Generalize findEsdsPosition to support other types
- This CL does not introduce functional changes.
- This change will allow searching for the clli box while
  parsing the mdcv box in order to construct the HDR
  static info contained in ColorInfo.

#minor-release

PiperOrigin-RevId: 405656499
2021-10-27 13:08:23 +01:00
hschlueter
8545a8b35f Allow video MIME type to be set in TranscodingTransformer.
Also check that the output video MIME type is supported with the given container MIME type in `TranscodingTransformer` and `TransformerBaseRenderer`.

PiperOrigin-RevId: 405645362
2021-10-27 13:04:30 +01:00
ibaker
98200c2692 Replace ExtractorsFactory with MediaSourceFactory in ExoPlayer.Builder
This has a few benefits:
  * Aligns the Builder constructors with the setters
    (setRenderersFactory is missing, but can be easily added in a
    follow-up change).
  * Allows DefaultMediaSourceFactory to be stripped by R8 and
    makes the shrinking dev guide for the cases of providing a custom
    MediaSourceFactory or directly instantiating MediaSource instances
    less weird too.

#minor-release

PiperOrigin-RevId: 405632981
2021-10-27 12:57:24 +01:00
hschlueter
649fe702f2 Deduce encoder video format from decoder format.
When no encoder video MIME type is specified, the `TransformerTranscodingVideoRenderer` now uses the video MIME type of the input for the encoder format.
The input format is now read in a new method `ensureInputFormatRead` which is called before the other configuration methods. This removes the logic for reading the input format from `ensureDecoderConfigured`, because it is now needed for both encoder and decoder configuration but the encoder needs to be configured before GL and GL needs to be configured before the decoder, so the decoder can't read the format.
The width and height are now inferred from the input and the frame rate and bit rate are still hard-coded but set by the `MediaCodecAdapterWrapper` instead of `TranscodingTransformer`.

PiperOrigin-RevId: 405631263
2021-10-27 12:50:28 +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
Sebastian Roth
1ecbdb8d9c formatting 2021-10-26 12:58:49 +01:00
Sebastian Roth
6dd2177a85 Add release notes 2021-10-26 12:58:08 +01:00
Sebastian Roth
4001592c93 Add a test 2021-10-26 12:58:03 +01:00
olly
23b46d2e0c Move NAL unit utils to extractor module
PiperOrigin-RevId: 405473686
2021-10-25 21:39:11 +01:00
olly
101b94f874 Remove dependency from opus module to extractor module
PiperOrigin-RevId: 405429757
2021-10-25 21:35:39 +01:00
olly
2ab7f28ec3 Fix TrackSelectionOverrides imports
PiperOrigin-RevId: 405408606
2021-10-25 21:31:48 +01:00
andrewlewis
922e508213 Update import scrubbing
PiperOrigin-RevId: 405396600
2021-10-25 21:28:15 +01:00
andrewlewis
4a8f2fc787 Update package name
PiperOrigin-RevId: 405394994
2021-10-25 21:24:35 +01:00
Sebastian Roth
c14a9c09b3 docs 2021-10-25 16:11:38 +01:00
olly
647d69b950 Remove jcenter() dependency
PiperOrigin-RevId: 405391455
2021-10-25 15:23:36 +01:00
samrobinson
cd6c2e989f Change MediaMetadata update priority to favour MediaItem values.
The static and dynamic metadata now build up in a list, such that when
the MediaMetadata is built, they are applied in an event order. This
means that newer/fresher values will overwrite older ones. The MediaItem
values are then applied at the end, as they take priority over any other.

#minor-release

PiperOrigin-RevId: 405383177
2021-10-25 15:16:16 +01:00
olly
2b97455a8c Register newly split modules
PiperOrigin-RevId: 405379511
2021-10-25 15:12:16 +01:00
olly
988a55db9d Rm stray blank line
PiperOrigin-RevId: 405377964
2021-10-25 14:54:31 +01:00
olly
2dc7ac3851 Upgrade RTMP dependency and remove jcenter()
PiperOrigin-RevId: 405375352
2021-10-25 14:12:15 +01:00
olly
a42d9f36b1 Allow output audio MIME type to be set in TranscodingTransformer.
This introduces a new option `setAudioMimeType` in `TranscodingTransformer.Builder` and a corresponding check whether the selected type is supported. This check is done using `supportsSampleMimeType` which is now part of the `Muxer.Factory` and `MuxerWrapper` rather than `Muxer`.
A new field `audioMimeType` is added to `Transformation` and the `TransformerAudioRenderer` uses this instead of the input MIME type if requested.

PiperOrigin-RevId: 405367817
2021-10-25 14:04:22 +01:00
kimvde
17d2f5a0b1 Transformer: avoid retrieving the video decoded bytes
Decoded video frames can be large and there is no need to retrieve the
corresponding ByteBuffer as we render the decoded frames on a surface
for better performance.

PiperOrigin-RevId: 405364950
2021-10-25 13:56:51 +01:00
krocard
1f3f22a709 Encapsulate TrackSelectionOverrides in its own class
The current API exposes an `ImmutableMap` of
`TrackGroup` -> `TrackSelectionOverride`.
This has several disadvantages:
 - A difficult to use API for mutation
   (`ImmutableMap.Builder` doesn't support key removal).
 - There is no track selection specific methods,
   how the generic map API mapps to the selection override is not complex
   but to obvious for a casual reader.
 - The internal data type is exposed, making internal refactor difficult.

This was done to have the API ready as quick as possible.

When transitioning the clients to the map API in <unknown commit>,
it became clear that the map API was too verbose and not mapping
to the clients needs, so utility methods
were added to make operations clearer and more concise.

Nevertheless, having to use utility method to use easily and correctly
an API is not the sign of a good API.

This cl refactors the track selection API for several improvements:

 - Add a type `TrackSelectionParameters` that encapsulate the internal
   data structure (map currently).
 - For iteration, expose as a list.
 - Add a `Builder` for easy mutable operations.
 - Add track selection specific methods to avoid having utilities functions.
 - Those operations are the same as `DefaultTrackSelector.Parameters`
   for easier migration. (`setOverride` was renamed to `addOverride`)
 - Move `TrackSelection` classes outside of `TrackSelectionParameters`
   as their own top level classes.

The migration of the client code is straightforward as most of it
were already using the previously mentioned utility functions
that are now native methods.

The full migration has not been done yet, and is pending on this cl approval.

PiperOrigin-RevId: 405362719
2021-10-25 13:52:58 +01:00
olly
2ee72076e5 Add datasource module
PiperOrigin-RevId: 404897119
2021-10-25 13:49:14 +01:00