554 Commits

Author SHA1 Message Date
ibaker
8b34d160dc Fix implementations of MediaLibrarySessionCallback to pass params
The documentation makes it clear this value should be propagated
through to the result.

PiperOrigin-RevId: 407085751
2021-11-09 10:09:12 +00:00
ibaker
686f2ca96d Migrate usages of Window-based Player methods
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.

#minor-release

PiperOrigin-RevId: 407040052
2021-11-09 10:07:30 +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
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
Andrew Lewis
933e207b3e Update to androidx.media3
PiperOrigin-RevId: 405656499
2021-10-27 09:12:46 +01:00
olly
f605165430 Add database module
PiperOrigin-RevId: 405626096
2021-10-26 14:19:43 +01:00
andrewlewis
0da494c613 Fix main demo gradle task name
PiperOrigin-RevId: 405592960
2021-10-26 14:04:30 +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
18cf01cda6 Move DataSource utils into a DataSourceUtil class
PiperOrigin-RevId: 403910535
2021-10-18 15:25:43 +01:00
ibaker
18b1f3d624 Migrate usages of DrmConfiguration.sessionForClearTypes to new field
The new forcedSessionTrackTypes field was introduced in
<unknown commit>.

These usages are migrated in a follow-up change to add confidence that
the deprecated field continued to work correctly.

PiperOrigin-RevId: 403342893
2021-10-18 14:56:46 +01:00
ibaker
61c8f8c27e Rename DrmConfiguration.sessionForClearTypes to forcedSessionTrackTypes
The previous name is quite easy to misread because it sounds like it
splits up like "(session) for (clear types)" when it's meant to be
"(session for clear) (types)".

The old field is left deprecated for backwards compatibility. The
DrmConfiguration.Builder methods are directly renamed without
deprecation because they're not yet present in a released version of
the library.

PiperOrigin-RevId: 403338799
2021-10-15 12:53:50 +01:00
samrobinson
3c19850ed3 Migrate library usages of SimpleExoPlayer to ExoPlayer.
PiperOrigin-RevId: 402853522
2021-10-14 12:03:11 +01:00
krocard
98ee159df1 Use TracksInfo and selection override in users
Update the UI module, the demos and most other users
to make use of the new player TracksInfo and track
selection override APIs.

PiperOrigin-RevId: 402817857
2021-10-14 11:54:45 +01:00
olly
8a9dcadef3 README updates for misc modules
PiperOrigin-RevId: 402292139
2021-10-12 19:40:44 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
olly
b03ebbeb89 Stop setting custom user agent in demo app
PiperOrigin-RevId: 401741202
2021-10-09 17:39:03 +01:00
ibaker
e4221c3844 Rollback of ed23b2905b
*** Original commit ***

Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

PiperOrigin-RevId: 401468532
2021-10-07 21:53:57 +01:00
ibaker
f3fb03e663 Rollback of ce0cf23a7f
*** Original commit ***

Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

***

PiperOrigin-RevId: 401453039
2021-10-07 21:50:01 +01:00
claincly
3eda590c87 Rollback of 9788750ddb
*** Original commit ***

Simplify GL program handling.

***

PiperOrigin-RevId: 400970170
2021-10-05 23:24:48 +01:00
claincly
9788750ddb Simplify GL program handling.
PiperOrigin-RevId: 400697945
2021-10-04 15:34:43 +01:00
ibaker
b192465bba Migrate usages of MediaItem.Subtitle to SubtitleConfiguration
Usages of the (already deprecated) Subtitle constructors were not
migrated, as it would require migrating to the Builder which is a more
involved change.

PiperOrigin-RevId: 400153139
2021-10-01 11:27:30 +01:00
ibaker
ce0cf23a7f Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399981901
2021-09-30 21:36:14 +01:00
ibaker
f39dba0c5b Migrate usages of MediaItem.ClippingProperties to ClippingConfiguration
PiperOrigin-RevId: 399471555
2021-09-29 10:10:13 +01:00
ibaker
ed23b2905b Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399382297
2021-09-28 16:38:20 +01:00
ibaker
a04f1d1726 Migrate usages of MediaItem.PlaybackProperties to LocalConfiguration
PiperOrigin-RevId: 399206106
2021-09-28 16:35:31 +01:00
ibaker
a194d73c75 Use the new MediaItem.Builder#setAdsConfiguration method
PiperOrigin-RevId: 398185843
2021-09-23 14:53:21 +01:00
ibaker
dd39513a2e Rename MediaItem.DrmConfiguration.requestHeaders to add license
Both license and provisioning requests could be considered 'DRM
requests', and these headers are only sent on license requests, so
rename them to reflect that.

The old field remains deprecated for backwards compatibility.

PiperOrigin-RevId: 397980021
2021-09-23 14:47:13 +01:00
ibaker
e804df8c1f Rename MediaItem.DrmConfiguration.uuid to scheme
The type is already UUID so there's no need to duplicate that info in
the field name, and 'scheme' is a widely used term throughout both
ExoPlayer and android.os.MediaDrm documentation.

The old field remains deprecated for backwards compatibility.

The MediaItem.DrmConfiguration.Builder#setUuid method is renamed
directly (without deprecation) because it's not yet part of a released
ExoPlayer version.

PiperOrigin-RevId: 397961553
2021-09-21 14:23:21 +01:00
ibaker
701be41534 Demo app: Fail fast if parsing invalid DRM config from JSON
These fields can't be used if `drm_uuid` isn't set. Make that case throw
an exception, so it's obvious to a developer what's wrong.

Most of the fields 'obviously' need `drm_uuid` to be set, but it's not
obvious for `drm_session_for_clear_content` (because it might be
reasonable to assume it's possible to play clear content without
specifying a UUID). This tripped me up in
https://github.com/google/ExoPlayer/issues/8842#issuecomment-833659808.

PiperOrigin-RevId: 397328556
2021-09-20 12:54:55 +01:00
ibaker
13827186aa Use the new MediaItem.Builder#setDrmConfiguration method
PiperOrigin-RevId: 397290953
2021-09-17 13:12:53 +01:00
olly
4ff4263af3 DownloadService: Minor improvements
* Avoid ActivityManager log spam by only calling startForeground once,
  and subsequently updating the notification via NotificationManager.
* Tweak demo app service to make it a tiny bit easier to swap the Scheduler.

PiperOrigin-RevId: 397179398
2021-09-17 11:53:39 +01:00
andrewlewis
469c0e756a Use @C.TrackType more widely
Also add `TYPE_USE` target on the @IntDef (and fix @Targets for other
@IntDefs).

#exofixit

PiperOrigin-RevId: 396333212
2021-09-14 12:04:11 +01:00
bachinger
2138bfb396 Add DASH samples with multiple base URLs
PiperOrigin-RevId: 395727438
2021-09-09 18:21:50 +01:00
kimvde
373db56a52 Add method to compile program from shader paths in GlUtil
This method will be useful for adding Open GL to the Transformer.

PiperOrigin-RevId: 394420744
2021-09-02 14:53:20 +01:00
olly
3f16730763 Support generating notifications for paused downloads
- Android 12 will not allow our download service to be
  restarted from the background when conditions that
  allow downloads to continue are met. As an interim
  (and possibly permanent) solution, we'll keep the
  service in the foreground if there are unfinished
  downloads that would continue if conditions were met.
- Keeping the service in the foreground requires a
  foreground notification. Hence we need to be able to
  generate a meaningful notification for this state.

PiperOrigin-RevId: 391969986
2021-08-20 16:25:43 +01:00
krocard
cd297b048a Make Track selection objects Bundleable
Most of those objects needs to be sent to MediaControler.

`TrackSelectior.Parameters` could have stayed Parcelable,
but it needs to be `Bundleable` as it inherit from
`TrackSelectionParameters` that is and needs to be
serializable anyway for the demo app.
As a result it has also been migrated to bundleable.

PiperOrigin-RevId: 391353293
2021-08-19 10:38:51 +01:00
olly
ef0bfa487f Remove previously deprecated DefaultHttpDataSourceFactory
NO_EXTERNAL

PiperOrigin-RevId: 391054962
2021-08-17 15:42:49 +01:00
claincly
21251e69a6 Revert unwanted changes.
PiperOrigin-RevId: 390319457
2021-08-12 16:31:51 +01:00
claincly
4ef0355884 Prototype video transcoding
The prototype is built upon Transformer and took many references from
TransformerAudioRenderer.

Please take a look and we can discuss more details.

PiperOrigin-RevId: 390192487
2021-08-12 16:30:21 +01:00
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
7e8ba03147 Deprecate final non-nested Factory classes in upstream
PiperOrigin-RevId: 389661768
2021-08-09 20:07:24 +01:00
andrewlewis
9c27cfcda7 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).

PiperOrigin-RevId: 387290360
2021-07-28 09:15:29 +01:00
ibaker
fa9a4521ce Remove Big Buck Bunny FLV asset from Demo app media.exolist.json
This URL no longer resolves.

#minor-release

Issue: #9205
PiperOrigin-RevId: 385772688
2021-07-21 14:42:45 +01:00
olly
dea52048cb Bump dependency versions
PiperOrigin-RevId: 382277352
2021-06-30 13:53:01 +01:00
olly
7aaba1ffe5 Migrate usage of Player.EventListener to Player.Listener
PiperOrigin-RevId: 381837274
2021-06-30 13:43:51 +01:00
olly
bcd4bb87e5 Deprecate CronetEngineWrapper
PiperOrigin-RevId: 381239971
2021-06-30 13:32:43 +01:00
aquilescanta
fc26d4eeb1 Remove the last deprecated ParserException constructor
PiperOrigin-RevId: 381221669
2021-06-30 13:27:45 +01:00
aquilescanta
fc1d3dd192 Make onPlayerError take a PlaybackException
PiperOrigin-RevId: 380174672
2021-06-21 22:15:01 +01:00
olly
d68dba6e34 Use relative naming for demo app components
PiperOrigin-RevId: 379506322
2021-06-15 18:46:45 +01:00