585 Commits

Author SHA1 Message Date
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
aquilescanta
536f7c8dbe Make StyledPlayerView depend on PlaybackException
PiperOrigin-RevId: 377480089
2021-06-08 12:53:22 +01:00
andrewlewis
2260678bee Fix texture transformation in gldemo
`SurfaceTexture` provides a transform matrix with each buffer. Previously
gldemo ignored this but it is important to apply it to have the video render
properly.

The transformation matrix from the surface texture includes flipping so this
change removes the hard-coded flipping from `a_texcoord`.

Issue: #8992

#minor-release

PiperOrigin-RevId: 377271389
2021-06-03 19:59:43 +01:00
bachinger
095e2feb20 Enable source code formatting
PiperOrigin-RevId: 375979170
2021-05-27 10:42:22 +01:00
aquilescanta
6a8b9557cc Use ERROR_CODE_BEHIND_LIVE_WINDOW instead of instanceof checks
PiperOrigin-RevId: 375514509
2021-05-26 11:29:16 +01:00
olly
6d3e9fc251 Include MediaSource deps in all demo apps
This is mainly so that developers can try out RTSP with
the main demo app without having to change the build.gradle
file.

The change also aligns what media can be played across the
different demo apps.

#minor-release

PiperOrigin-RevId: 373591974
2021-05-13 17:26:08 +01:00
samrobinson
2914e574e6 Rename MediaMetadata trackTitle and trackArtist to title and artist.
#minor-release

PiperOrigin-RevId: 372537414
2021-05-07 14:58:03 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
krocard
ffe31be08b Deprecate component listener in favor of player
All `add*Listener` and `add*Output` methods are
deprecated in favor of `addListener`.

As for the class themselves `VideoListener` and
`AudioListener` are not used internaly by ExoPlayer,
`VideoRendererEventListener`
and `AudioRendererEventListener` are use in their
place.
As a result `VideoListener` and `AudioListener`
can be deprecated in favor `Listener`.

On the other hand `TextOutput` and `MedataOutput`
are used both in the player interface and internally in
renderers.
This means that those class can't be deprecated.
There usage in the public interface are indirectly
deprecated as their is no way to use them without
using the deprecated `add*Output`.
Thus it's not an issue that the class themselves are
not deprecated.

#minor-release

PiperOrigin-RevId: 371318268
2021-04-30 18:55:06 +01:00
samrobinson
3f3d1fb5f2 Change String MediaMetadata.title to CharSequence trackTitle.
PiperOrigin-RevId: 370439509
2021-04-26 18:29:01 +01:00
Andrew Lewis
2a0b45ac77 Merge pull request #8852 from abeljim:dev-v2
PiperOrigin-RevId: 370407108
2021-04-26 18:01:53 +01:00
krocard
08336e372d Rollforward of Move VideoComponent to ExoPlayer
The original cl has been fixed by not implementing
VideoListener but Player.Listener in
StyledPlayerView.

VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

PiperOrigin-RevId: 369417682
2021-04-20 14:02:48 +01:00
ibaker
6550ea88ea Rollback of cdebf6c68b
*** Original commit ***

Move VideoComponent in ExoPlayer

VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

***

PiperOrigin-RevId: 369194309
2021-04-20 00:09:45 +01:00
krocard
cdebf6c68b Move VideoComponent in ExoPlayer
VideoFrameMetadataListener and CameraMotionListener are still part
of the Player interface as a good way to break the UI dependency
on them has not yet been finalised.

PiperOrigin-RevId: 368863829
2021-04-20 00:08:08 +01:00
olly
3ab344c218 Fix 1 ErrorProneStyle finding:
* The Google Java Style Guide requires that each switch statement includes a default statement group, even if it contains no code. (This requirement is lifted for any switch statement that covers all values of an enum.)
  (see http://go/bugpattern/MissingDefault)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* 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/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 368586454
2021-04-15 10:53:47 +01:00
Ian Baker
e2abc961b2 Merge pull request #8749 from romanofranz:patch-1
PiperOrigin-RevId: 364779790
2021-03-24 18:07:35 +00:00
Francesco Romano
846498287c
Update IntentUtil.java to parse title (metadata)
Added the String title in the Intent so MediaMetadata.title can be populated correctly for single media items. This is useful to query PlayerActivity about what it is currently playing.
2021-03-23 16:09:01 +01:00
tonihei
bc9fb8615e Use correct period-window offset for initial prepare position.
MaskingMediaSource needs to resolve the prepare position set for a MaskingPeriod
while the source was still unprepared to the first actual prepare position.

It currently assumes that the period-window offset and the default position is
zero. This assumption is correct when a PlaceholderTimeline is used, but it
may not be true if the real timeline is already known (e.g. when re-preparing
a live stream after a playback error).

Fix this by using the known timeline at the time of the preparation.
Also:
 - Update a test that should have caught this to use lazy re-preparation.
 - Change the demo app code to use the recommended way to restart playback
   after a BehindLiveWindowException.

Issue: #8675
PiperOrigin-RevId: 361604191
2021-03-12 10:40:15 +00:00
Ian Baker
49c282d6fa Merge pull request #8677 from dlafayet:ttml
PiperOrigin-RevId: 361106701
2021-03-12 10:38:59 +00:00
aquilescanta
1c40c75433 Use a debug signature config for demo apps' release variant
PiperOrigin-RevId: 359724874
2021-03-02 17:02:55 +00:00