19310 Commits

Author SHA1 Message Date
christosts
398809e4e2 Replace Queue<Long> with a queue for long primitives
Replace Queue<Long> with LongArrayQueue which provides queue semantics
for long primitives. LongArrayQueue is forked from IntArrayQueue which
in turn was forked from Androidx CircularIntArray.

IntArrayQueue is deleted and we now use CircularIntArray directly from
Androidx Collection.

PiperOrigin-RevId: 559129744
2023-08-24 09:14:44 +01:00
tonihei
36084eef05 Split test_session_current instrumentation tests by file
PiperOrigin-RevId: 559089467
2023-08-22 15:50:29 +01:00
tonihei
a00bef9e51 Fix MediaControllerSurfaceSizeChangeTest
There are multiple problems in the test:
 1. The controller must run on the main thread due to the Player
    interface requirement to add surfaces on the thread their
    callbacks will be called on.
 2. This test made assertions about an expected callback that
    aren't true. Setting an anonymous surface will not result in
    a size change callback because the size stays unknown.
    But clearing a surface (even if never set) ensures the returned
    size is guaranteed to be zero.

PiperOrigin-RevId: 559080905
2023-08-22 15:49:08 +01:00
samrobinson
2309fc5edb Add AudioGraph test verifying silence outputs correct amount of bytes.
PiperOrigin-RevId: 559072505
2023-08-22 15:47:54 +01:00
samrobinson
b7782b5119 Inline ProgressHolder and ArgumentCaptor test class variables.
PiperOrigin-RevId: 559069221
2023-08-22 15:46:13 +01:00
rohks
0541e1953c Add nullness annotations to SampleQueue
#fixit

PiperOrigin-RevId: 559058211
2023-08-22 15:44:50 +01:00
ibaker
e9978a94af Move release note from 1.2.0-alpha01 to 'unreleased changes'
PiperOrigin-RevId: 559023779
2023-08-22 15:43:20 +01:00
samrobinson
7346029f72 Use TemporaryFolder @Rule for automated tear down of temp files.
Reduce @Before specific logic, following java dev guide.

PiperOrigin-RevId: 558825609
2023-08-22 15:42:07 +01:00
ibaker
3ced1cbaa2 Update annotation-experimental version
This picks up a fix to ensure Android Studio puts the `@OptIn`
annotation in the correct place:
https://issuetracker.google.com/251172715

This also introduces a transitive dependency from `media3-common` on
the Kotlin standard library, so this CL also includes some updates to
the dev guide to document how apps can avoid including this dep if
they want.

PiperOrigin-RevId: 558821673
2023-08-22 15:40:46 +01:00
samrobinson
ae7667783c Split dump file directories based on input file name.
Remove old unused dump files.

PiperOrigin-RevId: 558820926
2023-08-22 15:39:28 +01:00
huangdarwin
350b394596 Compositor: Add tests for 1, 3, and 5 inputs.
With this, Compositor now handles an arbitrary number of inputs!

PiperOrigin-RevId: 558813361
2023-08-22 15:38:05 +01:00
tonihei
fddb09be20 Internal change
PiperOrigin-RevId: 558799565
2023-08-22 15:36:56 +01:00
tianyifeng
15f4ff7487 Remove asserts inside callbacks
PiperOrigin-RevId: 558791481
2023-08-22 15:35:33 +01:00
ibaker
849238a52f Stop explicitly creating a sourcesElement Gradle variant
This variant has been superceded by an equivalent
`releaseVariantReleaseRuntimePublication` variant which (I think) has
been created since d5f9cf4f19.

Before this change the `sourcesElement` variant was being created with
no `files` config, which resulted in build failures when generating
javadoc in AndroidX:

```
However we cannot choose between the following variants of androidx.media3:media3-cast:1.2.0-alpha01:
  - releaseVariantReleaseSourcePublication
  - sourcesElement
```

We can resolve this confusion by deleting the empty & unneeded
`sourcesElement` variant.

#minor-release

PiperOrigin-RevId: 558783471
2023-08-22 15:34:20 +01:00
rohks
91764baa90 Add nullness annotations to SimpleCache
#fixit

PiperOrigin-RevId: 558783228
2023-08-22 15:33:08 +01:00
christosts
4fad529433 Rollback of f5a6ecdda1
PiperOrigin-RevId: 558779068
2023-08-22 15:31:43 +01:00
huangdarwin
59744fe788 Effect: Minimize calls to configure in default impl.
In case BaseShaderProgram implementations have an expensive
configure() call, we can only call configure() when absolutely necessary,
aka when the input size changes.

To reduce scope, this doesn't reduce the amount of
configure() calls that may be made outside this class, in
DefaultFrameDroppingShaderProgram and
FinalShaderProgramWrapper.

PiperOrigin-RevId: 558754314
2023-08-22 15:30:23 +01:00
huangdarwin
153740386a Compositor: Use lists for inputs instead of instances.
This makes the code a bit more flexible for when we allow for an arbitrary
number of inputs.

PiperOrigin-RevId: 558740536
2023-08-22 15:29:04 +01:00
tofunmi
521c210fd1 Create Timestamp iterator
PiperOrigin-RevId: 558738035
2023-08-22 15:27:42 +01:00
samrobinson
352916b182 Add parameterized tests for generating silence.
Covers all permutations&combinations of:
* AV asset.
* AV asset with effects.
* AV asset with silence.
* AV asset with silence and effects.

Note that the video is not relevant (therefore transmuxed), but is
needed for silence generation.

PiperOrigin-RevId: 558734593
2023-08-22 15:26:19 +01:00
rohks
e0d3cad8bb Add fields next object request (nor) and next range request (nrr)
Added this CMCD-Request fields to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 558317146
2023-08-22 15:25:03 +01:00
rohks
b6b16b2895 Sort Common Media Client Data keys to reduce fingerprinting surface
Based on the Common Media Client Data (CMCD) specification key-value pairs should be sequenced in alphabetical order of the key name in order to reduce the fingerprinting surface exposed by the player.

PiperOrigin-RevId: 558296264
2023-08-22 15:23:33 +01:00
rohks
afb8d6c9e2 Make custom data adhere to Common Media Client Data(CMCD) specification
Added more comprehensive Javadoc around setting custom data and verification on key format.

Changed adding custom data as a `String` to `List<String>`. This would enable us to sort all keys to reduce the fingerprinting surface.

PiperOrigin-RevId: 558291240
2023-08-22 15:22:08 +01:00
samturci
6566387f70 Add a waveform audio buffer sink.
This can be used together with TeeAudioProcessor to draw an audio waveform.

PiperOrigin-RevId: 558213516
2023-08-22 15:20:47 +01:00
samrobinson
54797d4cc5 Use @Rule and other util to simplify ParameterizedAudioExportTest.
PiperOrigin-RevId: 558168355
2023-08-22 15:19:15 +01:00
samrobinson
99ac6feeee Add varargs convenience constructors to Sequence & Composition.Builder
Improves API ease-of-use & readability and reduces verbose boilerplate.

PiperOrigin-RevId: 558163557
2023-08-22 15:17:55 +01:00
tianyifeng
7f1ee0b390 Use TrackGroup.equals when determining equality of BaseTrackSelection
PiperOrigin-RevId: 558150684
2023-08-22 15:16:38 +01:00
jbibik
271bf7a56e Clean up of RELEASENOTES
#minor-release

PiperOrigin-RevId: 558135984
2023-08-18 15:35:06 +01:00
samrobinson
2db6f0aee7 Ensure audio components check incoming data is valid.
Default PCM encoding is only set for decoders outputting raw.

Tests migrated to abide by tighter restrictions.

PiperOrigin-RevId: 558129452
2023-08-18 15:33:44 +01:00
sheenachhabra
15650c6bf3 Add buildUpon method in Composition
We will need to build upon original composition
for pause and resume feature and will have to set modified sequences.
In the next CL, will add method to set sequences on builder and will
probably remove it from the constructor parameter (to avoid providing
two APIs for same thing).

PiperOrigin-RevId: 558127334
2023-08-18 15:32:28 +01:00
huangdarwin
030d8148ba Test: Add debug info to debug test failure
I wasn't able to reproduce the error in the bug by running videoTranscoding_withTextureInput_completesWithCorrectFrameCountAndDuration
100 times, but I figured this added debug info may help the next time the
issue is seen.

PiperOrigin-RevId: 558118443
2023-08-18 15:31:00 +01:00
ibaker
107e41b387 Switch from Metalava v3 output to v2
This means we no longer need `--output-kotlin-nulls=no`, because that's
already the default behaviour at `v2`. This allows Metalava to remove
the `--output-kotlin-nulls` flag.

PiperOrigin-RevId: 558112319
2023-08-18 15:29:47 +01:00
huangdarwin
39bc92ffcf Compositor: Use multi-stage rendering and occlude background.
PiperOrigin-RevId: 558110739
2023-08-18 15:28:23 +01:00
claincly
a5903f5d3e Init the collection types to the expected size
PiperOrigin-RevId: 558102287
2023-08-18 15:27:02 +01:00
bachinger
2386b7e944 Some JavaDoc fixes in ImaServerSideAdInsertionMediaSource
Issue: androidx/media#555
PiperOrigin-RevId: 558097690
2023-08-18 15:25:41 +01:00
jbibik
13a809b5b9 Add androidx.exifinterface:exifinterface to AAR list
PiperOrigin-RevId: 558090096
2023-08-18 15:24:32 +01:00
bachinger
725e1abc76 Move release notes entry to correct section
PiperOrigin-RevId: 558087503
2023-08-18 15:23:04 +01:00
claincly
c6804e40a3 Display more accurate time in demo app
PiperOrigin-RevId: 558077709
2023-08-18 15:21:53 +01:00
huangdarwin
02b347ac66 Test: Reduce tokyo.jpg test file size.
This file decompresses to 3024*4032*4 bytes ~= 48
MB, which leads to OOM errors on some devices.

Use a lower resolution test image for tests, to
still test a portrait image but without hitting
OOM errors.

PiperOrigin-RevId: 557861063
2023-08-18 15:20:34 +01:00
ibaker
450d1cd3e9 Add MediaParserExtractorAdapter.enableConstantBitrateSeeking
PiperOrigin-RevId: 557859297
2023-08-18 15:19:20 +01:00
huangdarwin
86678b99ce Decoder: Add SM-F721 to HLG blocklist.
Not only restricted to SM-F721B, per other [Models](https://www.gsmarena.com/samsung_galaxy_z_flip4-11538.php#:~:text=SM%2DF721B%2C%20SM%2DF721B/DS%2C%20SM%2DF721N%2C%20SM%2DF721U%2C%20SM%2DF721U1%2C%20SM%2DF721W).

PiperOrigin-RevId: 557857282
2023-08-18 15:17:48 +01:00
tofunmi
dd0f88490c Add ability to queue bitmap by timestamp to the sampleConsumer
PiperOrigin-RevId: 557837922
2023-08-18 15:16:24 +01:00
tofunmi
a8944ef2f0 Add BitmapDecoder interface
PiperOrigin-RevId: 557827954
2023-08-18 15:15:14 +01:00
huangdarwin
b814404c56 Effect: Update rgba matrix reference to rgb.
The 4x4 matrix only updates the RGB channels, so it should be referred to as an rgb matrix, not an rgba matrix.

PiperOrigin-RevId: 557804613
2023-08-18 15:13:44 +01:00
claincly
3ae927525b Add error listener to InputSwitcher's sampling shader program
PiperOrigin-RevId: 557797201
2023-08-18 15:12:32 +01:00
huangdarwin
a3de5978e0 Test: Use unpremultiplied alpha for GL output.
In addition to this being how Alpha should be handled, tests do fail under
API 29 without this CL. Unfortunately while these tests do fail under API 29
without this CL, we currently only run this test on API 33 emulators, so we
didn't catch this failure earlier (until compositor tests on mh failed on all
devices under API 29 and succeeded on all at or over 29).

PiperOrigin-RevId: 557781757
2023-08-18 15:11:12 +01:00
bachinger
6bd3e53e8d Set notification foreground service behaviour starting with API 31
When the foreground service type is set to `mediaPlayiback` this shouldn't
be required. However, some reports from users say that setting the
foreground service behavor fixes some problems on some devices. Setting
it explicitely with this change makes sure users don't have to do that
workaround themselves.

Issue: androidx/media#167
PiperOrigin-RevId: 557608577
2023-08-18 15:09:59 +01:00
samrobinson
74fa0ed6bf Move FakeAssetLoader to inner class of MediaItemExportTest.
MediaItemExportTest is the only class using this FakeAssetLoader, so it
should be moved out of TestUtil.

PiperOrigin-RevId: 557546717
2023-08-16 22:03:14 +01:00
samrobinson
27bc2e6844 Add new effects helper util for unit tests.
PiperOrigin-RevId: 557515564
2023-08-16 22:01:52 +01:00
ibaker
9631923440 Update SsaParser logic to show it never returns duration=UNSET
In an upcoming change I'm going to mark SSA subtitles as 'merge
replacement behavior', which will mean that
`CuesWithTiming.durationUs=C.TIME_UNSET` will not be permitted. This CL
makes it clear that `SsaParser` obeys that invariant.

PiperOrigin-RevId: 557504633
2023-08-16 22:00:38 +01:00