12342 Commits

Author SHA1 Message Date
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
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
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
olly
37b5847681 Get decoder buffers into the right place
PiperOrigin-RevId: 404876228
2021-10-21 23:16:02 +01:00
olly
5e26ba8238 Restructure core_settings
PiperOrigin-RevId: 404851976
2021-10-21 23:12:32 +01:00
olly
ce17f61899 Add decoder module
PiperOrigin-RevId: 404810682
2021-10-21 18:41:33 +01:00
olly
bffe2f7bb3 Fix 2 ErrorProneStyle findings:
* @Reason is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations)
* Curly braces should be used for inline Javadoc tags: {@code ...}
  (see http://go/bugpattern/InvalidInlineTag)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 404769260
2021-10-21 18:25:26 +01:00
christosts
bbe2cef740 DefaultMediaSourceFactory: Lazily load media source factories
Th purpose of this change is to speed up the instantiation of the
DefaultMediaSourceFactory.

PiperOrigin-RevId: 404665352
2021-10-21 12:01:41 +01:00
samrobinson
140ef753f7 Move SimpleExoPlayer.Builder logic to ExoPlayer.Builder.
SimpleExoPlayer Builder now wraps an ExoPlayer.Builder, rather than the
other way round.

PiperOrigin-RevId: 404509106
2021-10-21 11:54:11 +01:00
olly
2ebbdbef8c Move upstream.cache to common ahead of module split
PiperOrigin-RevId: 404502640
2021-10-20 14:02:32 +01:00
bachinger
b74ee00c0f Minor JavaDoc improvement in ExoPlayerLibraryInfo
PiperOrigin-RevId: 404384670
2021-10-20 13:43:23 +01:00
bachinger
0555ae0a92 Move translated strings for download notification to lib-exoplayer
PiperOrigin-RevId: 404316538
2021-10-20 13:39:38 +01:00
olly
ea2013948a Finalize text package
PiperOrigin-RevId: 404277755
2021-10-19 17:32:24 +01:00
olly
1f63aea585 Upgrade test to new version of cronet-embedded
PiperOrigin-RevId: 404236978
2021-10-19 14:40:05 +01:00
olly
b3a1dcfee9 Fix remaining releaseArtifactId renames
PiperOrigin-RevId: 404236349
2021-10-19 14:36:15 +01:00
Steve Mayhew
701f343ee5 Fixes issues with EXTINF duration conversion to microseconds
The HLS Parser converts from a string decimal duration in seconds into long
 microseconds.
Because the conversion passes through a java double type it can result in
representation errors.

For example:

`#EXTINF:4.004`  -> `Segment.durationUs` of 4003999

This matters because the first sample (which is the IDR) for a segment will be discarded following a seek because of the logic in the `SampleQueue`:

````java
    buffer.timeUs = timesUs[relativeReadIndex];
    if (buffer.timeUs < startTimeUs) {
      buffer.addFlag(C.BUFFER_FLAG_DECODE_ONLY);
    }
````
2021-10-18 17:04:29 -07:00
olly
2ef2206041 Move text classes that don't need to live in common.
PiperOrigin-RevId: 404079772
2021-10-18 23:52:28 +01:00
olly
d601875452 Rename releaseArtifact to releaseArtifactId
PiperOrigin-RevId: 404059404
2021-10-18 22:45:47 +01:00
olly
4aeec53019 Copybara config cleanup
PiperOrigin-RevId: 404007749
2021-10-18 20:44:41 +01:00
ibaker
218e0bf885 Demo: Fix NPE when restoring DRM info of a downloaded item
DrmConfiguration.Builder#setLicenseRequestHeaders now rejects null,
since 8fd1381a84

This private method isn't needed at all, it's extracting the headers
from the item that the DrmConfiguration.Builder is already based on.

PiperOrigin-RevId: 403973523
2021-10-18 17:24:36 +01:00
ibaker
422e68b48d Demo: Fix NPE in SampleChooserActivity
This prevents the demo app loading media.exolist.json. The exception
was introduced by
8fd1381a84

PiperOrigin-RevId: 403973062
2021-10-18 17:19:08 +01:00
olly
dd23cb13da Fix moving of DataReader
PiperOrigin-RevId: 403965543
2021-10-18 16:24:57 +01:00