14979 Commits

Author SHA1 Message Date
ybai001
867b107835
Merge pull request #24 from google/dev-v2
Dev v2
2022-06-08 08:32:43 +08:00
christosts
2ed7efb1c3 Minor fix: remove final from methods of final class
#minor-release

PiperOrigin-RevId: 453408087
(cherry picked from commit 62497f23fd8f92de304e7a87ffa839e221bd78c6)
2022-06-07 17:54:55 +00:00
ibaker
240379cc02 Use a shared keyForField implementation in track selection parameters
The current setup with distinct, private `keyForField` implementations,
leaves open the (theoretical) possibility of a clash in the `Bundle`
keys used by the superclass and subclass. This change brings
consistency with our only other extensible `Bundleable` type
(`PlaybackException`).

#minor-release

PiperOrigin-RevId: 453385875
(cherry picked from commit 814e43dbb9432e3adf6c4c278df50433260a461b)
2022-06-07 17:54:55 +00:00
ibaker
c22cd44900 Fix release notes formatting
#minor-release

PiperOrigin-RevId: 453384451
(cherry picked from commit 14ea2e4c5146ed57d51fe4a69f6b29a9f3954115)
2022-06-07 17:54:55 +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
bachinger
216d971518 Filter bogus AndroidX Media jar file when creating javadoc
#minor-release

PiperOrigin-RevId: 452282128
(cherry picked from commit bd9bc0f6b7349cf2c1477a6d7e3146555c3ead86)
2022-06-07 17:54:55 +00:00
ibaker
501ea8c563 Fix HiddenTypedefConstant Metalava error on PlaybackException
This is done by removing the `@FieldNumber` IntDef completely. It's not
really adding much value anyway, because it's `open` so there's no real
enforcement to prevent passing 'incorrect' values.

#minor-release

PiperOrigin-RevId: 452108972
(cherry picked from commit 39674bec78d45baa550df6807e4d49faf42dc25a)
2022-06-07 17:54:55 +00:00
christosts
62497f23fd Minor fix: remove final from methods of final class
#minor-release

PiperOrigin-RevId: 453408087
2022-06-07 16:31:58 +00:00
ibaker
814e43dbb9 Use a shared keyForField implementation in track selection parameters
The current setup with distinct, private `keyForField` implementations,
leaves open the (theoretical) possibility of a clash in the `Bundle`
keys used by the superclass and subclass. This change brings
consistency with our only other extensible `Bundleable` type
(`PlaybackException`).

#minor-release

PiperOrigin-RevId: 453385875
2022-06-07 16:31:09 +00:00
ibaker
14ea2e4c51 Fix release notes formatting
#minor-release

PiperOrigin-RevId: 453384451
2022-06-07 16:30:21 +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
christosts
8d326312fb Ignore flaky test
PiperOrigin-RevId: 453168843
2022-06-07 16:28:11 +00:00
christosts
34ca3bc3c3 De-flake test in MediaSessionPermissionTest
This change makes MediaSessionPermissionTest.removeMediaItems()
non-flaky. This is a quick fix though it'd be good to refactor this
test file.

PiperOrigin-RevId: 453162764
2022-06-07 16:27:21 +00:00
hschlueter
63436390de Add interface for async texture processors.
Implementations of this interface will be able to drop or add frames,
change timestamps, accept multiple input frames before producing
output, and process frames on their own background thread.

A default implementation of this interface will be added to SingleFrameGlTextureProcessor in a follow-up.

PiperOrigin-RevId: 453159835
2022-06-07 16:26:26 +00:00
bachinger
bd9bc0f6b7 Filter bogus AndroidX Media jar file when creating javadoc
#minor-release

PiperOrigin-RevId: 452282128
2022-06-07 16:25:35 +00:00
ibaker
39674bec78 Fix HiddenTypedefConstant Metalava error on PlaybackException
This is done by removing the `@FieldNumber` IntDef completely. It's not
really adding much value anyway, because it's `open` so there's no real
enforcement to prevent passing 'incorrect' values.

#minor-release

PiperOrigin-RevId: 452108972
2022-06-07 16:24:35 +00:00
hschlueter
35b5147eb1 Add async error listener to transformer to avoid exception wrapping.
This internal listener avoids wrapping the TransformationExceptions
in PlaybackExceptions that are handled via the Player.Listener and
is also used for FrameProcessingExceptions which already avoided
the PlaybackException layer previously.

This listener will also be useful in follow-ups for encoder-related
TransformationExceptions that are thrown in the SurfaceProvider that
will be called on the GL thread.

PiperOrigin-RevId: 452074575
2022-06-07 16:23:22 +00:00
ibaker
a056f08a3d Use a shared keyForField implementation in track selection parameters
The current setup with distinct, private `keyForField` implementations,
leaves open the (theoretical) possibility of a clash in the `Bundle`
keys used by the superclass and subclass. This change brings
consistency with our only other extensible `Bundleable` type
(`PlaybackException`).

#minor-release

PiperOrigin-RevId: 453385875
2022-06-07 10:44:26 +00:00
ibaker
881622385d 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 10:41:18 +00:00
hschlueter
023d19c8c5 Add interface for async texture processors.
Implementations of this interface will be able to drop or add frames,
change timestamps, accept multiple input frames before producing
output, and process frames on their own background thread.

A default implementation of this interface will be added to SingleFrameGlTextureProcessor in a follow-up.

PiperOrigin-RevId: 453159835
2022-06-07 10:37:40 +00:00
bachinger
2441bc6990 Filter bogus AndroidX Media jar file when creating javadoc
#minor-release

PiperOrigin-RevId: 452282128
2022-06-07 10:34:30 +00:00
ibaker
97210b5aa0 Fix HiddenTypedefConstant Metalava error on PlaybackException
This is done by removing the `@FieldNumber` IntDef completely. It's not
really adding much value anyway, because it's `open` so there's no real
enforcement to prevent passing 'incorrect' values.

#minor-release

PiperOrigin-RevId: 452108972
2022-06-07 10:31:15 +00:00
hschlueter
960422e36f Add async error listener to transformer to avoid exception wrapping.
This internal listener avoids wrapping the TransformationExceptions
in PlaybackExceptions that are handled via the Player.Listener and
is also used for FrameProcessingExceptions which already avoided
the PlaybackException layer previously.

This listener will also be useful in follow-ups for encoder-related
TransformationExceptions that are thrown in the SurfaceProvider that
will be called on the GL thread.

PiperOrigin-RevId: 452074575
2022-06-07 10:27:55 +00:00
bachinger
706e60346d Ignore decoding test cases when library not available
#minor-release

PiperOrigin-RevId: 452043577
(cherry picked from commit 55a194c575ba40dc0e156815f07ec854dc85bd3d)
2022-05-31 15:33:33 +00:00
bachinger
55a194c575 Ignore decoding test cases when library not available
#minor-release

PiperOrigin-RevId: 452043577
2022-05-31 15:00:28 +00:00
bachinger
c3866449e2 Ignore decoding test cases when library not available
#minor-release

PiperOrigin-RevId: 452043577
2022-05-31 14:46:02 +00:00
andrewlewis
9cd84696c7 Create withMediaPipe variant only if AAR is present
This should fix running `./gradlew clean test` if MediaPipe hasn't been built, for example.

PiperOrigin-RevId: 452033698
(cherry picked from commit 208a9114a9f516f7034b75b4f21f9ded34de8501)
2022-05-31 14:07:20 +00:00
ibaker
f6f4bf5e6b Permit duplicate Opus headers
This reinstates the permissive behaviour removed by
fe7e5b8181

Test file created by opening bear.opus in a hex editor and naively
duplicating the two header packets, starting at (and including) the
first `OggS` in the file and ending just before the third `OggS`.

#minor-release

Issue: google/ExoPlayer#10038
PiperOrigin-RevId: 452015662
(cherry picked from commit 1282175808210f0496a4b18ae4e02312dbdf4553)
2022-05-31 14:07:20 +00:00
andrewlewis
14ed32c68f Create withMediaPipe variant only if AAR is present
This should fix running `./gradlew clean test` if MediaPipe hasn't been built, for example.

PiperOrigin-RevId: 452033698
2022-05-31 14:04:44 +00:00
ibaker
b6b282672c Permit duplicate Opus headers
This reinstates the permissive behaviour removed by
fe7e5b8181

Test file created by opening bear.opus in a hex editor and naively
duplicating the two header packets, starting at (and including) the
first `OggS` in the file and ending just before the third `OggS`.

#minor-release

Issue: google/ExoPlayer#10038
PiperOrigin-RevId: 452015662
2022-05-31 14:00:59 +00:00
andrewlewis
208a9114a9 Create withMediaPipe variant only if AAR is present
This should fix running `./gradlew clean test` if MediaPipe hasn't been built, for example.

PiperOrigin-RevId: 452033698
2022-05-31 13:55:58 +00:00
ibaker
1282175808 Permit duplicate Opus headers
This reinstates the permissive behaviour removed by
fe7e5b8181

Test file created by opening bear.opus in a hex editor and naively
duplicating the two header packets, starting at (and including) the
first `OggS` in the file and ending just before the third `OggS`.

#minor-release

Issue: google/ExoPlayer#10038
PiperOrigin-RevId: 452015662
2022-05-31 13:55:14 +00:00
bachinger
7671e50d71 Remove deprecated calls
#minor-release

PiperOrigin-RevId: 452006137
(cherry picked from commit acb48a249564c5793cfadbee262e2eed29dea528)
2022-05-31 13:51:49 +00:00
bachinger
ad5788ef37 Use resource ID from drawable.xml as the notification icon
Issue: androidx/media#66
Issue: androidx/media#65

#minor-release

PiperOrigin-RevId: 452004492
(cherry picked from commit 839d4f43906f99002e3be71cdb7f90efb231754a)
2022-05-31 13:51:49 +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
bachinger
00ae09f459 Add explicit cast to ByteBuffer for Java 8 compatibility
PiperOrigin-RevId: 451994696
(cherry picked from commit 5cdac6575e662bf575b4890f17b600e7b17bffac)
2022-05-31 13:51:49 +00:00
bachinger
5460ac8e60 Remove deprecated calls
#minor-release

PiperOrigin-RevId: 452006137
2022-05-31 11:13:33 +00:00
ibaker
f76baaee77 Add some imports required for javadoc
#minor-release

PiperOrigin-RevId: 452002758
2022-05-31 11:09:58 +00:00
ibaker
d711dee003 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 11:06:26 +00:00
hschlueter
54d44d38b6 Move program initialization to texture processor constructor.
Once the more advanced GlTextureProcessor interface exists,
it will be possible to change the output size of a GlTextureProcessor
between frames. To keep the re-configuration based on the frame sizes
minimal, things indepedent of the frame size, such as the GlProgram,
can be initialized in the constructor.

PiperOrigin-RevId: 451997584
2022-05-31 11:02:40 +00:00
bachinger
1c5032e1a9 Add explicit cast to ByteBuffer for Java 8 compatibility
PiperOrigin-RevId: 451994696
2022-05-31 10:59:14 +00:00
bachinger
acb48a2495 Remove deprecated calls
#minor-release

PiperOrigin-RevId: 452006137
2022-05-31 10:47:30 +00:00
bachinger
839d4f4390 Use resource ID from drawable.xml as the notification icon
Issue: androidx/media#66
Issue: androidx/media#65

#minor-release

PiperOrigin-RevId: 452004492
2022-05-31 10:46:41 +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
hschlueter
87ab96d352 Move program initialization to texture processor constructor.
Once the more advanced GlTextureProcessor interface exists,
it will be possible to change the output size of a GlTextureProcessor
between frames. To keep the re-configuration based on the frame sizes
minimal, things indepedent of the frame size, such as the GlProgram,
can be initialized in the constructor.

PiperOrigin-RevId: 451997584
2022-05-31 10:43:47 +00:00
bachinger
5cdac6575e Add explicit cast to ByteBuffer for Java 8 compatibility
PiperOrigin-RevId: 451994696
2022-05-31 10:43:00 +00:00
ibaker
711409ab51 Update the Gradle Wrapper and Android Gradle Plugin
The current verion of AGP warns it doesn't support Android API 32 [1].

The wrapper was upgraded with ([instructions](https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper)):
```shell
$ ./gradlew wrapper --gradle-version 7.4.2 --distribution-type all
```

[1]
```
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 32

This Android Gradle plugin (7.0.3) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=32
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 32
```

#minor-release

PiperOrigin-RevId: 451893214
(cherry picked from commit 3ba9d7e125482aae236f2e9e60de7f8535d9f162)
2022-05-30 20:53:20 +00:00
ibaker
7fc9bb9c50 Update the Gradle Wrapper and Android Gradle Plugin
The current verion of AGP warns it doesn't support Android API 32 [1].

The wrapper was upgraded with ([instructions](https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper)):
```shell
$ ./gradlew wrapper --gradle-version 7.4.2 --distribution-type all
```

[1]
```
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 32

This Android Gradle plugin (7.0.3) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=32
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 32
```

#minor-release

PiperOrigin-RevId: 451893214
2022-05-30 20:42:51 +00:00
ibaker
3ba9d7e125 Update the Gradle Wrapper and Android Gradle Plugin
The current verion of AGP warns it doesn't support Android API 32 [1].

The wrapper was upgraded with ([instructions](https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper)):
```shell
$ ./gradlew wrapper --gradle-version 7.4.2 --distribution-type all
```

[1]
```
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 32

This Android Gradle plugin (7.0.3) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=32
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 32
```

#minor-release

PiperOrigin-RevId: 451893214
2022-05-30 20:37:12 +00:00
aquilescanta
d1c3b05145 Use fluent assertions
Gives a bit more information upon failures

PiperOrigin-RevId: 451882968
2022-05-30 18:01:02 +00:00