71 Commits

Author SHA1 Message Date
huangdarwin
87fd51a39b HDR: Assert output C.ColorTransfer for tests.
To confirm that tone mapping did or did not happen.

PiperOrigin-RevId: 476354606
2022-09-30 18:10:25 +00:00
bachinger
70e82a29b7 Add withAvailableAd for server side inserted ad groups
#minor-release

PiperOrigin-RevId: 472714732
2022-09-30 17:38:58 +00:00
Googler
52d32be8df Fix 1 ErrorProneStyle finding:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment)

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 there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* 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

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 470953422
2022-09-30 17:09:20 +00:00
christosts
3aa5f259a5 ExtractorAsserts: add comments on method arguments
PiperOrigin-RevId: 463320634
2022-08-08 08:06:00 +00:00
ibaker
2deb435625 Annotate methods that always return this with @CanIgnoreReturnValue
It's always safe to ignore the result of these methods, because the
caller already has a reference to the returned value.

PiperOrigin-RevId: 462388947
2022-08-08 07:55:25 +00:00
tonihei
549496f1fa Add method to check if tunneling is enabled.
Issue: google/ExoPlayer#2518
PiperOrigin-RevId: 460482615
2022-07-13 17:36:42 +00:00
Marc Baechinger
8e5af4a3aa Merge pull request #96 from fengdai:release
PiperOrigin-RevId: 458883441
2022-07-04 19:56:41 +00:00
ibaker
6f9ce4056c Consider shuffle order in Timeline.equals()
Previously two timelines that differed only in shuffle order were
considered equal, which resulted in no call to
Player.Listener.onTimelineChanged when calling
ExoPlayer.setShuffleOrder. This in turn resulted in no call to
MediaControllerCompat.Callback.onQueueChanged.

Also make a small fix inside ExoPlayerImpl.setShuffleOrder, to ensure
that the new shuffle order is used when constructing the masked
timeline.

Issue: google/ExoPlayer#9889
#minor-release
PiperOrigin-RevId: 457703727
2022-07-04 19:41:19 +00:00
ibaker
2a2d9e360b Use a helper function and Truth Correspondence instead of NoUidTimeline
NoUidTimeline still exists as a private detail of TestUtil, but it no
longer extends ForwardingTimeline because the interactions are quite
hard to reason about.

#minor-release

PiperOrigin-RevId: 457703593
2022-07-04 19:40:35 +00:00
Feng Dai
c4d15e0a6b Annotated result of StubPlayer.getPlayerError with @Nullable 2022-06-28 10:51:31 +08:00
bachinger
676f766e39 Make HttpDataSourceTestEnv require API 19
PiperOrigin-RevId: 454945333
(cherry picked from commit 7f89531c5b0c894946c2ca4bf54cfc66e3d4507b)
2022-06-15 16:52:51 +00:00
bachinger
7f89531c5b Make HttpDataSourceTestEnv require API 19
PiperOrigin-RevId: 454945333
2022-06-15 15:25:44 +00:00
ibaker
f3574f2354 Rename DefaultTrackSelector.ParametersBuilder to Parameters.Builder
We generally nest the `Builder` for `Foo` inside `Foo`. In this case,
there's already a `DefaultTrackSelector.Parameters.Builder` type visible
to a developer, it just happens to be the 'common'
`TrackSelectorParameters.Builder`, so using it is a bit weird. For
example this code snippet doesn't compile because
`DefaultTrackSelector.Parameters.Builder#build()` returns
`TrackSelectionParameters`. This CL fixes that problem and the code
snippet now compiles.

```java
DefaultTrackSelector.Parameters params =
   new DefaultTrackSelector.Parameters.Builder(context).build()
```

#minor-release

PiperOrigin-RevId: 453215702
(cherry picked from commit 247c2d845dbe0887f556fd3d44cdbc4d97f7451a)
2022-06-07 17:54:55 +00:00
ibaker
247c2d845d Rename DefaultTrackSelector.ParametersBuilder to Parameters.Builder
We generally nest the `Builder` for `Foo` inside `Foo`. In this case,
there's already a `DefaultTrackSelector.Parameters.Builder` type visible
to a developer, it just happens to be the 'common'
`TrackSelectorParameters.Builder`, so using it is a bit weird. For
example this code snippet doesn't compile because
`DefaultTrackSelector.Parameters.Builder#build()` returns
`TrackSelectionParameters`. This CL fixes that problem and the code
snippet now compiles.

```java
DefaultTrackSelector.Parameters params =
   new DefaultTrackSelector.Parameters.Builder(context).build()
```

#minor-release

PiperOrigin-RevId: 453215702
2022-06-07 16:29:17 +00:00
ibaker
af91fdbf54 Add @deprecated javadoc to all @Deprecated @Override methods
This ensures the 'use X instead' message is easily visible in the
generated HTML for the overriding method. Currently it's not, e.g.:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/BasePlayer.html#getCurrentWindowIndex()

#minor-release

PiperOrigin-RevId: 452002224
(cherry picked from commit b8ca5b8951325ed89063b2e30e1c7fd3b78f5e97)
2022-05-31 13:51:49 +00:00
ibaker
b8ca5b8951 Add @deprecated javadoc to all @Deprecated @Override methods
This ensures the 'use X instead' message is easily visible in the
generated HTML for the overriding method. Currently it's not, e.g.:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/BasePlayer.html#getCurrentWindowIndex()

#minor-release

PiperOrigin-RevId: 452002224
2022-05-31 10:44:48 +00:00
aquilescanta
9d460023a2 Use fluent assertions
Gives a bit more information upon failures

PiperOrigin-RevId: 451882968
2022-05-30 16:55:07 +00:00
ibaker
8f3b4f590f Fix typos flagged by lint
PiperOrigin-RevId: 451135097
2022-05-30 16:30:11 +00:00
ibaker
26a1817ebf Rollback of e01bb47263
*** Original commit ***

Rollback of 07302a23bd

*** Original commit ***

Remove `@Nullable` from `MediaSource.Factory` setters

The null-behaviour of these methods creates a minimization footgun,
because **any** call to these setters will prevent R8 from removing
the default implementation (even if it's never used by the app) - this
is because R8 can't tell the default imple...

***

PiperOrigin-RevId: 450453325
2022-05-23 17:12:22 +01:00
ibaker
1d139174fd Rollback of 07302a23bd5894d57514c68b2db499ac46726e77
*** Original commit ***

Remove `@Nullable` from `MediaSource.Factory` setters

The null-behaviour of these methods creates a minimization footgun,
because **any** call to these setters will prevent R8 from removing
the default implementation (even if it's never used by the app) - this
is because R8 can't tell the default implementation is only used if the
parameter is `null`.

PiperOrigin-RevId: 450410833
2022-05-23 13:01:22 +01:00
ibaker
07302a23bd Remove @Nullable from MediaSource.Factory setters
The null-behaviour of these methods creates a minimization footgun,
because **any** call to these setters will prevent R8 from removing
the default implementation (even if it's never used by the app) - this
is because R8 can't tell the default implementation is only used if the
parameter is `null`.

PiperOrigin-RevId: 450386627
2022-05-24 11:07:07 +01:00
rohks
001090cc43 Migrate leaf listeners of Player to new onCues override
PiperOrigin-RevId: 449587030
2022-05-24 11:02:03 +01:00
rohks
c728647290 Create new class to store cues and timestamp.
We need to pass timestamp for the list of cues so we are defining a new class CueGroup which will store both cues and timestamp.

PiperOrigin-RevId: 449212054
2022-05-24 10:49:48 +01:00
ibaker
9a67b30750 Migrate usages from C.TYPE_* to C.CONTENT_TYPE_*
PiperOrigin-RevId: 446156308
2022-05-09 10:46:04 +01:00
ibaker
fd6b57469d Fix calculations that may lose precision compared to their target type
PiperOrigin-RevId: 444861268
2022-05-09 10:21:44 +01:00
olly
83daa052cb Rename TracksInfo and TrackGroupInfo
1. TracksInfo is renamed to Tracks
2. TracksInfo.TrackGroupInfo is renamed to Tracks.Group

PiperOrigin-RevId: 441232373
2022-04-26 14:30:14 +01:00
hschlueter
81ab6c730d Fix non-inclusive language in class names.
https://source.android.com/setup/contribute/respectful-code#term-examples

PiperOrigin-RevId: 438335305
2022-04-06 11:28:30 +01:00
olly
5d8ac644a6 Move TrackGroupArray back to ExoPlayer
PiperOrigin-RevId: 435325454
2022-03-17 13:08:56 +00:00
olly
2ea902c1b2 Move TrackSelection back to ExoPlayer module
PiperOrigin-RevId: 433729648
2022-03-24 17:21:11 +00:00
olly
fdbae6379d Simplify application of track overrides
PiperOrigin-RevId: 432485797
2022-03-04 18:54:25 +00:00
olly
bdc3af1416 Remove deprecated Player track methods
getCurrentTrackGroups and getCurrentTrackSelections are
retained for now, but moved from Player to ExoPlayer, to
ease the transition for some application code that currently
uses these methods.

PiperOrigin-RevId: 430036355
2022-02-22 10:35:04 +00:00
olly
fdd3973a09 Fix potential NPE in test_utils WebServerDispatcher
PiperOrigin-RevId: 429338648
2022-02-18 14:56:01 +00:00
Ian Baker
38717ce969 Reformat some javadoc 2022-02-18 14:54:02 +00:00
bachinger
f3cc5327cd Do not manipulate the duration of SSAI periods in FakeTimeline
#minor-release

PiperOrigin-RevId: 428727560
2022-02-17 11:52:23 +00:00
bachinger
a72f04f9b0 Resolve media period ids in multi-period windows
Ignorable ad periods are skipped to resolve the media period id with the
ad playback state of the resulting period. In case of a change in the period
position un-played ad periods are rolled forward to be played.

PiperOrigin-RevId: 428011116
2022-02-17 10:26:59 +00:00
tonihei
6dae8746ad Stop using SimpleExoPlayer for tests
The class is deprecated and all tests should preferably use the
non-deprecated code paths.

PiperOrigin-RevId: 428007986
2022-02-17 10:25:19 +00:00
krocard
8f7c91a1ad Split AnalyticsCollector in interface and default Impl
This will allow R8 to strip out the implementation
if it is not needed for an app.

#minor-release

PiperOrigin-RevId: 427983730
2022-02-17 10:23:00 +00:00
tonihei
5cc3ce9a50 Remove deprecated EventListener
PiperOrigin-RevId: 427133817
2022-02-08 11:07:50 +00:00
tonihei
287182952d Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 427131569
2022-02-08 11:07:50 +00:00
olly
1f7174e731 Revert of 87420e5f9bd1671cd3068185f7358f5faba53e71
PiperOrigin-RevId: 426996878
2022-02-08 11:07:43 +00:00
olly
631b107bda Revert of 9c8c0a59823e2a49451fbdf7040107c6cea43cc5
PiperOrigin-RevId: 426994820
2022-02-08 11:07:24 +00:00
olly
9c8c0a5982 Remove deprecated EventListener
PiperOrigin-RevId: 426876984
2022-02-08 10:21:37 +00:00
ibaker
87420e5f9b Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 426855255
2022-02-07 10:49:31 +00:00
ibaker
6fc5f9800e Mark @C.SelectionReason as TYPE_USE (only) and use it in more places
This is not backwards compatible if the @SelectionReason annotation is
used in Kotlin code, but before this change there aren't many library
surfaces that return a value annotated with @SelectionReason, so it
seems relatively unlikely that it is in use in any/many apps.

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426409877
2022-02-07 10:46:18 +00:00
ibaker
8149ac8922 Mark all non-public IntDefs as only TYPE_USE
This only changes IntDefs that cannot be used by apps because they're
either private or package-private.

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426372273
2022-02-04 14:51:52 +00:00
olly
cb81b04dab Use ImmutableMap.Builder.buildOrThrow() instead of deprecated build().
More info: ​go/immutable-map-buildorthrow-lsc

NOTE: if the source of truth for this code is *NOT* `third_party`, please let me know and I'll revert this CL (and please consider upstreaming this change yourself).

#inlineme

Tested:
    TAP for global presubmit queue passed after automated deflaking of failures: http://mondo/deflaker/run/530857d2-45cb-4069-a234-48c5efe945f1 http://mondo/deflaker/run/0dce4296-e6bb-42d2-8b64-b393f45b6ad3
    http://test/OCL:425453729:BASE:425451020:1643699365244:811c1a24
PiperOrigin-RevId: 425616165
2022-02-01 18:21:37 +00:00
olly
f28de9de60 Rewrite EventLogger to use new track APIs
PiperOrigin-RevId: 425595951
2022-02-01 14:35:06 +00:00
tonihei
2521ee6d9f Add getRenderer method to ExoPlayer.
This allows access to custom renderers, for example to send messages
or to access custom fields and methods.

PiperOrigin-RevId: 424878963
2022-01-28 16:52:10 +00:00
tonihei
857c18b2e9 Remove opt-out for suppressing wrong thread usage error.
Enforcing the correct thread usage has been enabled since 2.13.0.
Opting-out of this enforement is dangerous as it can hide very hard
to debug bugs.

PiperOrigin-RevId: 424815808
2022-01-28 16:29:20 +00:00
hschlueter
f40f290a30 Remove Transformer-specific things from MediaCodecAdapter.
PiperOrigin-RevId: 421514944
2022-01-25 18:05:31 +00:00