152 Commits

Author SHA1 Message Date
ibaker
cb7d565fd4 Add missing @param tags
Dackka generates a warning if a method has at least one `@param` tag,
but not all of them are documented.

#minor-release

PiperOrigin-RevId: 513873453
2023-03-07 11:49:24 +00:00
microkatz
ecd91d865c Merge pull request #248 from lemondoglol:update-segment-size
PiperOrigin-RevId: 507784608
2023-02-08 14:08:36 +00:00
christosts
c6569a36fb Merge pull request #10793 from fraunhoferfokus:dash-thumbnail-support
PiperOrigin-RevId: 506261584
2023-02-02 15:30:08 +00:00
lemondoglol
b65baf7d72 make merged segment size configurable 2023-01-30 13:15:10 -05:00
ibaker
636a4a8538 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
2022-12-12 11:19:23 +00:00
ibaker
4f04a284ed Add missing IntDef on MediaSource.Factory.getSupportedTypes overrides
Without this the annotation isn't shown in javadoc (same in Dackka)

No annotation:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.html#getSupportedTypes()

Annotation present:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/MediaSource.Factory.html#getSupportedTypes()

#minor-release

PiperOrigin-RevId: 487498450
2022-11-10 14:56:54 +00:00
Googler
6d3cc01d79 Fix 3 ErrorProneStyle findings:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment) (3 times)

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: 471198016
2022-09-30 17:17:38 +00:00
olly
3786b64217 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
2022-08-08 08:02:36 +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
adc50515e9 Fix setDataSourceFactory handling in DefaultMediaSourceFactory
The call doesn't currently reset the already loaded suppliers and
factories. Also fix the supplier loading code to use a local copy
of the current dataSourceFactory to avoid leaking an updated
instance to a later invocation.

Issue: androidx/media#116

#minor-release

PiperOrigin-RevId: 460721541
2022-07-13 17:48:16 +00:00
Rohit Singh
f00f93a96e Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
2022-07-07 16:43:14 +00:00
rohks
621617f981 Make MetadataRenderer configurable to output metadata early.
PiperOrigin-RevId: 457974611
2022-07-04 19:42:59 +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
07039a45b0 Remove @Nullable from some Dash/Hls/SsMediaSource.Factory methods
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`.

Follow-up to 07302a23bd

PiperOrigin-RevId: 450395941
2022-05-24 11:07:57 +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
ibaker
4f616d6003 Remove ExoPlayer's RawCcExtractor
RawCC is a Google-internal subtitle format, and is no longer used with
ExoPlayer.

PiperOrigin-RevId: 446950691
2022-05-09 11:02:25 +01:00
ibaker
9a67b30750 Migrate usages from C.TYPE_* to C.CONTENT_TYPE_*
PiperOrigin-RevId: 446156308
2022-05-09 10:46:04 +01:00
Ian Baker
9e7c8380c2 Merge pull request #10214 from cedricxperi:dev-v2
PiperOrigin-RevId: 444585404
2022-05-09 10:14:11 +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
76928738f3 Fix 11 ErrorProneStyle findings:
* These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
  (see http://go/bugpattern/UnnecessaryParentheses) (11 times)

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: 436726763
2022-03-23 13:55:36 +00:00
olly
5d8ac644a6 Move TrackGroupArray back to ExoPlayer
PiperOrigin-RevId: 435325454
2022-03-17 13:08:56 +00:00
ibaker
fb88a4fbe7 Fix stale javadoc in DashUtil
The type of this parameter was changed when it was moved from
OfflineLicenseHelper to DashUtil in
98f4fb85c2

PiperOrigin-RevId: 433770325
2022-03-10 17:15:49 +00:00
Ian Baker
38717ce969 Reformat some javadoc 2022-02-18 14:54:02 +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
ibaker
87420e5f9b Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 426855255
2022-02-07 10:49:31 +00:00
olly
24749339db Support relative MPD.Location URIs
#minor-release
Issue: google/ExoPlayer#9939
PiperOrigin-RevId: 426394339
2022-02-07 10:41:54 +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
d2cc14a98b Fix some lint warnings
PiperOrigin-RevId: 424383900
2022-01-28 08:46:46 +00:00
Andrew Lewis
0c4d9b10c0 Merge pull request #9865 from aureliendrouet:unused-param-chunk-extractor-factory
PiperOrigin-RevId: 424379489
2022-01-28 08:44:39 +00:00
bachinger
c6e5ace310 Inherit parent properties for manifests with dvb profile only
Issue: google/ExoPlayer#9856
PiperOrigin-RevId: 421842579
2022-01-25 18:23:20 +00:00
tonihei
b12918d1e6 Disable live speed adjustment where it has no benefit
Live speed adjustment is used for all live playback at the moment,
but has no user visible effect if the media is not played with low
latency. To avoid unnecessary adjustment during playback without
benefit, this change restricts the live speed adjustment to cases
where either the user requested a speed value in the MediaItem or the
media specifically defined a low-latency stream.

Issue: google/ExoPlayer#9329
PiperOrigin-RevId: 421514283
2022-01-25 18:04:02 +00:00
ibaker
d7b209a13b Remove setTag from (Ss|Hls|Dash)MediaSource.Factory
This method has been deprecated since 2.12.0 ([commit](d1bbd3507a)).

Also remove
DashMediaSource.Factory#setLivePresentationDelayMs(long, boolean), this
method has been deprecated since 2.13.0 ([commit](41b58d503a)).

PiperOrigin-RevId: 420719877
2022-01-11 13:44:06 +00:00
bachinger
6ea54253ac Make EventSampleStream honour FLAG_PEEK and FLAG_OMIT_SAMPLE_DATA
#minor-release

PiperOrigin-RevId: 420289147
2022-01-11 13:37:30 +00:00
bachinger
dfec9c71de Merge pull request #9834 from TheJohnBowers:fix_9832
PiperOrigin-RevId: 419864140
2022-01-11 13:26:23 +00:00
ibaker
b05583f00d DASH: Stop interpreting main track role as SELECTION_FLAG_DEFAULT
The `main` role distinguishes a track from an `alternate`, but unlike
`SELECTION_FLAG_DEFAULT` it doesn't imply the track should be selected
unless user preferences state otherwise. e.g. in the case of a text
track, the player shouldn't enable subtitle rendering just because a
`main` text track is present in the manifest.

The `main`/`alternate` distinction is still available through
`Format.roleFlags` and the `ROLE_FLAG_MAIN` and `ROLE_FLAG_ALTERNATE`
values.

This behaviour was originally [added in 2.2.0](7f967f3057),
however at the time the `C.RoleFlags` IntDef did not exist. The IntDef
was [added in 2.10.0](a86a9137be).

PiperOrigin-RevId: 418937747
2022-01-05 12:15:27 +00:00
olly
a9660de192 Fix 1 ErrorProneStyle finding:
* These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them

PiperOrigin-RevId: 417988060
2022-01-05 12:14:43 +00:00
ibaker
34a1f884dc Add MediaSource.Factory and deprecate MediaSourceFactory
This more closely matches the pattern we have for all implementations
except DefaultMediaSourceFactory (e.g. ProgressiveMediaSource.Factory)
and other factory interfaces like (Http)DataSource.Factory.

PiperOrigin-RevId: 417826803
2022-01-05 10:51:41 +00:00
ibaker
cee7e8e2db Delete deprecated methods from MediaSourceFactory
Some have been deprecated since 2.13.0
([commit](5b9fa7d7d9)):
* `setDrmSessionManager(DrmSessionManager)`
* `setDrmHttpDataSourceFactory(HttpDataSource.Factory)`
* `setDrmUserAgent(String)`

And the rest have been deprecated since 2.12.0
([commit](d1bbd3507a)):
* `setStreamKeys(List<String>)`
* `createMediaSource(Uri)`

PiperOrigin-RevId: 417622794
2022-01-05 10:44:23 +00:00
ibaker
691f9c50cf Migrate usages of deprecated MediaSourceFactory methods
PiperOrigin-RevId: 417428182
2022-01-05 10:40:02 +00:00
tonihei
422a003a03 Add some correctness checks to min/max live latency values.
For DASH manifests, we merge min/max live latency values from various
sources and they may not be consistent with each other. To ensure we
use a sensible configuration in all cases, we can add more correctness
checks:
 1. Limit the min/max values to fall into the available live window.
 2. Ensure that maxLatency >= minLatency in all cases.

Issue: google/ExoPlayer#9750
PiperOrigin-RevId: 415282938
2021-12-10 11:22:02 +00:00
tonihei
f1a5825d73 Add optional id to TrackGroup.
This allows to give TrackGroups an identifier. The underlying goal is
to provide a way to make otherwise identical TrackGroups
distinguishable.

Also set this id in all internal sources that may produce identical
TrackGroups in certain edge cases.

Issue: google/ExoPlayer#9718
PiperOrigin-RevId: 413430719
2021-12-02 11:56:42 +00:00
ibaker
a4c12ca97d Parse DASH forced-subtitle role value
Issue: google/ExoPlayer#9727

#minor-release

PiperOrigin-RevId: 412266397
2021-12-02 11:55:44 +00:00
tonihei
48118f3c87 Set LogSessionId on MediaParser for DASH sources.
This requires some plumbing through DashMediaPeriod and DashChunkSource.

PiperOrigin-RevId: 411012115
2021-11-19 15:16:39 +00:00
tonihei
9af85d9b25 Move DrmSessionManager initial player setup to its own method.
Currently, DrmSessionManager takes player specific values (= the
playback looper) through (pre)acquireSession calls and requires
the caller to pass in the same values every time.

Instead, we can configure the DrmSessionManager for playback with
a player once before it's being used. We can't simply extend the
prepare() method as prepare may be called before the player is
created to prewarm the DrmSessionManager.

The new method also takes a PlayerId which is bound to the lifetime
of the player similar to the playback looper.

To avoid breakage of custom MediaSources with DRM, we can keep the
old the SampleQueue.createWithDrm method as deprecated.

PiperOrigin-RevId: 410998240
2021-11-19 15:12:13 +00:00
tonihei
1618e0ef8e Add parsed essential/supplemental properties to the Representation.
We already parse essential and supplemental properties from the
Representation, but don't add them to our Representation class so that
they can be accessed by users.

Issue: google/ExoPlayer#9579
PiperOrigin-RevId: 409961990
2021-11-19 14:48:01 +00:00
tonihei
5d8bb7ddd2 Plumb PlayerId to MediaSource.
MediaSource can be reused with other Player instances after they
have been released, so we need to set the PlayerId when preparing
the source. Access can mostly be handled by the implementation in
BaseMediaSource.

PiperOrigin-RevId: 408878824
2021-11-19 14:35:52 +00:00
ibaker
dba30ff863 Add @Deprecated to MediaSourceFactory deprecated overrides
This is needed to ensure the deprecation warning appears on usages in
Android Studio and in javadoc.

#minor-release

PiperOrigin-RevId: 408319182
2021-11-09 10:10:11 +00:00
ibaker
429672903f Migrate usages of deprecated MediaItem symbols
#minor-release

PiperOrigin-RevId: 407847729
2021-11-09 10:10:10 +00:00