2016 Commits

Author SHA1 Message Date
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
e2ece2f5bc 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
2023-01-25 18:48:15 +00:00
kimvde
e8ffc7b6f8 Move removeAudio/Video to EditedMediaItem
Also add a Builder to EditedMediaItem to avoid having a constructor with
many optional parameters, or a chain of constructors.

PiperOrigin-RevId: 504588544
2023-01-25 18:47:18 +00:00
huangdarwin
ea629bec83 Test: Rename FrameProcessor Pixel Tests.
Rename tests using the action state expectation pattern.

PiperOrigin-RevId: 504546583
2023-01-25 18:45:31 +00:00
huangdarwin
b359502a13 Effect: Clarify OpenGL configuration.
This information may be needed for applications to create their own OpenGL contexts
and textures passed into or interacting with Effects.

PiperOrigin-RevId: 504342258
2023-01-25 18:43:44 +00:00
tonihei
067340cb0a Filter available commands based on PlaybackStateCompat actions
This allows a MediaController to understand which methods calls
are available on a legacy session.

PiperOrigin-RevId: 504306806
2023-01-25 18:42:51 +00:00
christosts
5f6e172c8f Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
2023-01-25 18:41:55 +00:00
huangdarwin
301683a831 Effect: Clarify GlEffect javadoc exception cause.
PiperOrigin-RevId: 504273335
2023-01-25 18:40:54 +00:00
michaelkatz
7fbdbeb6ca Deduplicate onSetMediaItem handler logic
Created unified MediaUtils method to handle various logic for calling Player.setMediaItems from MediaSessionStub and MediaSessionLegacyStub

PiperOrigin-RevId: 504271877
2023-01-25 18:39:56 +00:00
samrobinson
030edb0e4a Use EMPTY_BUFFER in SpeedChangingAudioProcessorTest.
PiperOrigin-RevId: 504264862
2023-01-25 18:39:01 +00:00
tofunmi
7864d327e8 correct comments in fragment_shader.
PiperOrigin-RevId: 504259419
2023-01-25 18:38:04 +00:00
samrobinson
18f8e9115f Consolidate TransformationResult.transformationException test usage.
PiperOrigin-RevId: 504257627
2023-01-25 18:37:02 +00:00
andrewlewis
b85109e700 Add a way to specify default buffer size
Based on experimentation, when CameraX is producing input for frame processor the buffer size is not being set to match the camera capture resolution, so the output has lower resolution than expected. Expose the default buffer size setter on `SurfaceTexture` to allow apps to process frames at full resolution for use cases like this one where the producer doesn't override the default buffer size.

PiperOrigin-RevId: 504022107
2023-01-25 18:36:02 +00:00
samrobinson
d4ce4480ed Move AudioMixer classes from transformer.audio to transformer package.
Transformer convention has been to avoid splitting into packages unless
necessary.

See https://jlbp.dev/JLBP-2: "Prefer fewer packages over more packages
to avoid unnecessarily publicizing internal details, since any
dependency across package boundaries needs to be public.

PiperOrigin-RevId: 503463294
2023-01-23 12:36:57 +00:00
samrobinson
eda7cd2405 Rename FloatResamplingAudioProcessor to ToFloatPcmAudioProcessor.
Resampling as a term is overloaded, however it was raised as a
confusing term in a meeting recently, as the 1P team initially thought
this would change the sample rate. The naming of this `AudioProcessor`
now matches `ToInt16PcmAudioProcessor`.

PiperOrigin-RevId: 503441019
2023-01-23 12:35:47 +00:00
michaelkatz
bb11e0286e Add onSetMediaItems listener with access to start index and position
Added onSetMediaItems callback listener to allow the session to modify/set MediaItem list, starting index and position before call to Player.setMediaItem(s).

Added conditional check in MediaSessionStub.setMediaItem methods to only call player.setMediaItem rather than setMediaItems if player does not support COMMAND_CHANGE_MEDIA_ITEMS

PiperOrigin-RevId: 503427927
2023-01-23 12:34:44 +00:00
bachinger
e690802e9e Add the MediaSession as an argument to getMediaButtons()
Issue: androidx/media#216
#minor-release
PiperOrigin-RevId: 503406474
2023-01-23 12:33:37 +00:00
huangdarwin
4b4904899c HDR: Clarify media3.effect hdrStaticInfo / colorRange support.
Clarify that we always output on full range colors, and don't handle
hdrStaticInfo input yet.

PiperOrigin-RevId: 503224687
2023-01-23 12:32:31 +00:00
samrobinson
306ce6e3a1 Don't use transformationResult with timeout/unexpected exceptions.
PiperOrigin-RevId: 503187291
2023-01-23 12:31:21 +00:00
ibaker
280889bc4a Explicitly document most Player.Listener methods in terms of getters
This makes it implicitly clear that if the value of a getter changes due
to a change in command availability then the listener will be invoked,
without needing to explicitly document every command on every listener
method.

#minor-release

PiperOrigin-RevId: 503178383
2023-01-23 12:30:18 +00:00
tonihei
052c4b3c1a Add command check for metadata in DefaultMediaNotificationProvider
PiperOrigin-RevId: 503172986
2023-01-23 12:29:14 +00:00
tonihei
e961c1b5e9 Update media controller position before pausing.
We stop estimating new position when pausing until we
receive a new position from the player. However, this
means that we will continue to return a possible stale
previous position. Updating the current position before
pausing solves this issue.

PiperOrigin-RevId: 503153982
2023-01-23 12:28:09 +00:00
kimvde
2cb4e3d71e Remove usages of deprecated startTransformation
PiperOrigin-RevId: 503138745
2023-01-23 12:27:00 +00:00
tonihei
f15b752543 Extend command GET_CURRENT_MEDIA_ITEM to more methods.
We currently only document it for the getCurrentMediaItem(), but
the command was always meant to cover all information about the
current media item and the position therein.

To correctly hide information for controllers, we need to filter
the Timeline when bundling the PlayerInfo class if only this
command is available.

PiperOrigin-RevId: 503098124
2023-01-23 12:25:48 +00:00
kimvde
aa72b45cdf Make startTransformation methods take an EditedMediaItem
Usages of the deprecated methods in Transformer.Builder will be removed
in a follow-up CL.

PiperOrigin-RevId: 502889423
2023-01-23 12:24:44 +00:00
kimvde
d4db33a535 Avoid re-encoding if video effects are no-op
This is to avoid regressions introduced by removing the convenience
methods from TransformationRequest.

PiperOrigin-RevId: 502864512
2023-01-23 12:23:42 +00:00
tonihei
69cfba7c53 Correctly filter PlayerInfo by available getter commands.
When bundling PlayerInfo, we need to remove information if the
controller is not allowed to access it. This was only partially
done at the moment.

PiperOrigin-RevId: 502852798
2023-01-23 12:22:33 +00:00
samrobinson
6dc119a8ab Add ColorInfo to TransformationResult.
TESTED: Manually verified the ColorInfo is propagated when VSP is used.
PiperOrigin-RevId: 502843773
2023-01-23 12:21:20 +00:00
rohks
6c14ffc1ec Fix javadoc references to writeSampleData
PiperOrigin-RevId: 502821506
2023-01-18 12:05:08 +00:00
samrobinson
dfa98ae791 Generate silent audio if no audio track is available.
To always generate silent audio, `removeAudio(true)` can be used in conjunction.

PiperOrigin-RevId: 502814315
2023-01-18 12:03:59 +00:00
kimvde
b0f82767aa Add EditedMediaItem class
This class will be used in a follow-up CL.

PiperOrigin-RevId: 502615323
2023-01-18 12:03:12 +00:00
tonihei
c90ca7ba5f Make availableCommands known when bundling PlayerInfo
When bundling PlayerInfo, we remove data when the controller is not
allowed to access this data via getters. We also remove data for
performance reasons. In the toBundle() method, it's currently hard to
make the connection between allowed commands and filtering, because
the values are checked at a different place. This can be made more
readable by forwarding the applicable Commands directly.

The only functional fix is to filter the Timeline when sending the
first PlayerInfo after a connecting a controller if the command to
get the Timeline is not available. This also allows us to remove a
path to filter MediaItems from Timelines as it isn't used.

PiperOrigin-RevId: 502607391
2023-01-18 12:02:09 +00:00
samrobinson
a3b0708d31 Add resolution fallback for 25% of requested.
If a device only supports 1920x1080 as maximum resolution, then adding
the 25% case ensures 8k is reduced correctly.

PiperOrigin-RevId: 502588364
2023-01-18 12:01:02 +00:00
samrobinson
d092b5261e Add a unit test to check 2/3 resolution supported.
PiperOrigin-RevId: 502573469
2023-01-18 12:00:08 +00:00
Googler
d49a16e094 Disables play/pause button when there's nothing to play
PiperOrigin-RevId: 502571320
2023-01-18 11:59:03 +00:00
christosts
39f4a17ad4 Filter what PlaybackStateCompat actions are advertised
PlayerWrapper advertises PlaybackStateCompat actions to the legacy
MediaSession based on the player's available commands.

PiperOrigin-RevId: 502559162
2023-01-18 11:58:10 +00:00
kimvde
574fea39b6 Add CompositeAssetLoader
This is an AssetLoader that wraps a sequence of AssetLoaders. It will
be used for constrained multi-asset.

This class can currently only concatenate media items with the exact
same format.

PiperOrigin-RevId: 502525796
2023-01-18 11:57:03 +00:00
kimvde
7803716a77 Remove setScale and setRotationDegrees from TransformationRequest
Also remove usages of TransformationRequest convenience methods
(setScale, setRotationDegrees and setResolution).

Some usages of setResolution can't be removed yet because they are used
for fallback.

PiperOrigin-RevId: 502415748
2023-01-17 02:14:20 +00:00
sheenachhabra
d9185235e9 Align muxer code with media3 coding conventions.
This CL includes following changes:
1. Remove GCA related terms/links from java docs and comments.
2. Make class final where ever possible.
3. Append /* package */ for default classes.
4. Change java docs to recommended format.
5. Replace term "packet" with "sample" to avoid confusion.
6. Correct TODO format.
7. Delete MediaFormatUtil.java from muxer module and add its methods into MediaFormatUtil.java in common module.

Note: The java doc on various boxes has the limited description which was already present. In future I am planning to add proper small description for each box (from MP4 spec).

Not included in this CL:
1. Order of element correction as it will show lot of changes and might create confusion with other minor changes.
2. Correction in test cases (Only some renaming).

PiperOrigin-RevId: 502414139
2023-01-17 02:13:33 +00:00
kimvde
15ba0c5fa6 Add the possility to shift frame timestamps in SampleConsumer
This is needed for constrained multi-asset to shift the timestamps of
the media items that are not the first in the sequence.

PiperOrigin-RevId: 502409923
2023-01-17 02:12:48 +00:00
bachinger
abe11c88ec Clarify what default settings are being used for SSAI AdsLoader
PiperOrigin-RevId: 502388865
2023-01-17 02:11:18 +00:00