1541 Commits

Author SHA1 Message Date
tonihei
c510ab81bb Update compileSdk to 35
This should have no influence on app behavior and other policies
and just allows code to depend on new API 35 platform symbols.

PiperOrigin-RevId: 652414026
2024-07-15 02:45:55 -07:00
ibaker
5fa9985ce6 Add H264_ prefix to NalUnitUtil.NAL_UNIT_TYPE_* constants
Also promote all H.265 constants to be public in `NalUnitUtil` with
`H265_` prefixes, for consistency.

A lot of these names are used in h.265 too (and `NalUnitUtil` handles
both), but with different values, so this rename aims to avoid
accidentally using an h.264 value in an h.265 context.

PiperOrigin-RevId: 651774188
2024-07-12 08:02:24 -07:00
dancho
09239a8a55 Add tests for releasing DefaultVideoFrameProcessor output surface
Add parametrized tests for DefaultVideoFrameProcessor that ensure
output EGL surface can be released, and deallocated.

PiperOrigin-RevId: 651712624
2024-07-12 03:07:20 -07:00
claincly
1ba2d98fce Remove extra comment line
PiperOrigin-RevId: 651367551
2024-07-11 05:06:17 -07:00
claincly
81f5a5f5f3 Set a longer muxer timeout on emulators
This is because the force EOS workaround for videos is longer than the original
muxer timeout. This way the apps depending on Transformer won't have to manually
set the muxer timeout on emulators.

PiperOrigin-RevId: 651355755
2024-07-11 04:12:59 -07:00
kimvde
21992bff33 Call getFrameReleaseAction from VideoSink when enabled
VideoSink.registerInputFrame is now called for every input frame (not
only the ones that should be rendered to the input surface) because it's
the VideoSink that decides whether it wants the frame to be rendered.

PiperOrigin-RevId: 651049851
2024-07-10 09:33:11 -07:00
claincly
60359c16da Add a new debug trace log to log the device name / sdk
PiperOrigin-RevId: 650567544
2024-07-09 03:48:52 -07:00
andrewlewis
74c06dc2f4 Add SurfaceAssetLoader
This supports queueing input to Transformer via a `Surface`.

PiperOrigin-RevId: 650318396
2024-07-08 11:33:05 -07:00
claincly
d0a29400ea Fix test failuer on real-device
In the previous CL, muxer timeout is set to the surface timeout, which is
incorrect.

PiperOrigin-RevId: 650203505
2024-07-08 04:40:22 -07:00
claincly
b4722ef1ea Make timeout longer for emulators
Some test is flaky because frame processing is quite slow and triggered this
time out.

PiperOrigin-RevId: 650191068
2024-07-08 03:47:15 -07:00
andrewlewis
8f72054f2b Remove unused tag
PiperOrigin-RevId: 649448617
2024-07-04 10:55:15 -07:00
claincly
ccdc0ffc27 Use us (microsecond) API.
PiperOrigin-RevId: 649058648
2024-07-03 07:00:18 -07:00
claincly
ed3a741601 Fix MCVR crash when seeking in HDR10 videos
MCVR crashed because MCVR registers a new input stream to VideoSink on every
`onOutputFormatChanged()`, assuming that `onOutputFormatChanged()` is only
invoked on media item transition. However, it can be called multiple times for
one media item.

PiperOrigin-RevId: 649050576
2024-07-03 06:22:44 -07:00
claincly
ce8ab84b7c Add test that covers clipping all videos in a sequence
PiperOrigin-RevId: 649048322
2024-07-03 06:13:08 -07:00
claincly
b9d101f090 Use a resolution that should be encode-able on all devices
The image in the test has a resolution of 1x1 which some device will reject.

PiperOrigin-RevId: 649039791
2024-07-03 05:32:56 -07:00
dancho
91bf3d1da1 Use software decoder in VideoDecodingWrapper
Hardware decoder on some devices fails to write 1920x1080 YUV_420_888 buffers into an ImageReader. This change allows us to remove skipCalculateSsim device workaround in ExportTest.java.

VideoDecodingWrapper now uses media3.MediaExtractorCompat: necessary for parsing of MediaFormat#KEY_CODECS_STRING and decoder capabilities check

PiperOrigin-RevId: 648726721
2024-07-02 08:29:36 -07:00
dancho
9939d77d14 Change test to output 16x width and height
PiperOrigin-RevId: 647716870
2024-06-28 10:03:48 -07:00
dancho
18b28cd625 Skip seahawk device for 8K encoding
PiperOrigin-RevId: 647647264
2024-06-28 05:40:50 -07:00
claincly
efbd522df9 Fix test with TimestampWrapper
The renderer offset is not needed as the pipeline now takes un-offset time,
from 73bf852405

PiperOrigin-RevId: 646808594
2024-06-26 03:48:43 -07:00
kimvde
3694487285 Correct documented Transformer HDR limitation
PiperOrigin-RevId: 646798618
2024-06-26 03:08:08 -07:00
claincly
73bf852405 Make ExoPlayer.setVideoEffects() timestamp start from 0
This is consistent with `Transformer` and `CompositionPlayer`

Issue: androidx/media#1098
PiperOrigin-RevId: 646446824
2024-06-25 05:59:15 -07:00
Copybara-Service
0466728497 Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage
PiperOrigin-RevId: 646402268
2024-06-25 02:56:09 -07:00
kimvde
304c4e41f8 Call VideoFrameReleaseControl.isReady from VideoSink when enabled
PiperOrigin-RevId: 646385384
2024-06-25 01:51:14 -07:00
tonihei
58864a4bb9 Additional variable changes + argument checks in HandlerWrapper 2024-06-24 16:42:02 +01:00
samrobinson
938fac4161 Update CompositionPlayer state for volume.
PiperOrigin-RevId: 646071591
2024-06-24 06:25:28 -07:00
samrobinson
f1fadccef5 Add software decoder workaround for redmi 7a.
PiperOrigin-RevId: 645383707
2024-06-21 07:31:18 -07:00
samrobinson
f2305cc05c Add a parameterized android test for single asset exports.
PiperOrigin-RevId: 644740900
2024-06-19 07:23:01 -07:00
samrobinson
ff4feed0eb Add case to parameterized sequence test for no composition effects.
PiperOrigin-RevId: 644734136
2024-06-19 06:48:39 -07:00
kimvde
30b9c976ea Fix Javadoc of EditedMediaItem.Builder.setDurationUs
The Javadoc was indicating that the duration should always be set,
but it doesn't need to be set in most cases for export.

PiperOrigin-RevId: 644685827
2024-06-19 03:03:15 -07:00
samrobinson
afa7935553 Split parameterized android test utils into utility class.
Includes adjusting how effects are defined, to make it clearer in a
test that a given ItemConfig has effects associated with it.

PiperOrigin-RevId: 644684308
2024-06-19 02:56:34 -07:00
kimvde
d27549d29a Skip 4K export test on Pixel 3a
PiperOrigin-RevId: 644659699
2024-06-19 01:18:05 -07:00
kimvde
048d71e392 Change muxer video duration unit to microseconds
PiperOrigin-RevId: 644402109
2024-06-18 08:56:26 -07:00
samrobinson
1d8b2e3f43 Migrate ParameterizedInputSequenceExportTest to AssetInfo for images.
PiperOrigin-RevId: 644363298
2024-06-18 06:31:56 -07:00
samrobinson
21ad768628 Add AndroidTestUtil missing asset Format info.
Also adds basic support for canDecode receiving an image Format.

PiperOrigin-RevId: 644300521
2024-06-18 02:06:59 -07:00
kimvde
f0aa30555a Remove calls to VideoFrameReleaseControl.join in CompositionPlayer
These calls have no effect because the VideoFrameReleaseControl of
CompositionPlayer is created with allowedJoiningTimeMs set to 0.

PiperOrigin-RevId: 644274524
2024-06-18 00:22:25 -07:00
samrobinson
2698f3ffc2 Migrate performance tests to use AndroidTestUtil constants.
PiperOrigin-RevId: 644058273
2024-06-17 10:38:23 -07:00
samrobinson
2b55a5bc2d Create an AssetInfo class for AndroidTestUtil test asset information.
This is an internal refactor with no logic changed.

There is a duplication in information and a lack of consistency around
the use of test assets in transformer androidTest. This change
refactors each asset to be defined as its own AssetInfo, with the other
relevant parts stored alongside the uri.

Once this is in place, we can consider other useful functionality, such
as having boolean flags for what tracks an asset has, helper methods
for whether an asset is local or remote, and more. This will reduce the
manual overhead necessary to use more assets in tests, and in
particular leads towards easily using new & existing assets in
parameterized tests.

PiperOrigin-RevId: 644040595
2024-06-17 09:47:56 -07:00
samrobinson
6dcbafad21 Use AndroidTestUtil constants so test asset information is consistent.
PiperOrigin-RevId: 643984158
2024-06-17 06:23:22 -07:00
kimvde
eedfb9960e Reset release control from video sink when enabled
PiperOrigin-RevId: 643950097
2024-06-17 03:58:13 -07:00
samrobinson
4109e2edd9 Add more cases for parameterized video android tests.
PiperOrigin-RevId: 643346610
2024-06-14 08:04:13 -07:00
tofunmi
174c49313c support hdr text overlays
adds luminance multiplier to allow the luminance (i.e. brightness) over a text overlay to be scaled

PiperOrigin-RevId: 643047928
2024-06-13 10:41:09 -07:00
samrobinson
e985603e0a Refactor mixedInput E2E test to use parameterized logic.
This CL is a pure refactor of the existing tests, iterative changes
will be done in follow-ups.

The only logic change is having all MP4 assets have the presentaton of
height=360. The old code had some with height 480.
PiperOrigin-RevId: 643020773
2024-06-13 09:17:58 -07:00
claincly
0da892d935 Refactors the seek test and add more test cases
PiperOrigin-RevId: 642597298
2024-06-12 06:34:43 -07:00
claincly
f2bdc08b24 Fix minor timestamp handling issue
- Video release should check for buffer timestamp (which is renderer-offsetted), rather than the frame timestamp
- ImageRenderer should report ended after all of it's outputs are released, rather than when finished consuming its input.

Add tests for timestamp handling

PiperOrigin-RevId: 642587290
2024-06-12 05:43:22 -07:00
kimvde
5a24f40a66 Pass clock to release control from sink provider
In order to do that, make the VideoSink nullable in MCVR.

We want to avoid calling VideoFrameReleaseControl.setClock directly
from MCVR when the sink is enabled. The goal is to handle all the
communication with the release control from the sink/sink provider.

PiperOrigin-RevId: 642542063
2024-06-12 01:51:27 -07:00
sheenachhabra
859ef082d4 Make ExportResult.processedInputs package private
Rational for keeping field package private:
Since the overall export already very complex, by looking at the output file
its hard to know if the desired processing happened or not. Since we now
support sequences with "n" media items, its even more important to know if all
the media items were processed or not.
Although the field exposes implementation details, it seems ok as we get benefit of detailed testing.

PiperOrigin-RevId: 642337888
2024-06-11 11:40:36 -07:00
kimvde
b763673903 Increase sleep duration when video encoder ends with no output frames
This duration was not sufficient on a Pixel 3a

PiperOrigin-RevId: 642276212
2024-06-11 08:21:09 -07:00
samrobinson
06e95ad2fb Reduce flakiness of getProgress tests around percentage values.
There is no requirement for the first progress value to be 0, if
progress is made instantly.

PiperOrigin-RevId: 642245457
2024-06-11 06:14:31 -07:00
claincly
fd376bea07 Add stress test for image transform
PiperOrigin-RevId: 642213253
2024-06-11 03:59:32 -07:00
tofunmi
0d2fdcd025 Add Transformer HDR-only assets sequence effect tests.
PiperOrigin-RevId: 641828107
2024-06-10 02:11:09 -07:00