2467 Commits

Author SHA1 Message Date
sheenachhabra
b3fd202e11 Add test file with metadata track
Mp4Muxer supports adding Metadata track.
Added test file to cover this scenario.

PiperOrigin-RevId: 531496409
2023-05-15 10:36:17 +01:00
sheenachhabra
867355fdc5 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
2023-05-12 13:20:31 +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
kimvde
129a6e0cc6 Fix encoder expecting HDR while tone-mapping requested
If tone-mapping was requested for a device supporting HDR encoding,
isToneMapped was false in VideoSamplePipeline.EncoderWrapper. This was
causing the encoder to expect HDR.

Also did some renamings to improve readability

PiperOrigin-RevId: 530584010
2023-05-11 09:45:09 +00:00
tofunmi
b1ebd0e2a6 Change order of operations in videoSamplePipeline
similar error to 9baa6f6be5L `registerInputStream` sets the textureManager, so reordering makes sure the textureManager is set before you set the frame info. This is important for texture input, where the frame info provides the width and height.

PiperOrigin-RevId: 530579584
2023-05-11 09:43:40 +00:00
tofunmi
477994461d Image transcoding: Add support for heic/heif image formats
PiperOrigin-RevId: 530578549
2023-05-11 09:42:12 +00:00
tonihei
99dac0be0f Ensure behavior of add/setMediaItems is consistent on empty playlist
Adding items to an empty playlist is slightly different from adding
items to a non-empty playlist, because the former usually requires to
handle a change in the current item, position and playback state,
while the latter is not expected to affect the current item, position
or state.

The current ExoPlayer and SimpleBasePlayer code doesn't account for
this difference, leading to inconsistent behavior between
setMediaItem(s) and addMediaItem(s) when called on an empty playlist.

PiperOrigin-RevId: 530549928
2023-05-11 09:40:47 +00:00
andrewlewis
f0ff57882a Remove stray stuck debug logging line
PiperOrigin-RevId: 530314222
2023-05-11 09:39:17 +00:00
tofunmi
9baa6f6be5 Fix operations order in RenderingTest
For DefaultVideoFrameProcessorVideoFrameRenderingTest: `registerInputStream` sets the textureManager, so reordering makes sure the textureManager is set before you set the frame info. This is important for texture input, where the frame info provides the width and height.

PiperOrigin-RevId: 529753404
2023-05-08 15:20:14 +00:00
ibaker
eb58d20067 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
2023-05-08 15:18:59 +00:00
tofunmi
8c5e1974f2 Version bump to media3:1.1.0-alpha01
#minor-release

PiperOrigin-RevId: 529735598
2023-05-05 17:00:08 +00:00
huangdarwin
38d3fb5382 HDR: Don't register unsupported HDR bitmap input.
Minimal fix for HDR test postsubmit breakage

PiperOrigin-RevId: 529734521
2023-05-05 16:58:34 +00:00
bachinger
f28a588809 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
2023-05-05 16:57:22 +00:00
kimvde
30957df635 Remove B-frame setting from DefaultEncoderFactory
This setting is buggy on some devices (for example sm-n960f)

PiperOrigin-RevId: 529712770
2023-05-05 16:54:27 +00:00
bachinger
511b1358cd Downgrade IMA SDK to 3.29.0
#minor-release

PiperOrigin-RevId: 529710928
2023-05-05 16:53:06 +00:00
michaelkatz
b69b3423c3 Use provided Format in shouldUseBypass check
#minor-release

PiperOrigin-RevId: 529708020
2023-05-05 16:51:27 +00:00
sheenachhabra
954b694b42 Improve documentation for metadataSampleEntry method
PiperOrigin-RevId: 529693415
2023-05-05 16:49:39 +00:00
claincly
c2da310718 Remove unused variables in DVFP.
PiperOrigin-RevId: 529685584
2023-05-05 16:48:28 +00:00
ibaker
78f20257bd 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
2023-05-05 16:46:48 +00:00
claincly
83b5f824f8 Add a tracing utility for debugging video related muxer timeout
PiperOrigin-RevId: 529632886
2023-05-05 16:45:38 +00:00
claincly
213740c456 Enable switching input types via InputMultiplexer.
PiperOrigin-RevId: 529624205
2023-05-05 16:43:58 +00:00
bachinger
e48dec5f2c Add MediaButtonReceiver for Media3
The media button has API support with
`Callback.getPlaybackResumption()` that apps need to override to provide
a playlist to resume playback with.

Issue: androidx/media#167
PiperOrigin-RevId: 529495845
2023-05-05 16:42:44 +00:00
huangdarwin
93e3fe418e Effect: Fix concurrent access null pointer exception
A list was being accessed from one thread when it wasn't guaranteed to be empty.

PiperOrigin-RevId: 529102141
2023-05-03 17:16:06 +01:00
tofunmi
bba760f6e5 Update translations
PiperOrigin-RevId: 529069808
2023-05-03 17:15:08 +01:00
tianyifeng
480ff93f85 Reselect track when renderer capabilities change
* Implement RendererCapabilities.Listener in DefaultTrackSelector.
* Add new methods TrackSelector.invalidateForRendererCapabilitiesChange and TrackSelector.InvalidateListener.onRendererCapabilitiesChanged.
* Add new field allowInvalidateSelectionsOnRendererCapabilitiesChange to DefaultTrackSelector.Parameter to allow opt-in of the renderer capabilities detection feature.
* Add logics of triggering track reselection when renderer capabilities change.

PiperOrigin-RevId: 529067433
2023-05-03 17:14:09 +01:00
bachinger
eac26b1838 Fix type annotation of MockPlayer.notifyPlayWhenReadyChanged
PiperOrigin-RevId: 529030412
2023-05-03 17:13:19 +01:00
tofunmi
3011a29940 Update InternetConnection check to skip check when uri scheme is null
When we created androidTests, in the past, they always had a URI pointing to a resource, therefore we always had a URI scheme. With texture input, this will not longer be the case (EditedMediaItems's may have URI.EMPTY, which have a null scheme) so we need to check for this so tests don't falsely fail.

PiperOrigin-RevId: 528848411
2023-05-03 17:12:29 +01:00
sheenachhabra
d5fc9e9627 Skip writing 0 sized samples in Mp4Muxer
The existing logic to drop (actually fail on) 0 sized samples seems no op if
if 2 out of 10 samples are of size 0.

Checked same scenario with MediaMuxer where
1. If input file has 300 samples.
2. Make every 5th sample as an empty byte buffer.
3. Output file is generated without error.
4. Output file has 240 samples.
5. Exoplayer is able to play output file (blurry).

The new change is in line with MediaMuxer behaviour.

PiperOrigin-RevId: 528798046
2023-05-03 17:11:40 +01:00
ibaker
b4b7e0e7c0 Add DataSource contract test checking scheme case insensitivity
Systems accepting URIs should treat schemes as case-insensitive
([RFC 3986 Section 3.1](https://www.rfc-editor.org/rfc/rfc3986#section-3.1)):
>  An implementation should accept uppercase letters as equivalent to
>  lowercase in scheme names (e.g., allow "HTTP" as well as "http") for
>  the sake of robustness

PiperOrigin-RevId: 528735287
2023-05-03 17:10:47 +01:00
claincly
ad2d4f5008 Mark @CallSuper on some BaseGlShaderProgram methods.
PiperOrigin-RevId: 528734663
2023-05-03 17:09:11 +01:00