22912 Commits

Author SHA1 Message Date
dancho
f8f66bdfaa Mp4Muxer: disable sample batching and copying by default.
When sample batching is disabled, copying of the ByteBuffer data
is not necessary as samples are written as they arrive.
Copying of the BufferInfo is necessary because the info is needed
for writing the moov atom.

The input ByteBuffer can be in little endian order, or have its
position set. AnnexBUtils now ensures big endian order before
inspecting bytes, and supports reading from a non-zero position.

This change reduces the amount of memory allocations by Mp4Muxer
in its default configuration

PiperOrigin-RevId: 723401822
2025-02-05 01:05:22 -08:00
shahddaghash
05e66d9cf6 Fix metrics codec names collection
Previously, the codec names for the input were collected from `Format.codecs` which return the RFC 6381 string not the codec name used. This was changed to retain the decoder name from `ProcessedInput` instead.

PiperOrigin-RevId: 723129667
2025-02-04 10:05:37 -08:00
Copybara-Service
a19f68c87e Merge pull request #2107 from MGaetan89:issue_384699964
PiperOrigin-RevId: 723124733
2025-02-04 09:53:43 -08:00
sheenachhabra
ae3f962769 Extract "is last item in sequence" check
This improves readability.

PiperOrigin-RevId: 723116229
2025-02-04 09:27:48 -08:00
Gaëtan Muller
a4cc0f2384
Replace Util.MODEL with Build.MODEL 2025-02-04 15:34:33 +01:00
Gaëtan Muller
2aab921aa2
Replace Util.MANUFACTURER with Build.MANUFACTURER 2025-02-04 15:04:08 +01:00
Gaëtan Muller
d0a3d31e56
Replace Util.DEVICE with Build.DEVICE 2025-02-04 15:00:22 +01:00
tianyifeng
3e56d2a6fb Add ProgressiveMediaSource.Listener interface and onSeekMap event
This will allow the listeners who are interested in the `SeekMap` to get informed once the period has done the preparation.

PiperOrigin-RevId: 723027718
2025-02-04 04:30:29 -08:00
michaelkatz
decfb9b0a9 Refactor MediaCodecVideoRenderer to use a Builder
MediaCodecVideoRenderer is becoming unwieldy with the numerous constructors and optional settings. This refactors MediaCodecVideoRenderer to use a builder pattern for simplicity.

PiperOrigin-RevId: 723022129
2025-02-04 04:08:56 -08:00
shahddaghash
1431497e7f Pass output media item information to MediaItemInfo
PiperOrigin-RevId: 723007882
2025-02-04 03:10:24 -08:00
Googler
6e9a2cc0cd Rollback of 79b61d05a6
PiperOrigin-RevId: 722741988
2025-02-03 11:55:06 -08:00
Googler
aaa7e9e3cb Open visibility to HttpDataSourceTestEnv constants
PiperOrigin-RevId: 722712331
2025-02-03 10:37:43 -08:00
dancho
93c129449a Adjust threshold for analyzeVideo performance test
PiperOrigin-RevId: 722651555
2025-02-03 07:33:53 -08:00
shahddaghash
35d5bd9675 Pass output media items's video size and frame count to MediaItemInfo
PiperOrigin-RevId: 722613631
2025-02-03 05:10:48 -08:00
Googler
4ed9abd05b Rollback of 0fb4e3ba11
PiperOrigin-RevId: 722585306
2025-02-03 03:18:59 -08:00
tonihei
82cb1d8ac7 Move AudioBecomingNoisyManager system calls off main thread
PiperOrigin-RevId: 722569306
2025-02-03 02:18:02 -08:00
shahddaghash
5f4c30c431 Add color changing for Text overlay effect
This includes adding a colors dropdown menu for the text color.

PiperOrigin-RevId: 721830591
2025-01-31 10:59:16 -08:00
shahddaghash
9c0a9c19b7 Add Custom Text Overlay to Effect Demo
It includes entering a custom text and setting the alpha scale. When the effect is applied, it shows the text in the center of the screen. A following change will include changing the color of the text.

PiperOrigin-RevId: 721828892
2025-01-31 10:54:50 -08:00
rohks
99f2a9f152 Remove publishing for media3-ui-compose temporarily
Disabled until we find a way to exclude it from media3 Javadoc prebuilts

PiperOrigin-RevId: 721765815
2025-01-31 07:27:59 -08:00
ivanbuper
79b61d05a6 Rollback of 492574bded
PiperOrigin-RevId: 721758531
2025-01-31 06:56:13 -08:00
Googler
d6844699c5 Recognize QC's secure MV-HEVC decoder.
PiperOrigin-RevId: 721749833
2025-01-31 06:20:49 -08:00
Googler
0fb4e3ba11 Add DebugViewEffect
Also updated DefaultVideoFrameProcessor to create GlShaderPrograms with the working ColorInfo rather than the output ColorInfo.

PiperOrigin-RevId: 721748002
2025-01-31 06:13:57 -08:00
claincly
2b07ece0e5 Allow sequences to have non-matching durations
And only repeat the secondary sequence if `isLooping` is set to true

PiperOrigin-RevId: 721713830
2025-01-31 03:46:15 -08:00
tonihei
39d0881083 Add option to ClippingMediaSource to clip unseekable media
This means we need convert some of the assertions in
ClippingMediaPeriod to contrain the output value to clipped
range instead, because unseekable media will return zero
as a start and seek position in all cases.

PiperOrigin-RevId: 721463824
2025-01-30 11:40:46 -08:00
tonihei
df575a8d19 Add ClippingMediaSource.Builder
This prevents complicated constructor changes when we add new options.

PiperOrigin-RevId: 721415339
2025-01-30 09:23:49 -08:00
rohks
344214d711 Fix RELEASENOTES based on style guide
PiperOrigin-RevId: 721401564
2025-01-30 08:36:39 -08:00
Copybara-Service
fc1d133454 Merge pull request #1905 from khouzam:placeholderSurface
PiperOrigin-RevId: 721367514
2025-01-30 06:34:26 -08:00
shahddaghash
9f96fe81f3 Pass video data space to output's MediaItemInfo
The DataSpace contains the Color Standard, Range, and Transfer.

PiperOrigin-RevId: 721341719
2025-01-30 04:39:24 -08:00
microkatz
ad18ae9c42 Added release note 2025-01-30 11:40:56 +00:00
Gilles Khouzam
8466a957c3 Make MediaCodecVideoRenderer::shouldUsePlaceholderSurface protected.
This enables a derived renderer to disable the placeholder surface.
2025-01-30 11:35:39 +00:00
rohks
045b8e6a52 Fix lint warnings in RELEASENOTES
PiperOrigin-RevId: 721326280
2025-01-30 03:35:04 -08:00
shahddaghash
3f4e0bdb04 Report output's MediaItemInfo to EditingEndedEvent
Most of the values for the output `MediaItemInfo` will be retained from the `ExportResult`, so it's now passed to `onExportSuccess` and `onExportError` directly. For now, the duration of the ouput is recorded for metrics, and more values will be added in the following CLs.

PiperOrigin-RevId: 721324689
2025-01-30 03:27:25 -08:00
tonihei
17100259cd Move Util.getCountryCode off main thread in DefaultBandwidthMeter
PiperOrigin-RevId: 721293354
2025-01-30 01:23:56 -08:00
tonihei
6b31b4620c Move NetworkTypeObserver operations off main thread
PiperOrigin-RevId: 721291681
2025-01-30 01:17:22 -08:00
kimvde
9af43c7381 CompositionPlayer: skip decode-only frames upstream of the VideoGraph
This is necessary for prewarming. With prewarming, in a sequence of 2
videos, the second renderer is enabled before the first one is disabled,
and decode-only frames should be skipped before the second renderer is
started. The problem is that the second renderer will forward frames to
a BufferingVideoSink before it is started, which  will delay the frame
handling and therefore not skip the frame before the renderer is
started.

PiperOrigin-RevId: 721032049
2025-01-29 10:44:56 -08:00
rohks
3c0e2ee198 Suppress UseSdkSuppress warning in MediaExtractorContractTest
The fix is included in Android Gradle Plugin `8.9.0-alpha05`. Remove this suppression after upgrading.

PiperOrigin-RevId: 721009745
2025-01-29 09:42:37 -08:00
rohks
c9a936e153 Bump Media3 version to 1.6.0-alpha02
#cherrypick

PiperOrigin-RevId: 720990835
2025-01-29 08:43:21 -08:00
ivanbuper
fc6df77831 Remove deprecated androidx.media3.exoplayer.audio.SonicAudioProcessor
Also, make `androidx.media3.common.audio.SonicAudioProcessor` final.

PiperOrigin-RevId: 720987023
2025-01-29 08:30:09 -08:00
rohks
98f52a1dbb Rollback of 5c3c3b91f3
PiperOrigin-RevId: 720968647
2025-01-29 07:33:56 -08:00
rohks
6e53d9b3bd Update release notes for Media3 1.6.0-alpha02 release
#cherrypick

PiperOrigin-RevId: 720963785
2025-01-29 07:16:55 -08:00
rohks
dfef16d5c6 Restrict test to API 24+ in MediaExtractorContractTest
`MediaExtractor.setDataSource(AssetFileDescriptor afd)` requires API 24+.

#cherrypick

PiperOrigin-RevId: 720943416
2025-01-29 06:05:39 -08:00
rohks
e15438322d Fix ArrayIndexOutOfBoundsException in MP4 edit lists
The exception occurred when an edit list started at a non-sync frame with no preceding sync frame. The fix searches forward for the next sync frame in such cases, preventing the out-of-bounds access.

Issue: androidx/media#2062

#cherrypick

PiperOrigin-RevId: 720642687
2025-01-28 11:13:38 -08:00
dancho
bb37aad170 Add an option to use different texture filtering
Add an option to GlMatrixTransformation to choose the OpenGL texture
minification filter.
When mipmaps are requested, mipmaps are generated with
`glGenerateMipmap()`.

PiperOrigin-RevId: 720629807
2025-01-28 10:44:26 -08:00
shahddaghash
bb9b3bd660 Pass codec names of input media items to MediaItemInfo
PiperOrigin-RevId: 720579315
2025-01-28 08:12:42 -08:00
rohks
8d22482f79 Add MediaExtractor contract test structure with one basic test
Additional tests will be added in future changes.

PiperOrigin-RevId: 720555580
2025-01-28 06:44:40 -08:00
tonihei
ddcf455d03 Convert context dependent TrackSelectionParameters to boolean
This avoids that these settings have to be resolved inline,
potentially blocking the main thread. They can be resolved at
the time of track selection on a background thread instead.

As a side effect, we can also remove the context parameter from
the Builder. Having the Context in the Builder is also a bad sign
in the first place because it implies the potentially blocking
calls can happen.

PiperOrigin-RevId: 720523139
2025-01-28 04:26:15 -08:00
shahddaghash
c058d97a97 Pass input media items audio information to MediaItemInfo
Audio `sampleMimeType`, `channelCount`, and `sampleRate` were retained from `ExportResult.ProcessedInput`'s audio format.

PiperOrigin-RevId: 720500611
2025-01-28 02:54:32 -08:00
tonihei
706c363104 Remove potentially blocking calls from DefaultTrackSelector UI thread
The calls to Util.isTV and the interactions with the spatializer are
potentially blocking and were triggered from the constructor,
setAudioAttributes and release.

setAudioAttributes and release are both documented to be called by
the Player and should be triggered on the playback thread anyway.

The constructor initialization can be delayed until the spatializer
might be needed to avoid the blocking call.

The threading clean-up also allows to remove the lock from the
audioAttributes and the spatializer fields as they are now
accessed on the playback thread only.

PiperOrigin-RevId: 720488979
2025-01-28 02:09:28 -08:00
shahddaghash
80e6fa2aa7 Separate ProcessedInput's format into audio and video
Before the change, `SequenceAssetLoader#onTrackAdded` was being called twice, for audio and video. `ExportResult.ProcessedInput` took one format, which was the latest to be written. The change leads to capturing both, the audio and video formats of the input, and prevents the issue of a format overwriting the other.

PiperOrigin-RevId: 720487697
2025-01-28 02:04:02 -08:00
kimvde
0b9ca1e70b Ignore 1 test in CompositionMultipleSequencePlaybackTest
playback_sequencesOfVideos_effectsReceiveCorrectTimestamps is failing
for prewarming. The following is happening:
- For prewarming, there are 2 alternating video renderers per sequence.
- When the first MediaItem ends (for both sequences), signalEndOfInput
is not called on the InputVideoSink (which is expected).
- The DefaultVideoCompositor doesn't receive the end-of-input-source
signal (which is also expected).
- As a result, the DefaultVideoCompositor never outputs the last frame
because it waits for more input frames to be fed.
- The VideoGraph thus doesn't output the last frame either, and the
first video renderer never ends.
- This causes playback to get stuck.

This is similar to the problem of supporting multiple video sequences
with images and videos in CompositionPlayer.

PiperOrigin-RevId: 720106413
2025-01-27 03:50:32 -08:00