18542 Commits

Author SHA1 Message Date
jbibik
620b9e1540 Use TestUtil.getPublicMethods instead of getDeclaredMethods
JaCoCo introduces private synthetic methods (even on interfaces) which
have to be skipped when checking that a 'forwarding' implementation does
forward everything. Instead we can use the existing `getPublicMethods()`
method which implicitly skips these (since they're private).

PiperOrigin-RevId: 533130932
2023-05-19 17:08:26 +01:00
sheenachhabra
209783bdf2 Add argument validation in Mp4LocationData
PiperOrigin-RevId: 533121451
2023-05-19 17:06:27 +01:00
claincly
24a4396990 Always use sRGB/BT.709 for bitmap inputs
PiperOrigin-RevId: 533117700
2023-05-19 17:05:16 +01:00
ibaker
fe667560d0 Upgrade to Robolectric 4.10.3
We originally upgraded to 4.10 in 889f435a49

However I saw `ShadowActivityThread.reset: ActivityThread not set`
errors when running any Robolectric test, so I downgraded to 4.8.1:
85e449cd87

Nobody else on the team was seeing the same error with 4.10, so it was
something different about my local setup.

The error was actually masking a different problem (see discussion:
https://github.com/robolectric/robolectric/issues/8160). Upgrading to
4.10.1 made the underlying error clear:

```
java.lang.UnsatisfiedLinkError: /tmp/libconscrypt_openjdk_jni-linux-x86_6416831044223480000.so: libstdc++.so.6: cannot open shared object file: No such file or directory
```
This was then fixed by changing my 'Gradle JDK' value in Android Studio
from a JDK 11-based value to a 17-based one. If others see the same
`UnsatisfiedLinkError` when running the tests locally they should check
their Gradle JDK setting in Android Studio.

However there was **another** problem with 4.10 that **did** affect
everyone: some tests in `ExoPlayerTest` would fail with time outs or
assertion failures related to clock advancement.

After some investigation in https://github.com/robolectric/robolectric/issues/8187
it turns out this is because there's lots of unrelease `Player`
instances in `ExoPlayerTest`, which keep lots of active `HandlerThreads`
that then have to all be woken up by Robolectric. 4.10.3 has a fix that
mitigates this, so we can upgrade immediately - but we should also
release all the `Player` instances in `ExoPlayerTest` (it might speed
up test execution too).

PiperOrigin-RevId: 533068395
2023-05-18 12:23:03 +00:00
tofunmi
5fe10d7652 HDR texture asset loading
PiperOrigin-RevId: 532846248
2023-05-18 12:21:38 +00:00
rohks
538524e579 Remove deprecated methods Format.copyWithXXX
Use `Format.buildUpon()` and `setXXX` instead.

#minor-release

PiperOrigin-RevId: 532840625
2023-05-18 12:20:08 +00:00
sheenachhabra
410840c9e1 Add default constructor for InAppMuxer.Factory
PiperOrigin-RevId: 532838813
2023-05-18 12:18:43 +00:00
rohks
18aa664cb8 Remove deprecated methods that create an instance of Format
Use `Format.Builder` instead.

#minor-release

PiperOrigin-RevId: 532808478
2023-05-18 12:17:15 +00:00
huangdarwin
83190a0fe9 HDR: Blocklist Galaxy Z Fold 4 for HLG tone mapping.
This device failed on HdrEditingTest's exportAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows
before this CL, and succeeds on that test after this CL.

PiperOrigin-RevId: 532796897
2023-05-18 12:15:47 +00:00
Ian Baker
749c03ab76 Merge branch 'release' 2023-05-17 17:33:21 +01:00
Ian Baker
2fc189d6a4
Merge pull request #408 from androidx/release-1.0.2
1.0.2
1.0.2
2023-05-17 17:26:12 +01:00
ibaker
d77e79af49 Add main/dev-v2 branch options to bug.yml template
#minor-release

PiperOrigin-RevId: 532766676
(cherry picked from commit 84d0206c767526802aa3798dad7742ea807d5bc6)
2023-05-17 17:06:34 +01:00
ibaker
69879cd57f Add Media3 1.0.2 and ExoPlayer 2.18.7 to bug.yml template
PiperOrigin-RevId: 532765549
(cherry picked from commit 4ede3d600718969e6c62e855fcdf73805352a323)
2023-05-17 17:06:28 +01:00
sheenachhabra
7b62b33127 Move Mp4LocationData from extractor module to container module
This class will be shared between extractor and muxer module.

PiperOrigin-RevId: 532784415
2023-05-17 16:37:57 +01:00
ibaker
84d0206c76 Add main/dev-v2 branch options to bug.yml template
#minor-release

PiperOrigin-RevId: 532766676
2023-05-17 16:36:43 +01:00
ibaker
4ede3d6007 Add Media3 1.0.2 and ExoPlayer 2.18.7 to bug.yml template
#minor-release

PiperOrigin-RevId: 532765549
2023-05-17 16:35:14 +01:00
huangdarwin
94efcd7917 Effect: Make TexturePool and use in FinalWrapper.
Have the FinalShaderProgramWrapper / VideoFrameProcessor texture
output access textures provided through a texture pool, that
recycles used textures.

Also, add the TexturePool interface to generally re-use textures.

PiperOrigin-RevId: 532754377
2023-05-17 16:33:57 +01:00
sheenachhabra
e0d6f67dd9 Move NAL unit related methods from common to container module
PiperOrigin-RevId: 532750099
2023-05-17 16:32:46 +01:00
christosts
64215418f8 Add General MIDI support using Sonivox architecture
PiperOrigin-RevId: 532747428
2023-05-17 16:31:36 +01:00
kimvde
028b3a7312 Simplify FrameConsumptionManager onReadyToAcceptInputFrame logic
Propagate the "end of current stream" signal directly after queueing the
last frame, instead of waiting for the next onReadyToAcceptInputFrame()
call.

PiperOrigin-RevId: 532739462
2023-05-17 16:30:29 +01:00
Ian Baker
c48471109e Update media3 version number to 1.0.2 2023-05-17 10:15:34 +01:00
ibaker
6a7a3763f4 Update release notes for Media3 1.0.2
PiperOrigin-RevId: 532404001
(cherry picked from commit 1a38a0c41ebad512e9baab14d562f06de934177f)
2023-05-17 10:12:45 +01:00
tianyifeng
5d4c73eee5 Avoid using @see in the summary fragment in C.java
PiperOrigin-RevId: 532536037
2023-05-17 08:51:06 +01:00
rohks
df52864420 Remove deprecated WorkManagerScheduler constructor
Use a non deprecated constructor that includes the option to provide a `Context` parameter instead.

#minor-release

PiperOrigin-RevId: 532535770
2023-05-17 08:49:45 +01:00
rohks
1061135cfd Remove deprecated String constants for Charsets
Use Kotlin Charsets from the `kotlin.text` package, the `java.nio.charset.StandardCharsets` or the `com.google.common.base.Charsets` instead.

#minor-release

PiperOrigin-RevId: 532469103
2023-05-17 08:48:35 +01:00
tofunmi
63ee5ccb28 Adjust image input ForPixelWidthHeightRatio
PiperOrigin-RevId: 532463400
2023-05-17 08:45:10 +01:00
rohks
022a05c376 Remove deprecated DownloadService constructor
Use a non deprecated constructor that includes the option to provide a `channelDescriptionResourceId` parameter.

#minor-release

PiperOrigin-RevId: 532450975
2023-05-17 08:42:41 +01:00
ibaker
57479dd397 Remove deprecated DownloadHelper format-specific methods
Use `forMediaItem` instead.

PiperOrigin-RevId: 532414060
2023-05-17 08:39:20 +01:00
bachinger
dab1353aad Enable live DASH stream for IMA DAI
This change enables the IMA extension to play live DASH streams
with DAI support. Samples streams can be found and played in the
main demo app.

Issue: google/ExoPlayer#10912
#minor-release
PiperOrigin-RevId: 532407708
2023-05-17 08:38:06 +01:00
ibaker
1a38a0c41e Update release notes for Media3 1.0.2
#minor-release

PiperOrigin-RevId: 532404001
2023-05-17 08:36:50 +01:00
tofunmi
88642587ac Update mixed input test to include images of different aspect ratios
Makes this test a little more thorough.

PiperOrigin-RevId: 532386515
2023-05-17 08:35:36 +01:00
tonihei
20ba325439 Add consistency check to sending and receiving position updates
The periodic updates are only meant to happen while we are in the
same period or ad. This was already guaranteed except for two cases:
1. The Player in a session has updated its state without yet calling
   its listeners
2. The session scheduled a PlayerInfo update that hasn't been sent yet

... and in both cases, the following happened:
 - The change updated the mediaItemIndex to an index that didn't exist
   in a previous Timeline known to the Controller
 - One of the period position updates happened to be sent at exactly
   this time

This problem can be avoided by only scheduling the update if we are
still in the same period/ad and haven't scheduled a normal PlayerInfo
update already.

Since new MediaControllers may still connect to old sessons with this
bug, we need an equivalent change on the controller side to ignore such
buggy updates.

PiperOrigin-RevId: 532089328
(cherry picked from commit 96dd0ae5837a5fd82d7407623bedb5fd4d1e9252)
2023-05-16 11:05:41 +01:00
huangdarwin
62afbe87bb Test: Suppress SSIM timeouts on galaxy fold/flip.
This is a failure only in SSIM, so it seems unlikely we'll prioritize this over
other work or bugs soon. Suppress test failures to reduce triage burden.

PiperOrigin-RevId: 532200729
2023-05-16 09:59:36 +01:00
rohks
b120ef65ed Remove two deprecated InvalidResponseCodeException constructors
Use a non-deprecated constructor that accepts additional fields(`cause`, `responseBody`) to enhance error logging.

#minor-release

PiperOrigin-RevId: 532190896
2023-05-16 09:57:39 +01:00
tonihei
b1cfeb04a0 Add Player.replaceMediaItem(s)
This methods allows to replace single items or a range of items directly
without using separate operations for add and remove. The advantage is
more readable code for apps and the potential for player
implementations to optimize this process (e.g. only replace values
without interrupting playback).

The current change just introduces the API with its default behavior.
The default logic will be removed again in the future in favor of
better logic in the Player implementations.

Issue: google/ExoPlayer#8046
PiperOrigin-RevId: 532151471
2023-05-16 09:55:53 +01:00
jbibik
1c6b894e88 Allow ExoPlayer to opt into volume device control, forbidden by default
PiperOrigin-RevId: 532136692
2023-05-16 09:54:37 +01:00
tonihei
79657692e4 Remove unnecessary warning suppression
PiperOrigin-RevId: 532114601
2023-05-16 09:53:35 +01:00
ibaker
8a5cebb54d Remove deprecated DefaultDrmSessionManager constructors
Use `DefaultDrmSessionManager.Builder` instead.

#minor-release

PiperOrigin-RevId: 532102375
2023-05-16 09:52:21 +01:00
huangdarwin
07ec1eaa48 Effect: Multiple Texture output
Allow the VideoFrameProcessor to output multiple textures at a time, so that
lifetime of textures is up to the consumer calling VFP.releaseOutputFrame.

The FinalShaderProgramWrapper also has a new maxCapacity limit added, to ensure
the a reasonable amount of textures is used and avoid using up memory.

PiperOrigin-RevId: 532094256
2023-05-16 09:49:52 +01:00
tonihei
96dd0ae583 Add consistency check to sending and receiving position updates
The periodic updates are only meant to happen while we are in the
same period or ad. This was already guaranteed except for two cases:
1. The Player in a session has updated its state without yet calling
   its listeners
2. The session scheduled a PlayerInfo update that hasn't been sent yet

... and in both cases, the following happened:
 - The change updated the mediaItemIndex to an index that didn't exist
   in a previous Timeline known to the Controller
 - One of the period position updates happened to be sent at exactly
   this time

This problem can be avoided by only scheduling the update if we are
still in the same period/ad and haven't scheduled a normal PlayerInfo
update already.

Since new MediaControllers may still connect to old sessons with this
bug, we need an equivalent change on the controller side to ignore such
buggy updates.

PiperOrigin-RevId: 532089328
2023-05-16 09:48:50 +01:00
andrewlewis
6850391e45 Fix lost shader input capacity after end-of-stream
When exporting compositions with multiple images in a row, transformation could
get stuck if a shader was ready to accept input when end-of-stream was already
signaled and queued from upstream. Fix accounting for the downstream capacity.

Manually tested on concatenations with several images and several videos in a
row, by adding logging and verifying the capacity updates as expected across
edited media item transitions.

PiperOrigin-RevId: 532088793
2023-05-16 09:47:45 +01:00
ibaker
8f29a5eba9 Delete deprecated zero-arg DefaultBandwidthMeter constructor
Use `DefaultBandwidthMeter.Builder` instead.

#minor-release

PiperOrigin-RevId: 532069549
2023-05-16 09:46:43 +01:00
kimvde
6dfb387117 Refactor SequenceAssetLoader release
In the past, the SequenceAssetLoader was released in TransformerInternal
when the export ended.

fc539da061 was made to release the SequenceAssetLoader earlier, when
loading ended. This was causing player release timeouts because the last
AssetLoader in the sequence was released before the SamplePipelines (see
0b40bc37ab for more information).

The code that was releasing the SequenceAssetLoader was first commented
out because we didn't have an understanding of what was happening.

This change removes the early SequenceAssetLoader release all together.
It doesn't have any effect as this code was already commented out.

PiperOrigin-RevId: 532065673
2023-05-16 09:43:36 +01:00
andrewlewis
857e6ebee8 Signal end-of-stream after creating latch
The output end-of-stream notification from the last shader could theoretically
arrive before the latch for detecting it is created, which might cause waiting
on the latch indefinitely. Create the latch before signaling end of stream so
that it's guaranteed to be set before the end-of-stream signal arrives.

PiperOrigin-RevId: 532056472
2023-05-16 09:42:25 +01:00
ibaker
0a86790be2 Remove two deprecated SimpleCache constructors
Use a non-deprecated constructor that takes a `DatabaseProvider`
instead for better performance.

#minor-release

PiperOrigin-RevId: 532046598
2023-05-16 09:41:12 +01:00
ibaker
0888dfbd05 Update the root project name check in publish.gradle
The name was changed in 25581384e9
and this check wasn't updated, meaning publishing no longer worked
(it didn't publish anything, just printed lots of warnings like
`Skipping task ':test-utils-robolectric:publish' as it has no
actions.`). This change means the check is now using the same
source-of-truth as the root project name, so it shouldn't go out of
sync again.

PiperOrigin-RevId: 531457952
(cherry picked from commit 4c1eb8aec7258324134913db521cd0a005ece31b)
2023-05-15 16:33:18 +01:00
ibaker
f71370af75 Remove a copybara stripping tag
#minor-release

PiperOrigin-RevId: 530935437
(cherry picked from commit 17b183b11a3499ce0f86b53b9d60b66ba71f73cc)
2023-05-15 16:32:39 +01:00
ibaker
a098f8672e Add tests for MediaLibraryInfo version code consistency
`VERSION_INT` is quite long with several sections, and it's easy to make
a mistake when updating it - this should help since it checks it against
`VERSION`, which is more easily human readable/writable.

PiperOrigin-RevId: 529747023
(cherry picked from commit eb58d20067b258746f72127a601dd5ee40ce9c25)
2023-05-15 16:32:39 +01:00
bachinger
3064bc9b37 Fix value type when unbundling LibraryResult without expected type
Calling LibraryResult.toBundle() could have caused a CastClassException.
This was because when unbundled with UNKNOWN_TYPE_CREATOR.fromBundle(Bundle),
the valueType was set to VALUE_TYPE_ITEM_LIST for all types and the MediaItem
was attempted to be casted to a list.

PiperOrigin-RevId: 529717688
(cherry picked from commit f28a5888091c5caa685117d7a6653ae6c5a29f26)
2023-05-15 16:32:38 +01:00
ibaker
13191edd90 Javadoc tweaks for MediaSession.MediaItemsWithPosition
Also change some type parameter names in `MediaSession.BuilderBase`
because `C` now clashes with the import of `androidx.media3.common.C`.

#minor-release

PiperOrigin-RevId: 529665698
(cherry picked from commit 78f20257bd9b1cdebea3f2968cb946046b1e34d8)
2023-05-15 16:32:38 +01:00