21235 Commits

Author SHA1 Message Date
ibaker
3e8ecbf564 Remove @DoNotInline annotations
This is no longer needed now our `compileSdk` implies a new-enough AGP
which does this out-lining automatically via R8. See also
https://issuetracker.google.com/345472586#comment7

There's no plan to remove the `ApiXXX` classes, but no new ones need
to be added.

PiperOrigin-RevId: 675940634
2024-09-18 04:47:39 -07:00
kimvde
2951a2599c Apply all video Composition effects to single sequence exports
PiperOrigin-RevId: 675933601
2024-09-18 04:18:55 -07:00
claincly
fd3d8e1782 Add RATE_UNSET option to encoder performance setting
This is to allow not setting the MediaFormat OPERATING_RATE and PRIORITY
altogether. The current behvaiour, if left the value `UNSET`, it'll apply the
our optimizations, but apps might want to disable this optimization.

PiperOrigin-RevId: 675923909
2024-09-18 03:40:13 -07:00
michaelkatz
f0fb386224 Add workaround for Galaxy Tab S7 FE device PerformancePoint issue
The Galaxy Tab S7 FE has a device issue that causes 60fps secure H264 streams to be marked as unsupported. This CL adds a workaround for this issue by checking the CDD required support for secure H264 in addition to the current check on standard H264. If the provided performance points do not cover the CDD requirement of support 720p H264 at 60fps, then it falls back to using legacy methods for checking frame rate and resolution support.

Issue: androidx/media#1619
PiperOrigin-RevId: 675920968
2024-09-18 03:29:10 -07:00
claincly
69da26935e Fix logic that detects the last media item in Sequence
After the change in a879bc2154, the Sequence won't have repeated
EditedMediaItems. Thus if the sequence is looping, the last EditedMediaItems
in the Sequence object might not corresponds to the last item in the "logical"
sequence.

PiperOrigin-RevId: 675912197
2024-09-18 02:54:11 -07:00
ibaker
3facfbf542 Assert baseDataSourceFactory non-null in DefaultDataSource.Factory
This gives a faster/clearer failure for Issue: androidx/media#1718.

PiperOrigin-RevId: 675896262
2024-09-18 02:00:03 -07:00
hoisie
dc66c9160c Update some APIs to Use real types in ShadowNotificationManager
NotificationChannel and NotificationChannelGroup are public APIs that were
added in Android O, so at this point it is okay to have them appear in API
signatures.

PiperOrigin-RevId: 675756005
2024-09-17 16:47:36 -07:00
Googler
087e75850e Add suitable output checker tests relevant for API 35+ in media3-ui
PiperOrigin-RevId: 675678257
2024-09-17 13:05:43 -07:00
sheenachhabra
acb8e71c6e Set hasMuxedTimestampZero to true only when its muxed
The muxer might not have accepted the first sample, if it
is waiting for audio track.

This bug causes issue when

1. VideoSampleExporter gives first sample (timestamp = 0) to the muxer.
2. Muxer does not write it because its waiting for audio track.
3. The video pipleline has processed all the sample and they are ready
to be consumed.
4. VideoSampleExporter fetches the next available sample from encoder (which is still with timestamp = 0) but it changes its timestamp to last timestamp because VideoSampleExporter thinks it has muxed the sample at timestamp zero, but in reality it hasn't. This is because the flag `hasMuxedTimestampZero` is set when queueing the input, rather than actually muxing the input.

This scenario can happen when video is processed much faster than
the audio.

PiperOrigin-RevId: 675565603
2024-09-17 07:53:22 -07:00
Googler
e1c4ecf2d3 Add suitable output checker tests relevant for API 35+ in ExoPlayerTest
PiperOrigin-RevId: 675547156
2024-09-17 06:45:15 -07:00
rohks
9bc89ae989 Ensure track indices are only added when samples are committed
Previously, track IDs were added to `trackIndicesPerSampleInQueuedOrder`
even when the sample was not committed. This caused issues where attempts
to read samples from the `SampleQueue` returned `C.RESULT_READ_NOTHING`,
which led to an exception being thrown due to the assumption that samples
were available to read.

This fix updates the logic to track sample commits by comparing the write index before and after calling `SampleQueue.sampleMetadata`. Track indices are only added if the sample was committed, ensuring accurate sample handling and avoiding exceptions.

PiperOrigin-RevId: 675526115
2024-09-17 05:27:51 -07:00
ivanbuper
873d485056 Rollback of e88d6fe459
PiperOrigin-RevId: 675525508
2024-09-17 05:25:07 -07:00
kimvde
0ea229d795 Remove limit of 2 sequences in CompositionPlayer
The player supports more than 2 audio sequences

PiperOrigin-RevId: 675493637
2024-09-17 03:20:28 -07:00
Copybara-Service
6632e64007 Merge pull request #1653 from theskyblockman:main
PiperOrigin-RevId: 675277275
2024-09-16 13:52:55 -07:00
oceanjules
25bb8e411b Make setFullscreenButtonState UnstableApi 2024-09-16 20:19:55 +01:00
oceanjules
9b75523fd9 Add and format RELEASENOTES 2024-09-16 20:05:02 +01:00
oceanjules
5536b73a08 Format with google-java-format 2024-09-16 20:05:02 +01:00
theskyblockman
370a4c0035 Deleted redundant check 2024-09-16 20:05:02 +01:00
theskyblockman
c42f53fcc9 Edited condition to exit updateIsFullscreen quickly 2024-09-16 20:05:02 +01:00
theskyblockman
4a4b3a3bc0 - Rephrased/Expanded javadocs for fullscreen methods
- Replaced all occurrences of "FullScreen" to "Fullscreen"
2024-09-16 20:05:02 +01:00
theskyblockman
49af9228db Added public-facing calls to set whether to show [fullScreenButton] or [minimalFullScreenButton] in PlayerView calling PlayerControlView 2024-09-16 20:05:02 +01:00
sheenachhabra
47d45a82ca Change the default value of lastSampleDurationBehavior
to
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS

This CL also combines LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER
and LAST_SAMPLE_DURATION_BEHAVIOR_DUPLICATE_PREVIOUS.

The reason for combining the two enums is that, when the option
to use END_OF_STREAM_BUFFER is selected and if the EOS buffer is
not provided then the muxer anyways fallbacks to duplicate
duration behavior.

The last sample with 0 durations seems less useful so
change the default behavior to non-zero duration.
This will also match the behavior with MediaMuxer.

PiperOrigin-RevId: 675189932
2024-09-16 10:02:10 -07:00
Copybara-Service
0ce6d9620e Merge pull request #1703 from colinkho:fwd-renderer
PiperOrigin-RevId: 675122802
2024-09-16 06:25:27 -07:00
claincly
a879bc2154 Rewrite sequence duration matching on MediaSource level
This simplifies the later handling of speed adjusted media.

PiperOrigin-RevId: 675114587
2024-09-16 05:55:00 -07:00
Rohit Singh
c8aa122e8a Change from internal review 2024-09-16 13:34:21 +01:00
Rohit Singh
11aea9b34b Add RELEASENOTES 2024-09-16 13:15:40 +01:00
Rohit Singh
9975175700 Forward default methods 2024-09-16 13:07:36 +01:00
Rohit Singh
3c6f1f1e77 Add copyright text and move test to correct package 2024-09-16 12:36:03 +01:00
Rohit Singh
8ca12338f6 Format with google-java-format 2024-09-16 12:31:48 +01:00
Colin Kho
62aef96b7d Format code using google java format 2024-09-16 12:31:48 +01:00
Colin Kho
72e39c91c4 Denote ForwardingRenderer as subject to change 2024-09-16 12:31:48 +01:00
Colin Kho
72f26d79f6 Added a forwarding class for Renderer to support composing custom behavior on Metadata & Text Renderers 2024-09-16 12:31:48 +01:00
michaelkatz
e938d27846 Fix typo in release notes
PiperOrigin-RevId: 675070722
2024-09-16 02:54:20 -07:00
Googler
011659b326 Add profile and level for H263 codec.
To support for 3gpp h263 codec in Mp4Muxer currently profile and level is hardcoded and provided to h263 box. Parse profile and level from MediaFormat and use those value to write h263 box.

PiperOrigin-RevId: 675004590
2024-09-15 22:09:38 -07:00
claincly
6c92402fbb Re-enable audio tests
The tests were flaky because CompositionPlayer registers audio sequences'
formats to the audio pipeline in first-come-first-serve order. With the change
in bc8d82355f, the audio format is deterministic.

The test is turned off in 060356ea00

PiperOrigin-RevId: 674261801
2024-09-13 05:44:28 -07:00
tianyifeng
72ae454f67 Use buffered duration from start position to control preload progress
`PreloadMediaSource` allows to have a `startPositionUs` passed when `preload` is called, then in `PreloadControl.onContinueLoadingRequested`, it can be more intuitive to see the buffered duration rather than the absolute buffered position as the preload progress. Similar in `DefaultPreloadManager`, we haven't allowed the apps to set a custom start position for individual sources though, once we add this support, using the "duration from the start position" than the absolute position will be less error-prone, otherwise, it can run into a case that the position that the apps set is smaller than the start position.

PiperOrigin-RevId: 674251362
2024-09-13 05:05:39 -07:00
Copybara-Service
023fd32cb1 Merge pull request #1138 from Lavamancer:bugfix/rtsp_message_util_encoded_authority
PiperOrigin-RevId: 674239756
2024-09-13 04:16:05 -07:00
Googler
ff656012a8 Update the unisoc blocklist
PiperOrigin-RevId: 674101970
2024-09-12 19:33:13 -07:00
claincly
bc8d82355f Block secondary audio processing until primary format is configured
PiperOrigin-RevId: 673961235
2024-09-12 12:42:09 -07:00
ivanbuper
e88d6fe459 Fix truncation error acumulation for Sonic's resampling algorithm
Sonic would accumulate truncation errors on float to int conversions
that caused the final output sample count to drift noticeably, by
hundreds of samples on streams of a few minutes of length. The fix now
keeps track of the truncation error and compensates for it.

Other small fixes include eliminating lossy operations (e.g. int
division) and using doubles instead of floats for resampling where
helpful.

This CL also introduces `SonicParameterizedTest`, which helps test
resampling on an arbitrary number of randomly generated parameters,
with random sample data. `SonicParameterizedTest` uses `BigDecimal`s
for calculating sample count values, as to avoid precision issues with
large sample counts.

PiperOrigin-RevId: 673852768
2024-09-12 08:14:25 -07:00
Googler
3caebbf5ad Fix erroneous use of "cpu_features" in AV1 JNI exports.
`CPU_FEATURES_COMPILED_ANY_ARM_NEON` is always defined when `CPU_FEATURES_ARCH_ARM` is but it can be defined as `0` or `1` ([cpu_features source](8e60d3f9be/include/cpu_features_macros.h (L237-L245))). This patch makes sure to use the value of `CPU_FEATURES_COMPILED_ANY_ARM_NEON` instead of whether it is defined or not.

PiperOrigin-RevId: 673837522
2024-09-12 07:30:47 -07:00
kimvde
ce98b7d379 Rename SequencePlayerRenderersWrapper
Also remove reference to SequencePlayerRenderersWrapper in inner
classes to make them effectively static.

PiperOrigin-RevId: 673720251
2024-09-12 00:52:17 -07:00
microkatz
661f3de325 Added note in release notes 2024-09-12 04:56:57 +00:00
microkatz
61343cd75f Format with google-java-format 2024-09-12 04:47:05 +00:00
Lavamancer
17e0fd22b1 Fixed removal of user info for URLs that contain encoded @ characters 2024-09-12 04:47:05 +00:00
rohks
f133e8d1f2 Fix preroll sample handling for non-keyframe media start positions
When processing edit lists in MP4 files, the media start position may be a non-keyframe. To ensure proper playback, the decoder must preroll to the preceding keyframe, as these preroll samples are essential for decoding but are not rendered.

Issue: google/ExoPlayer#1659

#cherrypick

PiperOrigin-RevId: 673457615
2024-09-11 11:02:39 -07:00
rohks
d9a678483b Refine sample presentation time validation for negative PTS workaround
In case of negative PTS workaround, instead of disallowing all cases where samples are not in presentation order, we now validate that the first sample's presentation time is the smallest. This adjustment allows for correctly applying an offset to ensure all samples have a presentation time >= 0.

#cherrypick

PiperOrigin-RevId: 673434793
2024-09-11 10:04:16 -07:00
rohks
bb3d055191 Do not drop negative timestamp video buffers during transmuxing
Prevents discarding video buffers with key frame which are required for decoding.

#cherrypick

PiperOrigin-RevId: 673375261
2024-09-11 07:00:02 -07:00
kimvde
8271a5f920 Rename CompositingVideoSinkProvider and PreviewAudioPipeline
The components are mirror components for video and audio so they should
have a matching name

PiperOrigin-RevId: 673357081
2024-09-11 05:49:35 -07:00
sheenachhabra
4be5b74366 Read NAL unit data as 4 byte integer
When converting NAL units from AnnexB to Avcc format,
one byte at a time was read. In fact many bytes were read
multiple times due to suboptimal logic.

Changed the logic to read 4 bytes at once and also to avoid
reading same bytes again.

This improved the time taken for writing a batch of 30
samples from 40ms to 20ms.

PiperOrigin-RevId: 673025781
2024-09-10 10:57:22 -07:00