2394 Commits

Author SHA1 Message Date
sheenachhabra
f5ec1bb6f9 Move NAL unit related methods from common to container module
PiperOrigin-RevId: 532750099
(cherry picked from commit e0d6f67dd90acbe8f1c41ffd9550d18eea2ca129)
2023-05-18 16:07:51 +00:00
kimvde
6abc1a7155 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
(cherry picked from commit 028b3a73120b755733f58f8c8d9764146c470437)
2023-05-18 16:07:51 +00:00
tianyifeng
a5031a688b Avoid using @see in the summary fragment in C.java
PiperOrigin-RevId: 532536037
(cherry picked from commit 5d4c73eee55ce40548dd89265d56755b9ef169c8)
2023-05-18 16:07:51 +00:00
rohks
7773c88404 Remove deprecated WorkManagerScheduler constructor
Use a non deprecated constructor that includes the option to provide a `Context` parameter instead.

#minor-release

PiperOrigin-RevId: 532535770
(cherry picked from commit df52864420da49e97405c905c7e218e4112573df)
2023-05-18 16:07:51 +00:00
rohks
fa152ddc80 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
(cherry picked from commit 1061135cfd68dec4d2e073c1ca9e08d57b5c6875)
2023-05-18 16:07:51 +00:00
tofunmi
7fdae1ad0d Adjust image input ForPixelWidthHeightRatio
PiperOrigin-RevId: 532463400
(cherry picked from commit 63ee5ccb286727445542b11d99a455162cee49f6)
2023-05-18 16:07:51 +00:00
rohks
5a72333554 Remove deprecated DownloadService constructor
Use a non deprecated constructor that includes the option to provide a `channelDescriptionResourceId` parameter.

#minor-release

PiperOrigin-RevId: 532450975
(cherry picked from commit 022a05c376918eec0628c0eed32251882fc6f767)
2023-05-18 16:07:51 +00:00
ibaker
06c8433ce8 Remove deprecated DownloadHelper format-specific methods
Use `forMediaItem` instead.

PiperOrigin-RevId: 532414060
(cherry picked from commit 57479dd397f25fc38d4cb32cf44b63536bcdb094)
2023-05-18 16:07:51 +00:00
bachinger
1510710c46 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
(cherry picked from commit dab1353aadd4a093d29e1d418f012d42964e9d50)
2023-05-17 16:59:56 +00:00
tofunmi
43f8d080df Update mixed input test to include images of different aspect ratios
Makes this test a little more thorough.

PiperOrigin-RevId: 532386515
(cherry picked from commit 88642587ac9faa4ba0d7ea9870fa1898ef90277e)
2023-05-17 16:59:55 +00:00
huangdarwin
04a00c7ac4 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
(cherry picked from commit 62afbe87bb05890bbbb60ff4e3f0b2fd65aea433)
2023-05-17 16:59:55 +00:00
rohks
fc6429b2d4 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
(cherry picked from commit b120ef65ed6425c3193bb4d68a11ce9ac2372347)
2023-05-17 16:59:55 +00:00
tonihei
a8c56f2c60 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
(cherry picked from commit b1cfeb04a0e9a1e0f08917e621bd40968db68c01)
2023-05-17 16:59:55 +00:00
jbibik
27becc028d Allow ExoPlayer to opt into volume device control, forbidden by default
PiperOrigin-RevId: 532136692
(cherry picked from commit 1c6b894e8880480918babaf0a6f6b2038faf2e81)
2023-05-17 16:59:55 +00:00
tonihei
7f1c1185e7 Remove unnecessary warning suppression
PiperOrigin-RevId: 532114601
(cherry picked from commit 79657692e41d168c559a8a5412aa3cfd4040d80b)
2023-05-17 16:59:55 +00:00
ibaker
7ac9cf0ec7 Remove deprecated DefaultDrmSessionManager constructors
Use `DefaultDrmSessionManager.Builder` instead.

#minor-release

PiperOrigin-RevId: 532102375
(cherry picked from commit 8a5cebb54dd17e40f0d10700645659450dd7d934)
2023-05-17 16:59:55 +00:00
huangdarwin
a1fbb12ade 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
(cherry picked from commit 07ec1eaa480146942e8019a1db25661201a2f3e0)
2023-05-17 16:59:55 +00:00
tonihei
c7004d43af 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-17 16:59:55 +00:00
andrewlewis
5722e6472a 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
(cherry picked from commit 6850391e45ed571f0190643189661b0920292084)
2023-05-17 16:59:55 +00:00
ibaker
1ebf5c2a6a Delete deprecated zero-arg DefaultBandwidthMeter constructor
Use `DefaultBandwidthMeter.Builder` instead.

#minor-release

PiperOrigin-RevId: 532069549
(cherry picked from commit 8f29a5eba9d1cd67e4eef2ef6f13d91fd8846668)
2023-05-17 16:59:55 +00:00
kimvde
5e926cdce5 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
(cherry picked from commit 6dfb387117b2a12d5141014dd49fe32afcec3886)
2023-05-17 16:59:55 +00:00
andrewlewis
b0f8a8f316 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
(cherry picked from commit 857e6ebee814cb1a92875dc055dd5aff0ef07453)
2023-05-17 16:59:55 +00:00
ibaker
7e30091196 Remove two deprecated SimpleCache constructors
Use a non-deprecated constructor that takes a `DatabaseProvider`
instead for better performance.

#minor-release

PiperOrigin-RevId: 532046598
(cherry picked from commit 0a86790be25527c45b0070cd0d4a1089b2069108)
2023-05-17 16:59:55 +00:00
ibaker
07ca741eb1 Rollback of 509830f38f
*** Original commit ***

Rollback of 221a56da38

*** Original commit ***

Rollback of 749d77b1d9

*** Original commit ***

PiperOrigin-RevId: 531530885
(cherry picked from commit 9366b4e50a0dbb1d8a59940944dd732b3f3c3f9b)
2023-05-17 16:59:54 +00:00
huangdarwin
2ab9c0c556 Transformer: Add latest input format to DebugTraceUtil
This can provide more information to help debug muxer errors

PiperOrigin-RevId: 531521974
(cherry picked from commit 2736b118458c1ead0cbac2457700c1333f7c86c7)
2023-05-17 16:59:54 +00:00
bachinger
932bed1f79 Implement SystemUI contract for media resumption
When a `MediaButtonReceiver` is found in the manifest, the library
can implement the contract of SystemUI to signal that the app wants
a playback resumption notification to be displayed.

And, vice versa, if no `MediaButtonReceiver` is in the manifest, the
library will signal to not show the notification after the app has been
terminated.

#minor-release

PiperOrigin-RevId: 531516023
(cherry picked from commit 9bf6b7ea2062435970cea132c295659b48508b4e)
2023-05-17 16:59:54 +00:00
sheenachhabra
f15e5733ce Add container module
This module will contain functionalities common to extractor and muxer.

PiperOrigin-RevId: 531501602
(cherry picked from commit eb8ec87a5cbf26998ee17d9d6b1d4979ee0c28f6)
2023-05-17 16:59:54 +00:00
sheenachhabra
80aac22cf9 Add test file with metadata track
Mp4Muxer supports adding Metadata track.
Added test file to cover this scenario.

PiperOrigin-RevId: 531496409
(cherry picked from commit b3fd202e113949146f6155984665a411164da9e3)
2023-05-17 16:59:54 +00:00
sheenachhabra
2478b48997 Rollback of 925aa34e13
*** Original commit ***

Rollback of 65d5132f76

*** Original commit ***

Create InAppMuxer in transformer

To use the InAppMuxer, the client needs to pass InAppMuxer Factory.

***

***

PiperOrigin-RevId: 531470081
(cherry picked from commit 867355fdc55722a5fde9f22cd207c5fb57ba067d)
2023-05-17 16:59:54 +00:00
huangdarwin
5b683721f9 Test: Relax constraints on selected Sony devices.
Until the linked bug is fixed, relax constraints to allow this one device to
pass, to suppress failures and avoid triage toil.

PiperOrigin-RevId: 531259233
2023-05-12 10:12:37 +01:00
huangdarwin
5313763eb3 Test: Filter test more precisely, with model instead of manufacturer
PiperOrigin-RevId: 531233480
2023-05-12 10:10:15 +01:00
bachinger
1ca9e0024b Remove static MediaSessionImpl.serviceComponentName
An app must only have a single service in the manifest that is either
exposing `MediaLibraryService.SERVICE_INTERFACE` or
`MediaSessionService.SERVICE_INTERFACE`. Hence the component name found by
querying the package manager for a service never returns a different result
when queried again.

The static `MediaSessionImpl.serviceComponentName` can hence be removed
and the package manager queried again when a second session instance
is created.

#minor-release

PiperOrigin-RevId: 531210456
2023-05-12 10:08:50 +01:00
huangdarwin
674885cfa5 Test: Suppress failing 8k24 SSIM bug.
PiperOrigin-RevId: 531193242
2023-05-12 10:07:55 +01:00
christosts
dae7abbfa6 End-to-end Robolectric playback test for audio capabilities
This change adds end-to-end Robolectric playback tests which handle
the scenario the player is playing audio via passthrough and
AudioTrack raises the ERROR_DEAD_OBJECT error upon which the player
attempts to recover by switching to another audio format.

PiperOrigin-RevId: 531180183
2023-05-12 10:06:47 +01:00
tofunmi
565a013d8d Refactor ChainingGlShaderProgramListener to use FrameConsumptionManager
PiperOrigin-RevId: 531180020
2023-05-12 10:05:48 +01:00
kimvde
203450d244 Small fixes in TextureAssetLoader
The texture input tests in TransformerEndToEndTest were not passing on
Pixel 7. Implemented a fix and fixed other minor threading issues I
spotted while looking at the code.

PiperOrigin-RevId: 531141659
2023-05-11 10:07:43 +00:00
kimvde
e8072ca2c7 Move VideoFrameProcessorFactory setter to Transformer
PiperOrigin-RevId: 531123743
2023-05-11 10:06:21 +00:00
huangdarwin
82ede47398 media3: Capitalize "MIME" for MIME types.
Find and replace "mime" to "MIME", where appropriate, throughout media3.

PiperOrigin-RevId: 531122121
2023-05-11 10:05:01 +00:00
Googler
925aa34e13 Rollback of 65d5132f76
*** Original commit ***

Create InAppMuxer in transformer

To use the InAppMuxer, the client needs to pass InAppMuxer Factory.

***

PiperOrigin-RevId: 531056436
2023-05-11 10:03:35 +00:00
ibaker
17b183b11a Remove a copybara stripping tag
#minor-release

PiperOrigin-RevId: 530935437
2023-05-11 10:02:15 +00:00
tofunmi
7fea435b7e Transformer: Support Texture asset loading
PiperOrigin-RevId: 530888319
2023-05-11 10:01:00 +00:00
sheenachhabra
97b65bcf67 Refactor track specific logic in Mp4MoovStructure
PiperOrigin-RevId: 530878135
2023-05-11 09:59:35 +00:00
Googler
ecaf219d74 Adding mime type checking to Transformer to identify images.
PiperOrigin-RevId: 530711523
2023-05-11 09:58:15 +00:00
sheenachhabra
65d5132f76 Create InAppMuxer in transformer
To use the InAppMuxer, the client needs to pass InAppMuxer Factory.

PiperOrigin-RevId: 530684007
2023-05-11 09:56:46 +00:00
tofunmi
00d5031dcf Disable texture input when input is HDR
Verified by running all the tests in mh (excluding the analysis tests) on a pixel 7 pro

PiperOrigin-RevId: 530655237
2023-05-11 09:54:55 +00:00
kimvde
dc4c6daf0b Fix HDR tone mapping stuck on SM device
Tone-mapping an HDR video with MediaCodec on sm-s908u1 was timing out.
The reason for that is that the decoder was dropping frames, and the
ExternalTextureManager was therefore never propagating the end-of-stream
signal.

There was already a workaround for a similar issue but restricted to
sm-f936b. Removed the model check as the bug is probably present on more
devices.

PiperOrigin-RevId: 530639437
2023-05-11 09:53:25 +00:00
bachinger
5e4421c2ba Add MediaSession.setSessionActivity(PendingIntent)
The session activity is already sent to the controller with the
`ConnectionState` when it connects. This change adds the ability to update the
activity.

This allows an app to change the intent that is used to open an activity
for the notification. An app is likely to want to change the session activity
just before the session is released. This allows to use a different activity or
more importantly the back stack of the activity for while the app is running
and when used for the playback resumption notification.

PiperOrigin-RevId: 530627102
2023-05-11 09:52:04 +00:00
kimvde
1105f194ca Avoid swallowing exceptions when switching AssetLoader
Exceptions thrown when switching AssetLoader were not reported through
the error listener. Therefore, the resources were not released and the
export was not ending.

PiperOrigin-RevId: 530626300
2023-05-11 09:50:43 +00:00
tofunmi
7875131e2a Effect: Support input via texture ID
PiperOrigin-RevId: 530624195
2023-05-11 09:49:26 +00:00
huangdarwin
2db2de5993 Transformer: Add codec support for Dolby Vision HDR video
Allow use of H265/H264 codecs for Dolby Vision video.

Also, reflow ExoPlayer code to use this new utility class

PiperOrigin-RevId: 530619388
2023-05-11 09:47:52 +00:00