59 Commits

Author SHA1 Message Date
Gaëtan Muller
71b8c32a6f Remove Multidex 2024-07-24 16:17:00 +01:00
tonihei
6ac60c6dff Disable enhanced Java 8 desugaring
This avoids that apps have to depend on this additional config

Issue: androidx/media#1312
PiperOrigin-RevId: 631447767
2024-05-07 09:26:36 -07:00
tonihei
16df05ec29 Upgrade Gradle and AGP
The newer versions include a bugfix that automatically highlights
when our project requires enhanced Java 8 desugaring.

Issue: androidx/media#1312
PiperOrigin-RevId: 631373018
2024-05-07 04:20:55 -07:00
Gaëtan Muller
973b717914 Remove unnecessary SDK_INT checks 2024-02-13 10:26:19 +00:00
huangdarwin
6c68146efa GL demo: Use setColor instead of setARGB
setColor is a bit more readable

PiperOrigin-RevId: 584322875
2023-11-21 07:45:32 -08:00
ibaker
d60596cfca Use package-level @OptIn for demo apps
This demonstrates that `@OptIn` can now be used at the package-level
(since [`androidx.annotation:annotation-experimental:1.3.0`](https://developer.android.com/jetpack/androidx/releases/annotation#annotation-experimental-1.3.0)).

PiperOrigin-RevId: 572187729
2023-10-10 03:02:25 -07:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
rohks
81fd9d2867 Enable multidex for demo-gl app
#minor-release

PiperOrigin-RevId: 523708424
2023-04-12 17:03:15 +01:00
rohks
d260b0c2a0 Switch incorrectly configured native multidex to legacy for demos
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470004102
2022-09-30 17:05:23 +00:00
rohks
8457794978 Fix missing id error
PiperOrigin-RevId: 469750922
2022-09-30 17:01:26 +00:00
hschlueter
cc1f32d094 Make GlUtil.GlException checked and remove flag to disable it.
Transformer always enabled glAssertionsEnabled, so there should
be no functional change.

ExoPlayer previously disabled glAssertionsEnabled, so GlUtil logged
GlExceptions instead of throwing them. The GlExceptions are now
caught and logged by the callers so that there should also be no
functional change overall.

This change also replaces EGLSurfaceTexture#GlException with
GlUtil#GlException.

PiperOrigin-RevId: 453963741
2022-06-09 18:47:46 +00:00
hschlueter
2e544224c2 Fix GlUtil vector size constant name.
This constant is used for https://docs.gl/es2/glVertexAttribPointer
which takes the number of components per generic vertex attribute
(meaning the size of the individual coordinate vectors here) not the
number of attributes (the number of vertices that the old constant
name referred to).

PiperOrigin-RevId: 447427241
2022-05-10 17:42:39 +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
e414f0d2ac Clean up Util.inferContentType methods
This fixes some small niggles:
1. `inferContentType(String)` is documented to take a path, but in the
   tests we're passing full URIs.
2. A `String` parameter is usually a path, but also a MIME type or an
   extension. In the new methods, the meaning of a `String` parameter
   is always clear from the name of the method.
3. `inferContentType(String)` is always passed an extension in
   'production' code (which has to be manually prefixed with a dot).
4. `inferContentType(Uri, @Nullable String)` always ignores the Uri if
   the String is non-null. IMO this logic is clearer to a reader if it's
   just in-lined at the call-site.

These methods are used from the demo apps, so will be part of the stable
API.

PiperOrigin-RevId: 444826053
2022-05-09 10:19:01 +01:00
ibaker
079e79540d Switch demo apps from HttpDataSource to DataSource
All the (Http)DataSource interactions can be done with the DataSource
interface and don't need HttpDataSource.

PiperOrigin-RevId: 436521036
2022-03-22 18:12:00 +00:00
hschlueter
682a5ca77b Clarify GlProgram parameter name.
PiperOrigin-RevId: 434441008
2022-03-14 12:52:16 +00:00
hschlueter
7507da51a0 Make GlProgram an outer class.
This change makes GlUtil.Program an outer class named GlProgram,
and also moves private static helpers as well as the inner classes
Attribute and Uniform which were only used by GlUtil.Program to
GlProgram. Other static utility methods remain in GlUtil.

No functional changes intended.

PiperOrigin-RevId: 426119299
2022-02-04 09:40:51 +00:00
olly
f28de9de60 Rewrite EventLogger to use new track APIs
PiperOrigin-RevId: 425595951
2022-02-01 14:35:06 +00:00
huangdarwin
b7f5b5fac9 GL: Update BitmapOverlayVideoProcessor naming conventions.
To be more readable and consistent with Transformer GL.

Tested by running gl-demo with no crash.

PiperOrigin-RevId: 421815519
2022-01-25 18:20:39 +00:00
huangdarwin
65adbbb745 Transformer GL: Clarify variables and comments.
Simplifying and clarifying variables, and adding comments.

Tested by confirming demo-gl and demo-transformer both
correctly display videos

PiperOrigin-RevId: 421792079
2022-01-25 18:17:15 +00:00
ibaker
bfce8f5456 Rename StyledPlayerView to PlayerView
This commit leaves some 'styled' references, specifically:
* exo_styled_XXX dimension names
* exo_styled_controls_XXX drawable IDs
* exo_styled_XXX color names
* ExoStyledControls.XXX style names

PiperOrigin-RevId: 421576554
2022-01-25 18:10:42 +00:00
ibaker
691f9c50cf Migrate usages of deprecated MediaSourceFactory methods
PiperOrigin-RevId: 417428182
2022-01-05 10:40:02 +00:00
andrewlewis
5b22b06ec4 Encapsulate attributes and uniforms within Program
Document that apps should retain `GlUtil.Program` while the program is in use,
and keep a reference to attributes/uniforms within the program to make sure
they don't get GC'd causing any allocated buffers passed to GL to become
invalid.

Tested manually by running gldemo and transformer.

PiperOrigin-RevId: 411516894
2021-11-22 17:21:14 +00:00
ibaker
b82bcdd07b Migrate the GL demo app from PlayerView to StyledPlayerView
PiperOrigin-RevId: 411006397
2021-11-19 15:14:30 +00:00
andrewlewis
d49b39bf37 Fix gldemo
The GL program needs to be used before accessing its attributes.

#minor-release

PiperOrigin-RevId: 410768017
2021-11-19 15:08:07 +00:00
ibaker
fc7b66706f Migrate GL demo from deprecated ExoPlayer.VideoComponent to ExoPlayer
#minor-release

PiperOrigin-RevId: 408304187
2021-11-09 10:10:11 +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
samrobinson
3c19850ed3 Migrate library usages of SimpleExoPlayer to ExoPlayer.
PiperOrigin-RevId: 402853522
2021-10-14 12:03:11 +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
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
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
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
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
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
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
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
aquilescanta
1c40c75433 Use a debug signature config for demo apps' release variant
PiperOrigin-RevId: 359724874
2021-03-02 17:02:55 +00:00
olly
a1f06987eb Replace non-inclusively named constant
Issue: #7565
PiperOrigin-RevId: 353649187
2021-01-25 17:38:26 +00:00
tonihei
d4e1904604 Rollback of 483a350e84
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:342788973:BASE:342817196:1605636478036:6c558c0c

***

PiperOrigin-RevId: 343895651
2020-11-24 16:02:45 +00:00
olly
483a350e84 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999390
2020-11-18 18:40:06 +00:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
ibaker
2f19b63ca0 Add package-info files to packages that only exist in tests
This doesn't affect the nullness checker or Kotlin, but it does make
weird warnings appear in Android Studio. It seems mildly preferable to
have the same spurious warnings in these files that we have in other
tests, rather than different spurious warnings.

PiperOrigin-RevId: 321173760
2020-07-24 10:34:12 +01:00