282 Commits

Author SHA1 Message Date
samrobinson
414dbebc2b Assert file size in E2E android tests that claim to complete.
Remove redundant test logic to add file size to ExportResult because
the file size is already added to export result as part of an export
finishing.

PiperOrigin-RevId: 636499236
2024-05-23 04:17:19 -07:00
ibaker
0352db9a37 Default to parse subtitles while extracting, instead of while rendering
To override this change, and go back to parsing during rendering,
apps must make two method calls:

1. `MediaSource.Factory.experimentalParseSubtitlesDuringExtraction(false)`
2. `TextRenderer.experimentalSetLegacyDecodingEnabled(true)`

PiperOrigin-RevId: 634262798
2024-05-16 01:42:56 -07:00
bachinger
4841f8f8b3 Run ExoPlayerTest with preloading enabled and disabled
Replace with parametrized test when  https://issuetracker.google.com/316040980
is resolved.

PiperOrigin-RevId: 631096883
2024-05-06 09:58:09 -07:00
bachinger
0ab6ea5668 Add preload pool to media period MediaPeriodQueue
The pool is created and the queue uses holder instances found
to enqueue. No preloading is done yet though.

PiperOrigin-RevId: 631053172
2024-05-06 08:07:49 -07:00
tonihei
703b9368c3 Add ExoPlayer.setPriority
This lets apps update the task manager priority and send the
priority message to all renderers so that they can adjust their
resources if needed.

PiperOrigin-RevId: 629426058
2024-04-30 08:49:16 -07:00
ibaker
854e8aad32 Add Dumper.addIfNonDefault methods
Remove the duplicate implementations in `PlaybackOutput` and
`DumpableFormat`.

PiperOrigin-RevId: 628419737
2024-04-26 09:00:44 -07:00
ibaker
e759b44c45 Remove @Nullable from Dumper.add methods
`checkNotNull` was added to the `Object` variant in b83f12c4ba. It
doesn't seem to have caused any test failures, so I guess we never
pass `null` in here - and might as well update the annotation to match
reality. And then for consistency we should ban `null` from the
`byte[]` overload too.

PiperOrigin-RevId: 628419003
2024-04-26 08:56:56 -07:00
ibaker
5666678d8a Use Dumper.addTime in more places
This ensures that `C.TIME_UNSET` is more clear in dump files. Some of
these call-sites will **never** pass `C.TIME_UNSET`, but it seems
clearest to always use `addTime` and maybe it will ensure when these
sites are copied in future, `addTime` will be used in the new location
too.

PiperOrigin-RevId: 628363183
2024-04-26 04:20:56 -07:00
ibaker
acb3a54dee Add MediaMetadata to playback test dump files
This change also adds some runtime redirection of calls to
`Dumper.add(String, Object)` to `add(String, byte[])` if
`value instanceof byte[]`. This simplifies the implementation of
`PlaybackOutput.dumpIfNotEqual` and seems like a reasonable amound of
'magic' for a test utility.

Issue: androidx/media#1305
PiperOrigin-RevId: 628119473
2024-04-25 10:35:18 -07:00
claincly
7aed9d40a0 Clean up nullness annotation
PiperOrigin-RevId: 627114088
2024-04-22 12:07:07 -07:00
sheenachhabra
4aa2fb883f Add RawAssetLoader and deprecate TextureAssetLoader
All the changes are based on existing implementations
and their related tests.

No new functionality is being added.

PiperOrigin-RevId: 625756836
2024-04-17 11:48:43 -07:00
ibaker
032cad8d09 Remove more unnecessary SDK checks now the min is 19
PiperOrigin-RevId: 621600592
2024-04-03 12:15:24 -07:00
Copybara-Service
8fe70332ee Merge pull request #1054 from jekopena:main
PiperOrigin-RevId: 619573181
2024-03-27 10:24:32 -07:00
tofunmi
65e94480f4 Transformer: add single-asset ultraHDR image to HLG HDR vid transcoding
PiperOrigin-RevId: 619138202
2024-03-26 04:06:41 -07:00
tonihei
73c0ebb214 Additional clean-up and formatting 2024-03-25 15:02:31 +00:00
Juan Carlos Penalver
e9e47f4fe6 Removing id from Label and ensuring label/labels consistency in Format.Builder. 2024-03-25 12:00:14 +00:00
Juan Carlos Penalver
63fb68e99e Reverting breaking changes by keeping label and adding labels. 2024-03-25 12:00:14 +00:00
Juan Carlos Penalver
df763220c8 Replacing label with a list of Label elements in Format. 2024-03-25 12:00:14 +00:00
christosts
e399ea19bb Composition preview: move audio and video components
PiperOrigin-RevId: 614673253
2024-03-11 08:29:38 -07:00
tonihei
e4a55844d0 Add device-specific opt-ins for async MediaCodecAdapter
Some devices just don't work very well with the synchronous
model, but are currently still excluded from our approximate
API 31 check. This change allows to include additional devices
or device groups by passing in the Context to the default
adapter.

It also adopts the workaround added in ebceee08c6
for Fire TV Smart devices that exhibit this issue.

PiperOrigin-RevId: 614642545
2024-03-11 06:29:46 -07:00
ibaker
7f5b1a98e9 Use Guava's toByteArray & fromByteArray methods where possible
Also remove intermediate object allocations in
`Util.toByteArray(int...)`.

`Util.toByteArray(InputStream)` is kept (but deprecated) because it's
been part of the library for a while and might be in use by some apps.
The others are much newer, so the chance of usages outside the library
is very low, so we just remove them directly.

PiperOrigin-RevId: 613878453
2024-03-08 03:27:29 -08:00
ibaker
ab8b77a6d3 Use try-with-resources for input and output streams in TestUtil
Many of these streams were previously never closed.

PiperOrigin-RevId: 613580471
2024-03-07 07:47:59 -08:00
ibaker
914874566e Remove unused TestUtil.getBitmap method
PiperOrigin-RevId: 613579444
2024-03-07 07:41:14 -08:00
ibaker
0ff80d7da0 Statically import Assertions methods in FakeExoMediaDrm
PiperOrigin-RevId: 613578959
2024-03-07 07:37:50 -08:00
ibaker
a604600126 Add workarounds for NoSuchMethodError from DRM framework exceptions
Issue: androidx/media#1145

#minor-release

PiperOrigin-RevId: 613573868
2024-03-07 07:16:28 -08:00
claincly
626a8adfd8 Test effect-enabled playback
This new test is for `ExoPlayer.setVideoEffects()`. It plays the
one-second-long video, applies an overlay that prints the video frame timestamp
onto the frame, captures the output frame and compares the captured output
frame with golden.

PiperOrigin-RevId: 610781590
2024-02-27 09:44:24 -08:00
tofunmi
0480bc31a8 Rename media/bitmap out of media and rename
PiperOrigin-RevId: 610418418
2024-02-26 08:40:19 -08:00
sheenachhabra
a82d7e7098 Improve retrieveTrackFormat() java doc and remove catch block
PiperOrigin-RevId: 608939192
2024-02-21 04:11:39 -08:00
sheenachhabra
063fbc7b84 Remove FileUtil.java class
PiperOrigin-RevId: 608556329
2024-02-20 04:35:49 -08:00
tofunmi
e6facd6a7e Fix: make VFP test runner propagate the right exceptions
PiperOrigin-RevId: 608337651
2024-02-19 07:57:33 -08:00
Gaëtan Muller
963e517a5a Remove unnecessary RequiresApi annotation 2024-02-13 10:26:19 +00:00
tianyifeng
2b473831c6 Implement onInit() and onRelease() in FakeRenderer
PiperOrigin-RevId: 606301390
2024-02-12 10:57:14 -08:00
tofunmi
1a5eb4eecd Support segment-specific speed changes in SpeedChangeEffect
PiperOrigin-RevId: 606204479
2024-02-12 04:03:23 -08:00
sheenachhabra
69c555be0a Move retrieveTrackFormat() method to TestUtil
TestUtil class is more appropriate for the given method.
In the next CL, the only method in FileUtil.java will be moved back
into transformer library and the FileUtil class will be removed.

PiperOrigin-RevId: 605648034
2024-02-09 09:18:14 -08:00
ibaker
3a7a665d5d Rollback of 406c0a15be
PiperOrigin-RevId: 605015994
2024-02-07 09:56:59 -08:00
huangdarwin
8b6c8fc480 Test: Remove assertions from test infra.
PiperOrigin-RevId: 603664759
2024-02-02 05:57:30 -08:00
sheenachhabra
30b60f6c60 Refactor assertFileHasColorTransfer method
PiperOrigin-RevId: 603662313
2024-02-02 05:42:28 -08:00
huangdarwin
42ac0e5492 Effect: Report errors during registerInputStream
Without this, GLSL compilation errors may lead to the test stalling indefinitely

PiperOrigin-RevId: 603381111
2024-02-01 08:42:43 -08:00
sheenachhabra
198e3fb166 Assert Export output mime type by retrieving output file metadata
PiperOrigin-RevId: 603333340
2024-02-01 04:49:02 -08:00
sheenachhabra
61603f90f3 Refactor track retrieval into a separate method
This will be be required when we add more method which
required video track.

PiperOrigin-RevId: 603024260
2024-01-31 06:00:58 -08:00
sheenachhabra
c6cb6c4922 Move FileUtil.java into test_utils module
FileUtil.java can be extended to add more methods for validating
output file. This will be used in Transformer's robolectric tests and
instrumentation tests hence need to move to a common module.

PiperOrigin-RevId: 602789503
2024-01-30 11:33:10 -08:00
tonihei
ed5b7004b4 Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
2024-01-26 10:06:18 -08:00
ibaker
34a08e13fc Rollback of 406c0a15be
PiperOrigin-RevId: 599546140
2024-01-18 10:21:53 -08:00
tonihei
59dc5b6692 Add missing null and Bundle checks in MediaSession/ControllerStub
PiperOrigin-RevId: 599477547
2024-01-18 05:29:39 -08:00
ibaker
406c0a15be CompositeSequenceableLoader: Prefer buffered position of A/V tracks
Preferring audio and video tracks matches logic we already have in
[`ProgressiveMediaPeriod.getBufferedPositionUs`](f6fe90f30b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/source/ProgressiveMediaPeriod.java (L403)).

PiperOrigin-RevId: 599154217
2024-01-17 06:33:14 -08:00
sheenachhabra
e0257f403f Implement fragmented MP4 (fMP4) in the Mp4Muxer
Changes includes;
1. Public API to enable fMP4 and to pass fragment duration.
2. Added `FragmentedMp4Writer`.
3. Added logic to create fragments based on given fragment duration.
4. Write "moov" box only once in the beginning.
3. Add all the required boxes for current implementation.
4. Unit tests for all the new boxes.
5. E2E test for generating fMP4.

Note: The output file is un seek-able with this first implementation.
PiperOrigin-RevId: 594426486
2023-12-29 03:39:38 -08:00
sheenachhabra
b0e00a7d28 Fix ByteBuffer.array() warning
PiperOrigin-RevId: 594274620
2023-12-28 10:07:47 -08:00
huangdarwin
0ed19937d3 Test: Remove setInputColorInfo from VFP test runner.
Instead, for input videos, use the colorInfo provided by the extractor. Similarly, for input images, use sRGB, the only color currently in use.

Textures do still need the input ColorInfo provided though.

PiperOrigin-RevId: 592875967
2023-12-21 09:06:55 -08:00
huangdarwin
7579693739 Effect: Move VideoFrameProcessor inputColorInfo interface to FrameInfo.
Move `inputColorInfo` from `VideoFrameProcessor`'s `Factory.create` to `FrameInfo`,
input via `registerInputStream`.

Also, manually tested on exoplayer demo that setVideoEffects still works.

PiperOrigin-RevId: 591273545
2023-12-15 09:17:39 -08:00
bachinger
29d7dd1ec9 Keep selections for preloaded adaptive sample streams
When an adaptive source has been preloaded, the track selection
of the player should possibly not override the preloaded selection
to avoid discarding preloaded data.

PiperOrigin-RevId: 591256334
2023-12-15 08:09:22 -08:00