1057 Commits

Author SHA1 Message Date
Marc Baechinger
1c373d5159 Merge pull request #10322 from DolbyLaboratories:dev-v2-multichannel
PiperOrigin-RevId: 454641746
2022-06-14 17:22:39 +00:00
olly
d2f5f212b9 Suppress an ExtendsObjects violation
to support enabling this as a compile-time error.

More information: go/lsc-extends-object

PiperOrigin-RevId: 454582570
2022-06-14 17:19:09 +00:00
olly
a90d5230e2 Fix permissions request for media provider content URIs
We need to request the external storage permission to access these

PiperOrigin-RevId: 454160546
2022-06-13 11:30:27 +00:00
hschlueter
92c2a304e1 Combine all native GL errors in a GlException instead of logging.
The native GL errors are in an arbitrary order according to
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetError.xml
This means any of them could contain the most useful message
so it's better to use all for the GlException's message rather than
picking the last message and logging all others.

PiperOrigin-RevId: 454130460
2022-06-13 11:27:13 +00:00
olly
996f94754d Fix permissions request for media provider content URIs
We need to request the external storage permission to access these

PiperOrigin-RevId: 454160546
(cherry picked from commit a90d5230e2856d08d1f7275b3d7244ed03fec466)
2022-06-10 14:29:55 +00:00
hschlueter
dc668f2b59 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:37:29 +00:00
tonihei
2056152824 Add COMMAND_SET_MEDIA_ITEM to Player.Commands
Some Player implementations have no playlist capability but can still
set a MediaItem for playback. Examples are a MediaController connected
to a legacy MediaSession, ExoPlayer up to 2.12 or MediaPlayer.

To indicate this capability, we need an allowed command in addition
to COMMAND_CHANGE_MEDIA_ITEMS that just allows to set a single item
that replaces everything that is currently played.

#minor-release

PiperOrigin-RevId: 453879626
2022-06-09 17:11:12 +00:00
hschlueter
0b37d860d1 Implement default GlTextureProcessor in SingleFrameGlTextureProcessor.
SingleFrameGlTextureProcessor is now an abstract class containing a
default implementation of the more flexible GlTextureProcessor interface
while still exposing the same simple abstract methods for single frame
processing it previously did.

FrameProcessorChain and GlEffect will be changed to use
GlTextureProcessor in follow-ups.

PiperOrigin-RevId: 453633000
2022-06-09 16:56:11 +00:00
ybai001
ea8f6a1fe9 Add decoder 7.1.4 output channel support
Since Android 12L, Android adds spatialization support. Decoder will output 7.1.4ch PCM to get better immersive experience, e.g. Dolby DD+JOC decoder.
2022-06-08 11:08:10 +08:00
bachinger
3dcc24ef2e Version bump to exoplayer:2.18.0 and media3:1.0.0-beta01
#minor-release

PiperOrigin-RevId: 455350486
(cherry picked from commit 209d3085b710665d5659aaedd2290866f4561f7a)
2022-06-16 11:41:28 +00:00
Marc Baechinger
a785fbe014 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
(cherry picked from commit 1ca382d138b30ecebe3d1ceab2442e0e53bdd388)
2022-06-15 16:51:04 +00:00
bachinger
4739e4d2f1 Add lint base to make gradle lint run without errors
PiperOrigin-RevId: 454951844
(cherry picked from commit 8b65c6a0aa5fe9e9e797633b47f0d6dfd6a44cd1)
2022-06-15 16:51:04 +00:00
Marc Baechinger
941c5d84b0 Merge pull request #10322 from DolbyLaboratories:dev-v2-multichannel
PiperOrigin-RevId: 454641746
(cherry picked from commit 1c373d515991f5aef15d75f6a6de80492fe14d70)
2022-06-14 17:42:21 +00:00
tonihei
c1aff0dc8f Add COMMAND_SET_MEDIA_ITEM to Player.Commands
Some Player implementations have no playlist capability but can still
set a MediaItem for playback. Examples are a MediaController connected
to a legacy MediaSession, ExoPlayer up to 2.12 or MediaPlayer.

To indicate this capability, we need an allowed command in addition
to COMMAND_CHANGE_MEDIA_ITEMS that just allows to set a single item
that replaces everything that is currently played.

#minor-release

PiperOrigin-RevId: 453879626
(cherry picked from commit 2056152824512bcd8f2f09b2f7c1a752e913feac)
2022-06-09 18:08:16 +00:00
ibaker
5030145c8f 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 a056f08a3d06992ee59e596c80d13a7cc628a12a)
2022-06-07 17:54:38 +00:00
ibaker
dd27a9a8df 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 881622385d073c816663dc24079b0a6f68ed06c5)
2022-06-07 17:54:38 +00:00
ibaker
c107b94941 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 97210b5aa08ba662a33e9f2f91620ec80fe51902)
2022-06-07 17:54:38 +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
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
ibaker
b0a9b9017e Add some imports required for javadoc
#minor-release

PiperOrigin-RevId: 452002758
(cherry picked from commit f76baaee77035c6aa5ab6315c3e8263f2f082c12)
2022-05-31 13:50:40 +00:00
ibaker
30bed6cdc5 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 d711dee003c9f7d8a3f31031b35a4121d0db6f09)
2022-05-31 13:50:40 +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
tonihei
8e015c4f91 Remove MediaMetadata.mediaUrl
This value only existed to allow setting media URLs from external sources
(e.g. in a MediaController) so that a player can start playing this item.
Now that we have MediaItem.RequestMetadata.mediaUrl we can remove this value
from MediaMetadata because it's request metadata, not media metadata.

PiperOrigin-RevId: 451857413
2022-05-30 17:54:00 +00:00
tonihei
38248af5cf Add RequestMetadata to MediaItem
These fields can be used to transport additional request properties
when the requester doesn't know the details needed for the actual
playback (i.e. the LocalConfiguration).

PiperOrigin-RevId: 451857093
2022-05-30 17:50:30 +00:00
ibaker
6dd065a128 Wrap framework AudioAttributes in new AudioAttributesV21 class
PiperOrigin-RevId: 451831531
2022-05-30 17:43:36 +00:00
hschlueter
bc1ec9de1f Replace frame processor with texture processor in TODO comment.
PiperOrigin-RevId: 451142799
2022-05-30 17:04:38 +00:00
ibaker
53b44524cd Fix typos flagged by lint
PiperOrigin-RevId: 451135097
2022-05-26 13:11:16 +00:00
ibaker
b8769b2717 Fix some inconsistencies in the MediaItem API
* Rename (via deprecation)
  `MediaItem.DrmConfiguration.Builder#forceSessionsForAudioAndVideoTracks`
  to `setForceSessionsForAudioAndVideoTracks`. This is more consistent
  with existing 'force' method names both in this class and in
  `TrackSelectionParameters.Builder`.
* Add missing `@Nullable` annotation to the parameter for
  `MediaItem.SubtitleConfiguration.Builder#setMimeType`. This annotation
  is already present on the `MediaItem.SubtitleConfiguration#mimeType`
  field that this setter corresponds to.

PiperOrigin-RevId: 450941336
2022-05-26 13:07:37 +00:00
ibaker
74653838ad Make Rating.RATING_UNSET package-private
This value is only needed by subclasses of `Rating`, all of which are
in this package (the `Rating` constructor is already package-private to
ensure this).

PiperOrigin-RevId: 450886872
2022-05-26 12:56:51 +00:00
tonihei
9c5bc56df1 Wrap TelephonyCallback in nested class to avoid class loading issues.
PiperOrigin-RevId: 450643824
2022-05-26 12:46:13 +00:00
tonihei
48a0301bf5 Remove 5G-NSA detection on API 29/30.
This detection relies on an unsupported workaround and may trigger
permission warnings in tools analyzing permission usage although
no permission is needed or requested by app code.

Given the majority of 5G-NSA playbacks are on API 31+ by now,
we can remove this path to avoid the permission confusion and the
unsupported detection workaround.

PiperOrigin-RevId: 450382586
2022-05-24 12:13:33 +01:00
ibaker
aef2f154a7 Remove all null-tolerant methods from BundleableUtil.
In most cases it's clearer to in-line these null-checks with ternary
operators.

PiperOrigin-RevId: 449474621
2022-05-24 11:44:55 +01:00
rohks
a27b5398a8 Create new class to store cues and timestamp.
We need to pass timestamp for the list of cues so we are defining a new class CueGroup which will store both cues and timestamp.

PiperOrigin-RevId: 449212054
2022-05-24 11:27:01 +01:00
tonihei
463603049e Add replacement for deprecated network type override constant
The MMWAVE constant was deprecated in favour of a new constant
with a better name. Thus, we need to check for both constants now.

PiperOrigin-RevId: 449018959
2022-05-24 11:16:39 +01:00
tonihei
daa4c1c0a6 Add language normalization for "arb" (Standard Arabic)
This is an individual language (ISO 639-3) part of the Arabic
macrolanguage ("ar" in ISO 639-1). Add this mapping to our
existing list similar to other individual to macrolanguage
mappings we have already.

Issue: Issue: google/ExoPlayer#10255
PiperOrigin-RevId: 448911950
2022-05-24 11:09:21 +01:00
hschlueter
df1b733d50 Combine multiple matrix transformations in one shader.
When using a MatrixTransformationFrameProcessor per transformation
matrix, each frame processor's shader applies the matrix to the
vertices and clips the result to the NDC range when drawing the
output frame.
This change combines consecutive MatrixTransformations into a single
MatrixTransformationFrameProcessor by multiplying the individual
matrices while updating and clipping the visible polygon after
each matrix and mapping the resulting visible polygon back to the
input space so that its vertices and the combined transformation
matrix can be used in the shader.

PiperOrigin-RevId: 448521068
2022-05-24 11:05:59 +01:00
hmzh
dce0db35f1 Refactor MIDI and Flac extractor loaders for deduplication
Add MIDI filetype information for use in the ExtractorsFactory

PiperOrigin-RevId: 447976272
2022-05-24 10:37:39 +01:00
sr1990
cfd13ce6d9 [DASH][ClearKey] Parse ClearKey license URL in MPD. 2022-05-14 11:25:32 -07:00
hschlueter
f08fdf6ab2 Add listener for FrameProcessingExceptions.
This listener replaces
FrameProcessorChain#getAndRethrowBackgroundExceptions.
The listener uses a new exception type FrameProcessingException
separate from TransformationException as the frame processing
components will be made reusable outside of transformer soon.

PiperOrigin-RevId: 447455746
2022-05-09 14:46:53 +01:00
hschlueter
e89189e35f 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 18:02:20 +01:00
huangdarwin
3730c1e4d4 GL: Update exoplayer to use bindTexture.
Refactoring change only.

PiperOrigin-RevId: 446475708
2022-05-04 17:20:41 +01:00
ibaker
8bb11f3f2b Migrate usages of the deprecated TrackSelectionParameters.CREATOR
PiperOrigin-RevId: 446400192
2022-05-04 10:13:35 +01:00
christosts
3830d02590 Use Android 12L APIs directly
Some APIs from Android 12L were used either via reflection or
constants values were hard-coded. We can now use these APIs directly
since we upgraded the compile SDK version to 32.

PiperOrigin-RevId: 446167543
2022-05-03 13:10:04 +01:00
ibaker
33b049c104 Allow stable API users to bundle/unbundle TrackSelectionParameters
It's reasonable to serialize this type to support backgrounding
use-cases, as demonstrated by the main demo app.

PiperOrigin-RevId: 446161300
2022-05-09 12:03:58 +01:00
ibaker
1809a0b9f9 Migrate usages from C.TYPE_* to C.CONTENT_TYPE_*
PiperOrigin-RevId: 446156308
2022-05-09 12:00:38 +01:00
olly
ad25c2a8c3 Add MIDI mime types to decoder_midi and api.txt
PiperOrigin-RevId: 445445952
2022-05-09 11:47:28 +01:00
ibaker
a433163b51 Prefix @ContentType values with CONTENT_
PiperOrigin-RevId: 445356625
2022-05-09 11:17:50 +01:00
ibaker
07d08ba85b Rename CONTENT_TYPE_ @AudioContentType values to AUDIO_CONTENT_TYPE_*
This is consistent with the IntDef name, and frees up the CONTENT_TYPE_
prefix for the @ContentType values (which are currently just TYPE_*,
and therefore ambiguous with lots of other 'type' values in C).

PiperOrigin-RevId: 445356476
2022-05-09 11:14:41 +01:00