19842 Commits

Author SHA1 Message Date
samrobinson
84471813b6 Update TODO internal bug number.
PiperOrigin-RevId: 590884408
2023-12-14 03:43:16 -08:00
Copybara-Service
ab296ef686 Merge pull request #753 from stevemayhew:p-fix-issue-9347
PiperOrigin-RevId: 590862514
2023-12-14 02:05:35 -08:00
lpribanic
d52772dff8 Set image tile counts to what the manifest says
Vertical and horizontal tile counts inside Format used by ImageRenderer
used to be required to equal 1 and were set to 1 regardless of what
the manifest said.

This change removes the above requirement and sets the tile counts to
the values from the manifest.

PiperOrigin-RevId: 590608353
2023-12-13 08:37:06 -08:00
lpribanic
b1d65f6d00 Amend javadocs for ImageOutput methods
PiperOrigin-RevId: 590607537
2023-12-13 08:33:55 -08:00
ibaker
9a766161ee Combine 'matching' versions in media3 bug template
#minor-release

PiperOrigin-RevId: 590586491
2023-12-13 07:14:21 -08:00
tonihei
7a702870f6 Add test and release notes 2023-12-13 14:48:35 +00:00
Steve Mayhew
64840159d6 Fixes issue #9347 - jump to live on seek to 0
Using 0 as the unset prepare position is the root cause of a number of issues,
as outliine in the ExoPlayer issue https://github.com/google/ExoPlayer/issues/7975

The premise of this fix is that once the prepare override is used (the initial call
to `selectTracks()`) it is never needed again, so simply invalidate it after use.
2023-12-13 14:48:35 +00:00
huangdarwin
a15dfd75be GL: Request OpenGL ES 3.0 context on API 29+, with fallback to 2.0.
Despite GL 3.0 not being required on API 29+, it is experimentally
determined to always be supported on our testing devices, on API 29+.

That said, still fall back to OpenGL 2.0 if 3.0 is not supported,
just in case.

PiperOrigin-RevId: 590569772
2023-12-13 06:01:08 -08:00
tofunmi
2fa5430417 Update OptimizationResult to specify different reasons for abandonment
PiperOrigin-RevId: 590530694
2023-12-13 03:22:55 -08:00
ibaker
6aeaad26ad Clean-up multi-line strings in YAML issue templates
* If we don't want any newlines in the result, it's better to use `>`
* If we want newlines (e.g. for markdown) then we should ensure the
  string **only** contains the newlines we want, because GitHub (unlike
  other markdown renderers) preserves single newlines in the output,
  leading to ugly newlines dictated by the source.

Also remove a markdown-style link that isn't renderered as markdown.

PiperOrigin-RevId: 590309749
2023-12-12 13:11:51 -08:00
tofunmi
37def3679f Trim optimization: fallback on format mismatches
Manual testing: tested manually with pixel 4a

PiperOrigin-RevId: 590284361
2023-12-12 11:53:43 -08:00
sheenachhabra
ee1147ffe1 Remove unused method from TrackMetadataProvider interface
PiperOrigin-RevId: 590242668
2023-12-12 10:01:46 -08:00
Copybara-Service
f465efeefd Merge pull request #864 from v-novaltd:dsparano-exo129_2
PiperOrigin-RevId: 590234505
2023-12-12 09:37:41 -08:00
ibaker
5580b78b13 Fix VorbisComment.populateMediaMetadata key comparison to ignore case
Issue: androidx/media#876

#minor-release

PiperOrigin-RevId: 590215918
2023-12-12 08:43:02 -08:00
tonihei
8e33fbd536 Deprecate RAW_RESOURCE_SCHEME and util method
It's better to use the generic Android resource scheme which
is at least as powerful as our own one.

Issue: androidx/media#868
PiperOrigin-RevId: 590168919
2023-12-12 05:34:09 -08:00
Copybara-Service
27f437b65a Merge pull request #867 from equeim:ndk-r26
PiperOrigin-RevId: 590142275
2023-12-12 03:48:08 -08:00
sheenachhabra
0660b55ceb Move doInterleave() call to Mp4Writer
`Mp4Writer` receives all the tracks/samples and then it adds them to
corresponding `Track` object. As the `Track` object is primarily to hold
track specific data and `Mp4Writer` is responsible for interleaving related
logic, the call to `doInterleave` should be with `Mp4Writer`. The `Track`
object should just act like a data holding class.
This will also help in reusing `Track` class for fragmented MP4 implementation.

PiperOrigin-RevId: 590138002
2023-12-12 03:32:18 -08:00
tonihei
ce67b4d723 Add release notes 2023-12-12 10:42:35 +00:00
Alexey Rochev
38b5b03ebb Fix error with NDK r26 2023-12-12 10:40:27 +00:00
Alexey Rochev
6874cc80cf ffmpeg: add support of specifying Android ABI version when building FFmpeg
Also add proper error message when using NDK that doesn't support requested ABI version.
2023-12-12 10:40:27 +00:00
samrobinson
90a0cbdf3d Fix handling of repeated EOS in SilenceSkippingAudioProcessor.
Issue: androidx/media#712
PiperOrigin-RevId: 589882412
2023-12-11 11:17:14 -08:00
ibaker
d356d88c4f Improve test dump output for role and selection flags
PiperOrigin-RevId: 589878576
2023-12-11 11:05:40 -08:00
bachinger
7f9b02080a Make the media notification controller marker key visible
An app that uses the `MediaSession` without a `MediaSessionService` may
want to connect a media notification controller on it own. To avoid apps
using a string literal, the key should be exposed as public.

PiperOrigin-RevId: 589875603
2023-12-11 10:57:00 -08:00
ibaker
3e5ef51594 Remove empty container/src/androidTest directory
PiperOrigin-RevId: 589870662
2023-12-11 10:41:51 -08:00
ibaker
5266c71b3a Fix handling of multiple HEVC tracks in JPEG motion photos
The MP4 data in JPEG motion photos can contain multiple `video/hevc` tracks, but only the first is at a playable frame rate while the others are low-fps, high-res tracks designed for specific use-cases (not direct video playback).

ExoPlayer currently selects the unplayable track by default, because it
has a higher resolution. This change introduces a flag to
`Mp4Extractor` that results in the first video track being marked as
`ROLE_FLAG_MAIN`, and all subsequent video tracks `ROLE_FLAG_ALTERNATE`
- this then results in the playable lower-res track being selected by
default.

PiperOrigin-RevId: 589832072
2023-12-11 08:31:13 -08:00
christosts
4c4c5f6a90 CompositionVideoSinkProvider: apply rotation effects per video
There is a bug in CompositionVideoSinkProvider where the rotation
effect is applied only on the first video and the same effect
is applied on subsequent videos without checking if the next
items in the playlist must be rotated.

The bug applies only on devices with API < 21.

PiperOrigin-RevId: 589823797
2023-12-11 07:56:50 -08:00
tonihei
eb2092bc8b Formatting fixes and release notes 2023-12-11 15:12:50 +00:00
Daniele Sparano
6f5187a34b Format to wake up PR 2023-12-11 14:28:11 +00:00
Daniele Sparano
4a17ca7600 Add basic h264 sample unit test to ensure correct sample flags, including key frames 2023-12-11 14:28:11 +00:00
Daniele Sparano
d4af13803a Fix H264 reader key frame detection 2023-12-11 14:28:11 +00:00
ibaker
379cb3ba54 Tighten the handling of validDataChannelTimeoutMs in Cea608Parser
This matches the documented requirements for this parameter.

PiperOrigin-RevId: 589799256
2023-12-11 06:05:53 -08:00
tonihei
00c7a9bcbb Keep playback thread blocked until next action with playUntilPosition
We currently pause playback to prevent further progress while the
app thread runs assertion and triggers additional actions. This is
not ideal because we do not actually want to pause playback in
almost all cases where this method used.

This can be improved by keeping the playback thread blocked and only
unblock it the next time the app thread waits for the player (either
via RobolectricUtil methods or by blocking the thread itself). To
add this automatic handling, this change introduces a new util class
for the tests that can keep the list of waiting threads statically
(because the access to this logic is spread across multiple independent
classes).

PiperOrigin-RevId: 589784204
2023-12-11 04:45:31 -08:00
tofunmi
00d5b6ec99 TransformerEndToEndTest: replace /*testId=*/ with variable
PiperOrigin-RevId: 589765715
2023-12-11 03:14:34 -08:00
huangdarwin
1ebe099685 Test: Make a method scope private.
For clarity.

PiperOrigin-RevId: 589758781
2023-12-11 02:43:25 -08:00
tianyifeng
b2a673d521 Move preload components to androidx.media3.exoplayer.source.preload
PiperOrigin-RevId: 589455479
2023-12-09 13:41:55 -08:00
ibaker
224dad3988 Remove AnalyticsListener as a public super-type of ExoHostedTest
Move the `AnalyticsListener` implementation to a private inner class.

This avoids polluting the public API of `ExoHostedTest`, especially as
it's designed to be extended.

PiperOrigin-RevId: 589188113
2023-12-08 11:13:18 -08:00
sheenachhabra
ac67f739d4 Specify which input file has B-frames in Transformer demo app
For out of order B-frames, the samples comes out of order and hence
presentation timestamps are not strictly increasing.
This can be verified by adding following assertion in `writeSampleData()` API
either in `MuxerWrapper` or in `Muxer API`.
```
checkArgument(
          bufferInfo.presentationTimeUs > lastSamplePresentationTimeUs,
          "Out of order B-frames are not supported");
```

PiperOrigin-RevId: 589152093
2023-12-08 09:23:42 -08:00
samrobinson
1471528176 Change AudioGraph #release to #reset, resetting internal state.
PiperOrigin-RevId: 589113634
2023-12-08 06:36:32 -08:00
tofunmi
c5c8e988e8 Abandon trim optimization when transcoding effects are set
PiperOrigin-RevId: 588839072
2023-12-07 10:39:38 -08:00
samrobinson
ab798659d9 Request specific AudioFormat from AudioGraphInputs on creation.
Also adds an alternate way to configure the AudioGraph.

Apps should no longer need to ensure that inputs have the same sample
rate.

PiperOrigin-RevId: 588747431
2023-12-07 04:42:03 -08:00
andrewlewis
c014ba9d5f Use API 33 constants for DV levels
PiperOrigin-RevId: 588740855
2023-12-07 04:15:19 -08:00
tofunmi
be5b29d92d Update ExportResult.OptimizationResult options
Added a new ABANDONED option so one can tell the difference between when the optimization has been requested but not applied vs not requested at all. also changed the ordering do better represent the hierarchy of failure modes

PiperOrigin-RevId: 588720513
2023-12-07 02:52:16 -08:00
tofunmi
cd346ca14d Transformer: Add support for transmuxing audio in trim optimization
PiperOrigin-RevId: 588711597
2023-12-07 02:18:21 -08:00
christosts
faeff17a4c Fix bug in CompositingVideoSinkProvider.isInitialized()
Fix a bug where CompositingVideoSinkProvider.isInitialized() returns
true even after releasing the CompositingVideoSinkProvider.

PiperOrigin-RevId: 588481744
2023-12-06 11:01:45 -08:00
christosts
073ee8a1d0 Move instantiation of CompositingVideoSinkProvider
This change moves the instantiation of the CompositingVideoSinkProvider
out of MediaCodecVideoRenderer so that the composition preview player can
re-use the CompositingVideoSinkProvider instance for driving the rendering of
images.

The main point of the change is the ownership of the
VideoFrameReleaseControl, which decides when a frame should be rendered
and so far was owned by the MediaCodecVideoRenderer. With this change,
in the context of composition preview, the VideoFrameReleaseControl
is no longer owned by MediaCodecVideoRenderer, but provided to it.

This way, the CompositingVideoSinkProvider instance, hence the
VideoFrameReleaseControl can be re-used to funnel images into the
video pipeline and render the pipeline from elsewhere (and not
MediaCodecVideoRenderer).

PiperOrigin-RevId: 588459007
2023-12-06 09:52:43 -08:00
ibaker
bd19953ac9 Split Cue.toBundle into serializable and binder-based variants
The serializable form is used when we need to serialize the result into
bytes in the sample queue. The binder-based (ultimately
filedescriptor-based) form is used for
session/controller IPC, in order to avoid sending the bitmap bytes over
the IPC.

Issue: androidx/media#836

#minor-release

PiperOrigin-RevId: 588420836
2023-12-06 07:35:34 -08:00
huangdarwin
a98052b3fc Test: Mention expected bitmap in assertion message.
This helped me debug which bitmap was actually failing. Otherwise, you need to clear all bitmaps on the device relating to this test, then adb pull all bitmaps and see the last uploaded one to see, which is much more confusing.

PiperOrigin-RevId: 588374081
2023-12-06 04:17:37 -08:00
samrobinson
757585ce6d Release MuxerWrapper in every test (in an @After block).
PiperOrigin-RevId: 588110566
2023-12-05 10:13:27 -08:00
ibaker
6360082b87 Add extractor and playback tests for Pixel JPEG motion photo
This image has two video tracks in the MP4 data, one is a 'real' video
which we want to play by default, and the other is a low-fps video track
which isn't intended to be directly played, it's encoded in HEVC for
compression and decoding efficiency.

This test demonstrates ExoPlayer's current behaviour default extraction
and playback, which results in selecting the high-res, low-fps track
(actually single sample in this example), instead of playing the actual
video.

PiperOrigin-RevId: 588068908
2023-12-05 07:46:19 -08:00
ibaker
d4fe3fe318 Add Robolectric e2e test support for HEVC content
PiperOrigin-RevId: 588055594
2023-12-05 06:52:39 -08:00