21580 Commits

Author SHA1 Message Date
ibaker
39c734963f H264Reader: Add missing propagation of max_num_reorder_frames
This method is already called below in the
`else if (sps.isCompleted())` block which applies when
`hasOutputFormat == true`, but this is only ever entered if we are
parsing SPS and PPS NAL units **after** we've emitted a format, which
is only the case if
`DefaultTsPayloadReaderFactory.FLAG_DETECT_ACCESS_UNITS` is set (which
it isn't by default).

The equivalent call in `H265Reader` is already inside the
`if (!hasOutputFormat)` block, so doesn't need a similar fix.

#cherrypick

PiperOrigin-RevId: 689809529
2024-10-25 09:13:53 -07:00
tonihei
a15571c8ee Add logic to convert button preferences to custom layout in sessions
This ensures that media button preferences with slots for BACK,
FORWARD and OVERFLOW are converted to the legacy custom layout
according to the implicit placement rules. This has to happen
when populating the MediaSessionCompat and when generating the
notification for older APIs. Sending these preferences to older
Media3 controllers can filter them down to the custom layout the
session would have used previously, but there is no need to adjust
the reservation extras because the older Media3 custom layout has
no concept of these extras.

PiperOrigin-RevId: 689761637
2024-10-25 06:09:21 -07:00
tonihei
8811b454bb Use slots to fill in default compact view indices
This is equivalent to the current logic, but also allows to easily pick
up other buttons that use the BACK, CENTRAL or FORWARD slots for the
compact view by default.

Also fix the test to actually assert the output order.

PiperOrigin-RevId: 689747844
2024-10-25 05:12:07 -07:00
tonihei
0fdc930444 Use media button preferences in session demo app
PiperOrigin-RevId: 689738802
2024-10-25 04:34:21 -07:00
tonihei
aeb9d12a16 Add logic to convert custom layout to button preferences in controller
This ensures that the slots are set according to the implicit placement
rules for the legacy custom layouts. This has to be done when receiving
custom actions from a MediaControllerCompat and for Media3 sessions
setting the custom layout field.

PiperOrigin-RevId: 689737951
2024-10-25 04:29:05 -07:00
Copybara-Service
d051b4b993 Merge pull request #1768 from colinkho:onloadstarted-retry
PiperOrigin-RevId: 689728139
2024-10-25 03:51:35 -07:00
rohks
e25bc2c1a5 Populate track duration(s) in Avi, Flac and Wav extractors
PiperOrigin-RevId: 689716977
2024-10-25 03:03:08 -07:00
Ian Baker
683a5b8403 Fix review comments 2024-10-25 10:58:48 +01:00
Ian Baker
7d3e6b0f27 Add release note 2024-10-25 10:58:29 +01:00
Ian Baker
37f795ea82 Try removing duplicate calls 2024-10-25 10:58:29 +01:00
Ian Baker
7cf500bc2d Fix compilation of MergingMediaSourceTest 2024-10-25 10:58:29 +01:00
Ian Baker
473a4a7680 Call both old and new onLoadStarted methods in DefaultAnalyticsCollector 2024-10-25 10:58:29 +01:00
Ian Baker
d3298391b2 Fix onLoadStarted event accumulation in DefaultAnalyticsCollectorTest 2024-10-25 10:58:29 +01:00
Ian Baker
b565f47d18 Reformat with google-java-format 2024-10-25 10:58:29 +01:00
Ian Baker
e7f5d4d441 Remove backwards-compat onLoadStarted from MediaSourceEventListener 2024-10-25 10:58:29 +01:00
Colin Kho
5581529bfb Use long as test constant for DefaultAnalyticsCollectorTest 2024-10-25 10:58:28 +01:00
Colin Kho
16f65cee58 Deprecate onLoadStarted w/o retry count on AnalyticsListener 2024-10-25 10:58:28 +01:00
Colin Kho
5dbe1efa9e Treat onLoadStarted with retryCount to be a new method rather than redirect calls 2024-10-25 10:58:28 +01:00
Colin Kho
8adcd35c75 Incorporate MediaSourceEventListener.onLoadStarted with retryCount parameter with backward compatibility 2024-10-25 10:58:25 +01:00
Colin Kho
2d05744333 Add DownloadExecutor to SingleSampleMediaSource 2024-10-24 11:59:35 -07:00
samrobinson
45317394da Implement constant power matrices for channel mixing to mono & stereo.
Calculations are derived from the android platform channel mixing.

PiperOrigin-RevId: 689427658
2024-10-24 10:23:07 -07:00
dancho
d2fb779929 Ignore flaky preview tests
Tests are flaky because shader program creation is slow

PiperOrigin-RevId: 689420905
2024-10-24 10:04:57 -07:00
Rohit Kumar Singh
af1b5b5102 Merge Issue: androidx/media#1826: add extension for MPEG-H decoding
Imported from GitHub PR https://github.com/androidx/media/pull/1826

Merge 6b59a1602b022ebc44411ae3440e274c51c223a7 into b5615d5e919b297def6450b45320a3165c34548c

COPYBARA_INTEGRATE_REVIEW=https://github.com/androidx/media/pull/1826 from androidx:mpegh_extension 6b59a1602b022ebc44411ae3440e274c51c223a7
PiperOrigin-RevId: 689417378
2024-10-24 09:53:45 -07:00
ibaker
757f223d8a Remove // Do nothing overrides from EventLogger
These methods are marked `default` on the `AnalyticsListener` interface
with an empty implementation, so there's no need to override them just
to re-define the empty implementation.

PiperOrigin-RevId: 689416584
2024-10-24 09:50:54 -07:00
dancho
94e37ca7d2 Fix flaky test
* Use asset without audio for independent video time progress
* Use longer item duration to avoid ExoPlayer STATE_READY workaround
  (see https://github.com/google/ExoPlayer/issues/1874)

PiperOrigin-RevId: 689409427
2024-10-24 09:29:35 -07:00
michaelkatz
2f198c4c06 Implement getDurationToProgressUs for DecoderAudioRenderer
Add `DecoderAudioRenderer.getDurationToProgressUs()` so that `ExoPlayer`, if set with `experimentalSetDynamicSchedulingEnabled()`, will dynamically schedule its main work loop to when the `DecoderAudioRenderer` can make progress.

PiperOrigin-RevId: 689377247
2024-10-24 07:46:42 -07:00
sheenachhabra
f181855c5e Add an API to disable sample batching in Mp4Muxer
Mp4Muxer caches the samples and then writes them in batches.
The new API allows disabling the batching and writing sample
immediately.

PiperOrigin-RevId: 689352771
2024-10-24 06:15:25 -07:00
ibaker
b36de302f7 Remove some un-needed proguard-rules.txt symlinks
PiperOrigin-RevId: 689344803
2024-10-24 05:43:59 -07:00
rohks
5f99955f31 Make minor improvements for IAMF decoder module
- Create `LibiamfAudioRenderer` with `DefaultRenderersFactory` in `ExoPlayerModuleProguard`.
- Remove redundant library availability check from `IamfModuleProguard`.
- Move `proguard-rules.txt` to the root folder.
- Removed unused `cryptoType` parameter from `setLibraries()` method in `IamfLibrary`.
- Added log when `LibiamfAudioRenderer` is loaded in `DefaultRenderersFactory`.
- Annotated missing classes with `@UnstableApi`.
- Check for library availability and throw exception in `IamfDecoder` constructor.

#cherrypick

PiperOrigin-RevId: 689330016
2024-10-24 04:46:13 -07:00
ibaker
4a406be1bf DataSourceContractTest: Tighten assertions around 'not found' URIs
This change:
1. Updates `DataSourceContractTest` to allow multiple "not found"
   resources, and to include additional info (e.g. headers) on them.
2. Updates the contract test to assert that `DataSource.getUri()`
   returns the expected (non-null) value for "not found" resources
   between the failed `open()` call and a subsequent `close()` call.
   The `DataSource` is 'open' at this point (since it needs to be
   'closed' later), so `getUri()` must return non-null.
    * This change also fixes some implementations to comply with this
      contract. It also renames some imprecisely named `opened`
      booleans that **don't** track whether the `DataSource` is open
      or not.
3. Updates the contract test assertions to enforce that
   `DataSource.getResponseHeaders()` returns any headers associated
   with the 'not found' resource.
4. Configures `HttpDataSourceTestEnv` to provide both 404 and "server
   not found" resources, with the former having expected headers
   associated with it.

PiperOrigin-RevId: 689316121
2024-10-24 03:49:27 -07:00
kimvde
d25a423888 Remove unused parameter from VideoFrameRenderControl.FrameRenderer
PiperOrigin-RevId: 689281689
2024-10-24 01:27:20 -07:00
Copybara-Service
b5615d5e91 Merge pull request #1794 from stevemayhew:p-fix-ntp-time-update-main
PiperOrigin-RevId: 689121191
2024-10-23 15:22:22 -07:00
jbibik
7da71f792b Move PlayerSurface from demo-compose to media3-ui-compose
The new `media3-ui-compose` module does not have any Material library dependencies, but will rely on androidx.compose + foundation/runtime/ui and other non-theming/opinionated libraries. Surface handling is one such usecase.

PiperOrigin-RevId: 689004504
2024-10-23 10:00:07 -07:00
tonihei
21526588be Removed unused constructor
PiperOrigin-RevId: 688960856
2024-10-23 07:50:31 -07:00
michaelkatz
f11130d59e Move setVideoOutput message handling to playback thread
PiperOrigin-RevId: 688951964
2024-10-23 07:16:50 -07:00
tonihei
dfb7636138 Suppress not-applicable lint warning
PiperOrigin-RevId: 688948857
2024-10-23 07:11:58 -07:00
ibaker
7b66209bca Add missing overrides in DefaultTrackSelector.Parameters.Builder
Also add a test for this to avoid missing any others in future. Also
flesh out the existing test for the deprecated builder, to assert the
return type is correctly updated.

PiperOrigin-RevId: 688948768
2024-10-23 07:08:03 -07:00
kimvde
75f29b6997 Implement DefaultVideoSink.render()
PiperOrigin-RevId: 688948682
2024-10-23 07:05:53 -07:00
michaelkatz
e5133e78f5 Abstract EPII renderer logic into holder class
Move EPII calls to renderers to a separate managing class.

PiperOrigin-RevId: 688932712
2024-10-23 06:04:21 -07:00
rohks
e677c8dccd Fix duration calculation for AVI files
The duration is now correctly calculated as the maximum of all track durations, instead of being overwritten by the last track's value. This aligns with how other Extractor implementations handle durations for multiple tracks.

PiperOrigin-RevId: 688896743
2024-10-23 03:34:04 -07:00
bachinger
0038dda3c3 Fix flakiness of MediaBrowserListenerWithMediaBrowserServiceCompatTest
PiperOrigin-RevId: 688870397
2024-10-23 01:54:22 -07:00
kimvde
6c932722e4 Set release control frame rate in DefaultVideoSink
All the calls to the VideoFrameReleaseControl and
VideoFrameRenderControl will be moved to the DefaultVideoSink

PiperOrigin-RevId: 688857699
2024-10-23 01:06:04 -07:00
tonihei
e43720b83a Remove deprecated MediaSession.getSessionCompatToken
And also the deprecated override of
ControllerInfo.createTestOnlyControllerInfo using the
androidx.media classes.

PiperOrigin-RevId: 688625484
2024-10-22 11:30:28 -07:00
jbibik
a645f704b8 Create a new media3-ui-compose module
It will be used for UI components built with Jetpack Compose

`implementation("androidx.media3:media3-ui-compose:1.X.Y")`

PiperOrigin-RevId: 688595899
2024-10-22 10:14:26 -07:00
ivanbuper
36a5a83b22 Implement parameterized testing for SpeedChangingAudioProcessor
`RandomParameterizedSpeedChangingAudioProcessorTest` follows the
structure of `RandomParameterizedSonicAudioProcessorTest` and will help
improve coverage and confidence in the output length of
`SpeedChangingAudioProcessor`.

This CL is prework for removing the synchronization between the video
pipeline and the audio pipeline for speed changing effects.

PiperOrigin-RevId: 688578597
2024-10-22 09:27:08 -07:00
ibaker
cabc541a6f Use Guava's HttpHeaders consistently in HTTP testing machinery
PiperOrigin-RevId: 688576776
2024-10-22 09:21:09 -07:00
rohks
7545a8929b Add support for identifying h263 box in MP4 files for H.263 video
Issue: androidx/media#1821

#cherrypick

PiperOrigin-RevId: 688570141
2024-10-22 09:02:33 -07:00
jbibik
ee4f0c40bc Align spelling of fullScreen to fullscreen
Currently most of the public APIs use `fullscreen` (apart from the deprecated `PlayerControlView.OnFullScreenModeChangedListener` which will have to remain as is). This code changes mostly private variable naming.

PiperOrigin-RevId: 688559509
2024-10-22 08:30:10 -07:00
ibaker
219565c15e DataSourceContractTest: Add expected response headers
PiperOrigin-RevId: 688556440
2024-10-22 08:19:10 -07:00
kimvde
8260bb3d2e Refactor frame rate notification to release control
Frame rate change is currently notified to the release control when the
video frame processor input frame rate changes, but it should be when
the video frame processor output frame rate changes.

PiperOrigin-RevId: 688512300
2024-10-22 05:44:41 -07:00