19114 Commits

Author SHA1 Message Date
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
samrobinson
c740b58efa Add API for injecting AudioMixer.Factory.
Rename AudioMixerImpl to DefaultAudioMixer.

Removes the AudioMixerImpl specific getOutputAudioFormat, as the caller
defines and sets this.

PiperOrigin-RevId: 555887722
2023-08-11 20:26:21 +00:00
rohks
a9f9537e5f Use utility method Util.usToMs(timeUs) to convert durations to Ms
PiperOrigin-RevId: 555578906
2023-08-11 20:24:54 +00:00
rohks
4282a6ecd7 Add buffer starvation(bs), deadline(dl), playback rate(pr), startup(su)
Enhanced the Common Media Client Data (CMCD) logging by incorporating additional fields:
* buffer starvation (bs) : CMCD-Status
* deadline (dl) and startup (su) : CMCD-Request
* playback rate (pr) : CMCD-Session

PiperOrigin-RevId: 555553357
2023-08-11 20:23:23 +00:00
claincly
c1913e8d89 Deprecate SingleFrameShaderProgram
PiperOrigin-RevId: 555450958
2023-08-11 20:22:03 +00:00
samrobinson
4d0fb4326a Simplify FakeAudioProcessor by extending BaseAudioProcessor.
Correct createOneSecondDefaultSilenceBuffer - It was returning an
incorrect buffer duration for non-mono channel counts.

PiperOrigin-RevId: 555439387
2023-08-10 12:34:07 +00:00
samrobinson
6045190103 Rename TestMuxer to CapturingMuxer to match other dumpable components.
See CapturingAudioSink, CapturingRenderersFactory etc.

PiperOrigin-RevId: 555437158
2023-08-10 12:32:31 +00:00
tofunmi
7a85236655 Update Mimetypes to include supported image mimetypes
PiperOrigin-RevId: 555433856
2023-08-10 12:31:29 +00:00
tofunmi
d4b452d475 Use ProgressiveMediaSource and period for images
PiperOrigin-RevId: 555424664
2023-08-10 12:30:29 +00:00
huangdarwin
fd5784455c Compositor: Add test for correct input timestamps.
To ensure that for each output bitmap from the compostor, the right input
timestamps were used.

Only applied on a subset of tests to avoid needing to upload+maintain
too many files/size in the test binary, especially when it would test
duplicate behavior

PiperOrigin-RevId: 555222530
2023-08-10 12:29:21 +00:00
samrobinson
79725fd332 Use TestMuxer.Factory as the holder of the Dumpable test muxer.
PiperOrigin-RevId: 555222322
2023-08-10 12:28:18 +00:00
claincly
7e12d7619a Avoid create short lived object
PiperOrigin-RevId: 555204528
2023-08-10 12:27:00 +00:00
huangdarwin
3351f0387f Test: Use larger pixel diff on real devices, smaller on emulators.
PiperOrigin-RevId: 555178875
2023-08-10 12:25:59 +00:00
kimvde
266dc5a6d6 Add video speed change effect
This adds an effect to change the speed of the video track. The speed
of the audio track can already be changed using a SonicAudioProcessor.

Issue: androidx/media#559
PiperOrigin-RevId: 555155418
2023-08-10 12:24:41 +00:00
rohks
cf9f048a3d Enhance getNextChunk() API to allow passing more information
Modifies the `ChunkSource.getNextChunk(long, long, List, ChunkHolder)` method in the `ChunkSource` interface to `ChunkSource.getNextChunk(LoadingInfo, long, List, ChunkHolder)`.

LoadingInfo contains additional parameters, including `playbackRate` and `lastRebufferRealtimeMs` in addition to the existing `playbackPositionUs`. The additional parameters will allow us to pass these information to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 555148768
2023-08-10 12:23:37 +00:00
andrewlewis
bf5c4d8078 Use golden data generated on emulator for tests based on london.jpg
PiperOrigin-RevId: 555148673
2023-08-10 12:22:31 +00:00