17739 Commits

Author SHA1 Message Date
tonihei
641c3b1b22 Tweak UI behavior when commands are missing.
For most missing commands, we already disable the corresponding
controls. This change extends this to more UI elements that are
disabled in case the corresponding action is unavailable.

#minor-release

PiperOrigin-RevId: 505057751
2023-02-01 14:03:50 +00:00
kimvde
e5e17d6f2c Add EditedMediaItemSequence and Composition objects
PiperOrigin-RevId: 505047245
2023-02-01 13:59:32 +00:00
kimvde
9759849001 Make setResolution package private
- Usages in 1P apps have been removed.
- setResolution should be removed when refactoring fallback.

PiperOrigin-RevId: 505043425
2023-02-01 13:55:11 +00:00
kimvde
341f2d6b3a Move flattenForSlowMotion to EditedMediaItem
PiperOrigin-RevId: 504867150
2023-02-01 13:50:59 +00:00
huangdarwin
5a0ccdc2ed Test: Rename pixel tests for golden.
producesExpectedOutput -> matchesGoldenFile

PiperOrigin-RevId: 504863604
2023-02-01 13:46:43 +00:00
huangdarwin
237a98e7fb Effect: Move FrameProcessorTestRunner to test-utils.
This is necessary in order to move HDR to SDR tone-mapping tests to transformer/mh.

PiperOrigin-RevId: 504858508
2023-02-01 13:42:30 +00:00
huangdarwin
4206dbe73e Effect: Reword GlEffectsFrameProcessor javadoc.
PiperOrigin-RevId: 504847212
2023-02-01 13:38:14 +00:00
huangdarwin
c53290373d Effect: Clarify FrameProcessingException javadocs.
This is confusing, since the effect is used not only when applying an effect, but also when preparing an effect (ex. in a texture processor's constructor), so we should also mention that case.

PiperOrigin-RevId: 504843598
2023-02-01 13:33:51 +00:00
tofunmi
5b713704da Update max overlays in one OverlayTextureProcessor
Tested adding 3, 15,16 different overlays in a single OverlayTextureProcessor. The program errored out when 16 overlays were added.

PiperOrigin-RevId: 504810157
2023-02-01 13:29:34 +00:00
huangdarwin
1dfbd0de50 Effect: Clarify that padding is added in ScaleToFitTransformation.
PiperOrigin-RevId: 504796380
2023-02-01 13:25:19 +00:00
claincly
44f461a062 Make sure first frame has effects applied.
`FrameProcessorManager` now reports it's not ready when the output surface is set but not the output resolution. `FrameProcessorManager` allows playback without an output surface, like with ExoPlayer.

PiperOrigin-RevId: 504626088
2023-02-01 13:21:03 +00:00
claincly
f69a2f5131 Render PQ to DebugSurface in transformer.
For HLG input in transformer, FinalWrapper is configured to only output HLG to
encoder. But since DebugPreview is configured to take PQ for HDR content, the
color will not look correct.

This CL allows overriding the MatrixTP output transfer function, so
that FinalWrapper can output

- HLG to encoder
- PQ to debug preview

PiperOrigin-RevId: 506022840
2023-02-01 10:43:43 +00:00
huangdarwin
089510bc64 Effect: Allow SingleFrameGlTextureProcessor to throw errors.
Implementations outside media3 should be able to throw FrameProcessingException if they come across an error during configure().

PiperOrigin-RevId: 506020149
2023-02-01 10:42:49 +00:00
ibaker
d1a27bf2a8 Fix (another) LeanbackPlayerAdapter param name mismatch
I missed this when fixing `positionInMs` for Dackka in aae6941981

This time I manually verified that all the `@Override` methods have
parameter names that match [the docs](https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter).

#minor-release

PiperOrigin-RevId: 506017063
2023-02-01 10:41:50 +00:00
claincly
928faf5378 Don't release a frame when not force rendering when paused.
And rename method `releaseOutputFrame` to `releaseProcessedFrameInternal` for consistency.

Removed misplaced comment.

PiperOrigin-RevId: 506005744
2023-02-01 10:40:55 +00:00
kimvde
2c690618e5 Undeprecate startTransformation(MediaItem, String)
This overload is helpful to apps transcoding a MediaItem without edits.

PiperOrigin-RevId: 505987852
2023-02-01 10:39:55 +00:00
kimvde
d5035123b4 Make Composition fields public
Transformer callbacks will take a Composition instead of a MediaItem.
Apps should be able to see what this Composition contains.

PiperOrigin-RevId: 505976561
2023-02-01 10:39:02 +00:00
claincly
2d3156f87e Make sure the first frame is force rendered.
PiperOrigin-RevId: 505960752
2023-02-01 10:38:02 +00:00
huangdarwin
0b1a904c07 HDR: Add device checks and mh for GL tone mapping PixelTests.
Add checks to GL tone-mapping pixel tests, to ensure the device's decoder, API
version, and OpenGL implementation support GL tone-mapping before attempting it.

These tests should be run on mobile harness, to detect per-device failures, and
so are moved to transforemr/mh. Per b/263395272, these tests should ultimately
be in an effect/mh directory.

PiperOrigin-RevId: 505749974
2023-02-01 10:37:09 +00:00
andrewlewis
4fb651b116 Instantiate SurfaceView on main thread
On some devices/builds it seems that the `SurfaceView` constructor tries to create a handler. Move instantiation to the main thread when getting the debug surface view so that handler creation succeeds.

PiperOrigin-RevId: 505745387
2023-02-01 10:36:12 +00:00
samrobinson
ff56b7d294 Add check for isIdentity in ChannelMappingMatrix.
Make clearer the intermediate matrix property names.

PiperOrigin-RevId: 505732563
2023-02-01 10:35:19 +00:00
bachinger
4a9cf7d069 Do not assume a valid queue in 3rd party sessions
This change fixes an issue that can be reproduced when
a controller `onConnect` creates a `QueueTimeline` out
of the state of a legacy session and then `prepare` is called.

`activeQueueItemId`, `metadata` and the `queue` of the legacy
session are used when a `QueueTimeline` is created. The change
adds unit tests to cover the different combinatoric cases these
properties being set or unset.

PiperOrigin-RevId: 505731288
2023-02-01 10:34:25 +00:00
samrobinson
c2b0d1b756 Add ChannelMixingMatrix property unit tests.
PiperOrigin-RevId: 505720834
2023-02-01 10:33:32 +00:00
kimvde
f5e31989ab Pass an EditedMediaItem to AssetLoader.Factory
PiperOrigin-RevId: 505671326
2023-02-01 10:32:37 +00:00
kimvde
32d4686c56 Add error message if track is added during transformation
PiperOrigin-RevId: 505670386
2023-02-01 10:31:39 +00:00
kimvde
1d968c3a55 Remove ParcelFileDescriptor output from Transformer
ParcelFileDescriptor is quite specific and removing it allows to have
less overloads of startTransformation.

A follow-up CL will undeprecate the overload that takes a MediaItem.

PiperOrigin-RevId: 505670321
2023-02-01 10:30:44 +00:00
tonihei
0d4e29ffc4 Force AudioTrack-based speed changes when offload is enabled
AudioProcessor-based speed changes are not supported with
offload, so we should use the AudioTrack-based speed changes
by default if the user requests a speed change.

This moves the decision of which speed change path is used
into the Configuration, so that it can change for each
AudioTrack in a playlist.

PiperOrigin-RevId: 505621911
2023-02-01 10:29:44 +00:00
bachinger
d7ef1ab5bd Inline method in PlayerService that is used from on call site only
#cleanup
#minor-release

PiperOrigin-RevId: 505146915
2023-02-01 10:28:52 +00:00
huangdarwin
181564e026 Transformer: Make it clear that getExpectedColorInfo is input.
Otherwise, it's not clear if it's the expected output.

Renaming-only change. No functional change intended.

PiperOrigin-RevId: 505103740
2023-02-01 10:27:51 +00:00
tonihei
00436a04a4 Fix timestamp comparison for seeks in fMP4
When seeking in fMP4, we try to extract as little samples as possible
by only starting at the preceding sync frame. This comparison should
use <= to allow sync frames at exactly the seek position.

Issue: google/ExoPlayer#10941

#minor-release

PiperOrigin-RevId: 505098172
2023-02-01 10:26:52 +00:00
tonihei
3d82846074 Simplify playback parameter state tracking in DefaultAudioSink
This makes it easier to reason about some parts of the code and
will eventually allow to easily switch between AudioProcessor-
based on AudioSink-based speed adjustment.

The current state saves the applicable playback parameters
in separate variables depending on which speed adjustment
path is used. Moreover, the AudioProcessor-based logic keeps
a chain of pending parameter changes and we derive the last
applicable one everytime we need the current parameters.

After this change, this is simplified by
 - keeping a common value for playback parameters independent
   of the actual path we use for adjustment.
 - keeping the final ("current") parameters directly, instead
   of deriving it from a chain of yet to be applied parameters.

PiperOrigin-RevId: 505097294
2023-02-01 10:25:58 +00:00
samrobinson
5e44af0ad9 Generalise UnhandledAudioFormatException for non-input use cases.
PiperOrigin-RevId: 505084963
2023-02-01 10:24:59 +00:00
bachinger
5c82d6bc18 Double tap detection for Bluetooth media button events only
Issue: androidx/media#233
#minor-release
PiperOrigin-RevId: 505078751
2023-02-01 10:24:01 +00:00
michaelkatz
542a1ef03f Match MergingMediaPeriod track selection by period index in id
MergingMediaPeriod creates its track groups with ids concatenating position in its periods array and the underlying child track group id. The ids can be used in selectTracks for matching to periods list.

Issue: google/ExoPlayer#10930
PiperOrigin-RevId: 505074653
2023-02-01 10:23:09 +00:00
tonihei
b3e7696ba7 Tweak UI behavior when commands are missing.
For most missing commands, we already disable the corresponding
controls. This change extends this to more UI elements that are
disabled in case the corresponding action is unavailable.

#minor-release

PiperOrigin-RevId: 505057751
2023-02-01 10:22:15 +00:00
kimvde
b27cc56851 Add EditedMediaItemSequence and Composition objects
PiperOrigin-RevId: 505047245
2023-02-01 10:21:22 +00:00
kimvde
43aace03cf Make setResolution package private
- Usages in 1P apps have been removed.
- setResolution should be removed when refactoring fallback.

PiperOrigin-RevId: 505043425
2023-02-01 10:20:19 +00:00
kimvde
c3934c532c Move flattenForSlowMotion to EditedMediaItem
PiperOrigin-RevId: 504867150
2023-02-01 10:19:24 +00:00
huangdarwin
697f84161d Test: Rename pixel tests for golden.
producesExpectedOutput -> matchesGoldenFile

PiperOrigin-RevId: 504863604
2023-02-01 10:18:29 +00:00
huangdarwin
76eb2d4f59 Effect: Move FrameProcessorTestRunner to test-utils.
This is necessary in order to move HDR to SDR tone-mapping tests to transformer/mh.

PiperOrigin-RevId: 504858508
2023-02-01 10:17:36 +00:00
huangdarwin
2360f1f5a3 Effect: Reword GlEffectsFrameProcessor javadoc.
PiperOrigin-RevId: 504847212
2023-02-01 10:16:34 +00:00
huangdarwin
b251b8db09 Effect: Clarify FrameProcessingException javadocs.
This is confusing, since the effect is used not only when applying an effect, but also when preparing an effect (ex. in a texture processor's constructor), so we should also mention that case.

PiperOrigin-RevId: 504843598
2023-02-01 10:15:39 +00:00
tofunmi
1a416b17b5 Update max overlays in one OverlayTextureProcessor
Tested adding 3, 15,16 different overlays in a single OverlayTextureProcessor. The program errored out when 16 overlays were added.

PiperOrigin-RevId: 504810157
2023-02-01 10:14:38 +00:00
huangdarwin
a5d43b2194 Effect: Clarify that padding is added in ScaleToFitTransformation.
PiperOrigin-RevId: 504796380
2023-02-01 10:13:45 +00:00
claincly
0874c1e795 Make sure first frame has effects applied.
`FrameProcessorManager` now reports it's not ready when the output surface is set but not the output resolution. `FrameProcessorManager` allows playback without an output surface, like with ExoPlayer.

PiperOrigin-RevId: 504626088
2023-02-01 10:12:50 +00:00
samrobinson
a5a59df44c Move audio buffer/array test utility methods to TestUtil.
PiperOrigin-RevId: 504611069
2023-02-01 10:11:54 +00:00
huangdarwin
86b629fff8 Effect: Decouple GlEffectsFrameProcessorTestRunner from GLEffects.
This is necessary in order to move HDR to SDR tone-mapping tests to transformer/mh,
and to move the test runner to androidx.media3.test-utils, which should not have to
include androidx.media3.effects.

PiperOrigin-RevId: 504607929
2023-02-01 10:10:57 +00:00
lemondoglol
b65baf7d72 make merged segment size configurable 2023-01-30 13:15:10 -05:00
tonihei
55312e1257 Add missing command checks in UI module
The commands are partly checked already before enabling
features or calling player methods, but the checks were
still missing in many places.

#minor-release

PiperOrigin-RevId: 504589888
(cherry picked from commit e2ece2f5bcda0cea436d782d58fa6f1d9a4d1f99)
2023-01-26 14:26:00 +00:00
ibaker
d6c9fdb210 Add missing } to publish.gradle
This was missed in 47349b8c4b

#minor-release

PiperOrigin-RevId: 504548659
(cherry picked from commit 50beec56f4188e46f67e561ac4bb4ace5bb95089)
2023-01-26 14:26:00 +00:00