19129 Commits

Author SHA1 Message Date
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
ibaker
d3894e6691 Add a default no-op implementation for SubtitleParser.reset
Most implementations were already no-ops.

PiperOrigin-RevId: 557503628
2023-08-16 21:59:19 +01:00
ibaker
d42c58f152 Fix DvbParser handling of pageComposition = null
This `DvbParser` was updated to implement the new `SubtitleParser`
interface in 2261756d3a.

This method used to return a `List<Cue>`, but now it returns a
`List<CuesWithTiming>`, which is closer to `List<List<Cue>>`. The
previous method returned an empty list, meaning a single 'event' with
no cues. After the change above the method still returns an empty list,
but that now means 'no events'. In order to maintain the old behaviour,
this change updates it to return a single-item list containing an empty
list of cues.

PiperOrigin-RevId: 557502261
2023-08-16 21:57:58 +01:00
tofunmi
a801f8d3f5 Add ImageDecoder.Factory
PiperOrigin-RevId: 557498045
2023-08-16 21:56:47 +01:00
jbibik
2156f94480 Bump media3 version to 1.2.0-alpha01 and update RELEASENOTES
#minor-release

PiperOrigin-RevId: 557487465
2023-08-16 21:55:35 +01:00
ibaker
eb63ed5871 Add test for Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS
This test uses an existing CBR test asset, and shows that (as expected)
`isSeekable = true` even in the `unknown_length` dump file.

PiperOrigin-RevId: 557455364
2023-08-16 14:34:21 +01:00
jbibik
14e5b5b865 Mark CompositionPlayerTest as ClosedSource and copybara exclusion
#minor-release

PiperOrigin-RevId: 557416683
2023-08-16 14:33:02 +01:00
ibaker
c1a7d0f3aa Exclude controller test app from @UnstableApi lint
This app is designed to exercise various session/controller interactions
rather than be a demo/template app to show how to implement a 'normal'
app.

PiperOrigin-RevId: 557399828
2023-08-16 14:31:37 +01:00
tonihei
7b663eea2f Remove MediaPeriodId from common module
It was moved there temporarily to support another temporary move
of ExoPlaybackException. See <unknown commit>.

Since then, ExoPlaybackException has been moved back to ExoPlayer
and we can do the same with MediaPeriodId, which only makes sense
in the context of the ExoPlayer module.

PiperOrigin-RevId: 557159381
2023-08-16 14:30:08 +01:00
samrobinson
9670c74044 Add parameterized test for audio export.
Verifies export completes successfully for every permutation.

PiperOrigin-RevId: 557157527
2023-08-16 14:28:35 +01:00
tonihei
597de8706d Show play button during playback suppression by default
This changes the default logic of shouldShowPlayButton to show a play
button while the playback is temporarily suppressed. This helps to
provide better UI feedback to the fact that playback stopped and
provides a quick way for users to override the suppression and attempt
to restart playback.

Some apps may want to keep the legacy behavior depending on their app's
needs. Hence, we also add a config parameter to set this behavior both
in MediaSession and our default UI components.

Issue: google/ExoPlayer#11213
PiperOrigin-RevId: 557129171
2023-08-15 17:15:38 +01:00
samrobinson
86b9fdae63 Merge TransformerAudio E2E tests into Transformer E2E class.
PiperOrigin-RevId: 557113117
2023-08-15 14:38:16 +01:00
tofunmi
cacf9b33b6 Add image decoding interfaces and capabilities
PiperOrigin-RevId: 557108362
2023-08-15 14:36:41 +01:00
tofunmi
e65d104330 Add image package-info.java
PiperOrigin-RevId: 557080845
2023-08-15 14:35:13 +01:00
samrobinson
ab8c5a6b63 Clarify & reduce the ShadowMediaCodec configurations added by default.
PiperOrigin-RevId: 556875714
2023-08-14 20:35:06 +01:00
tonihei
3ccb920930 Update bypass decode-only logic to timestamp-based pattern
This aligns the bypass code with the MediaCodec logic to not
use buffer.isDecodeOnly and instead rely on a timestamp
comparison with the last reset time. Overall, the change should
not introduce a functional difference and is covered by existing
end-to-end tests with bypass playbacks.

Splitting bypass batch buffers by decoder-only flag is
technically wrong for formats where not every buffer is a
keyframe, and this change also leaves a TODO to explain this
known shortcoming.

PiperOrigin-RevId: 556800038
2023-08-14 17:21:10 +01:00
ibaker
a48b99214e Enable @UnstableApi lint in session demo app and add needed @OptIn
PiperOrigin-RevId: 556779020
2023-08-14 17:19:58 +01:00
tianyifeng
08067eff14 Fix several API level checks
PiperOrigin-RevId: 556751372
2023-08-14 17:18:41 +01:00
tianyifeng
dca4f1a9db Fix Media3 1.1.1 release notes
PiperOrigin-RevId: 556735572
2023-08-14 11:07:51 +00:00
Googler
db6f043cb1 Rollback of f5a6ecdda1
PiperOrigin-RevId: 556718678
2023-08-14 11:06:30 +00:00
huangdarwin
4ce83d88e5 Alpha: Don't use deprecated SingleFrameGlShaderProgram interface.
PiperOrigin-RevId: 555990321
2023-08-11 20:41:50 +00:00
tianyifeng
1e2a5cd06a Bump version numbers to Media3 1.1.1 and ExoPlayer 2.19.1
PiperOrigin-RevId: 555987303
2023-08-11 20:40:35 +00:00
tofunmi
48de9fa916 Add VFP.queueInputBitmap api accepting timestamps
PiperOrigin-RevId: 555970312
2023-08-11 20:39:20 +00:00
tonihei
418edda285 Fix capacity overflow logic in findSampleAfter
The method was recently introduced and only searched for matching
samples up to index==length. However, SampleQueue uses a circular
array to index its data and the search should continue until
relativeStartIndex+length, while also handling the overflow
in the circular array.

The tests for seeking didn't cover these overflow cases yet
because they always started writing data in an empty SampleQueue.
This can be fixed by prewarming the queue with placeholder data
to force using the overflow logic in the various seek methods.

PiperOrigin-RevId: 555963011
2023-08-11 20:38:05 +00:00
claincly
2980c30ace Converging BlankFrameProducer
`BlankFrameProducer` was originally internal to
`DefaultVideoFrameProcessorVideoFrameRenderingTest`. We later copied it in
c221958889. This CL converges the usages.

PiperOrigin-RevId: 555953620
2023-08-11 20:36:44 +00:00
tianyifeng
b24f7678bb Update release notes for Media3 1.1.1
PiperOrigin-RevId: 555951054
2023-08-11 20:35:15 +00:00
tonihei
1b085474e6 Rephrase format support javadoc to avoid Renderer reference
This is leftover from the fact that these constants were used
for ExoPlayer renderers only initially, but are now more generally
used to indicate format playback support.

PiperOrigin-RevId: 555951001
2023-08-11 20:34:03 +00:00
rohks
45348f1576 Utilise existing rate unset representation C.RATE_UNSET_INT
Use `C.RATE_UNSET_INT` instead of introducing `Long.MIN_VALUE` as the default value for rate parameters. Modifies default behaviour of the `TrackSelection.getLatestBitrateEstimate()` method and the `measuredThroughputInKbps` parameter in `CmcdHeadersFactory.CmcdRequest`.

PiperOrigin-RevId: 555939420
2023-08-11 20:32:41 +00:00
huangdarwin
0466bd7957 Effect: Add alpha effect.
This effect can scale Alpha values.

This is needed for testing Compositor, and coincidentally was requested
by a partner in the past. This also will generally be more useful in
full multi-asset, where we may want to have one input have different alpha
values than another

Also, update fragment_shader_copy_es2.glsl to not throw away alpha values.
This means ThumbnailStripShaderProgram (the only place this glsl is used) will
consider input alpha and output alpha appropriately

PiperOrigin-RevId: 555915092
2023-08-11 20:31:21 +00:00
rohks
1e2e225c01 Refactor CMCD headers construction for efficiency and readability
Optimises the construction of Common Media Client Data (CMCD) headers by eliminating the use of trailing commas. Instead of appending values directly to a StringBuilder, it now adds values to a list and joins them using a comma separator. While the primary focus is on enhancing readability and robustness, it's worth noting that in certain instances, removing usages of `formatInvariant`, there are also performance improvements.

PiperOrigin-RevId: 555911498
2023-08-11 20:30:06 +00:00
christosts
f5a6ecdda1 Implement the CompositingVideoSinkProvider
This is the first iteration for the CompositingVideoSinkProvider which
is basically a copy of MediaCodecVideoRenderer's
VieoFrameProcessorManager.

The MediaCodecVideoRenderer now instantiates a
CompositingVideoSinkProvider instead of a VieoFrameProcessorManager.

PiperOrigin-RevId: 555903928
2023-08-11 20:28:52 +00:00
rohks
171e1a1e42 Allow UNSET values in CmcdHeadersFactory's nested class setters
Also added `checkArgument()` in setters that lacked it.

PiperOrigin-RevId: 555900170
2023-08-11 20:27:32 +00:00