2024-04-17
·
92 commits
to main
since this release
Media3: v1.4.0-alpha01
April 17, 2024
androidx.media3:media3-*:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
- ExoPlayer:
- Add
BasePreloadManagerwhich coordinates the preloading for multiple sources based on the priorities defined by theirrankingData. Customization is possible by extending this class. AddDefaultPreloadManagerwhich usesPreloadMediaSourceto preload media samples of the sources into memory, and uses an integerrankingDatathat indicates the index of an item on the UI. - Add
PlayerIdto most methods ofLoadControlto enableLoadControlimplementations to support multiple players. - Remove
Buffer.isDecodeOnly()andC.BUFFER_FLAG_DECODE_ONLY. There is no need to set this flag as renderers and decoders will decide to skip buffers based on timestamp. CustomRendererimplementations should check if the buffer time is at leastBaseRenderer.getLastResetPositionUs()to decide whether a sample should be shown. CustomSimpleDecoderimplementations can checkisAtLeastOutputStartTimeUsif needed or mark other buffers withDecoderOutputBuffer.shouldBeSkippedto skip them. - Allow a null value to be returned by
TargetPreloadStatusControl.getTargetPreloadStatus(T)to indicate not to preload aMediaSourcewith the givenrankingData. - Add
remove(MediaSource)toBasePreloadManager.
- Add
- Transformer:
- Add
audioConversionProcessandvideoConversionProcesstoExportResultindicating how the respective track in the output file was made. - Relax trim optimization H.264 level checks.
- Add support for changing between SDR and HDR input media in a sequence.
- Add support for composition-level audio effects.
- Add support for transcoding Ultra HDR images into HDR videos.
- Fix issue where the
DefaultAudioMixerdoes not output the correct amount of bytes after being reset and reused.
- Add
- Video:
- Fix issue where
Listener.onRenderedFirstFrame()arrives too early when switching surfaces mid-playback.
- Fix issue where
- DataSource:
- Implement support for
android.resource://package/idraw resource URIs wherepackageis different to the package of the current application. This wasn't previously documented to work, but is a more efficient way of accessing resources in another package than by name. - Eagerly check
urlis non-null in theDataSpecconstructors. This parameter was already annotated to be non-null.
- Implement support for
- Effect:
- Support multiple speed changes within the same
EditedMediaItemorCompositioninSpeedChangeEffect. - Support for HLG and PQ output from ultra HDR bitmap input.
- Add support for EGL_GL_COLORSPACE_BT2020_HLG_EXT, which improves HLG surface output in ExoPlayer.setVideoEffect and Transformer's Debug SurfaceView.
- Update Overlay matrix implementation to make it consistent with the documentation by flipping the x and y values applied in
setOverlayFrameAnchor(). If usingOverlaySettings.Builder.setOverlayFrameAnchor(), flip their x and y values by multiplying them by-1.
- Support multiple speed changes within the same
- Session:
- Change default of
CommandButton.enabledtotrueand ensure the value can stay false for controllers even if the associated command is available. - Add icon constants for
CommandButtonthat should be used instead of custom icon resources. - Add
MediaSessionService.isPlaybackOngoing()to let apps query whether the service needs to be stopped inonTaskRemoved()(#1219). - Add
MediaSessionService.pauseAllPlayersAndStopSelf()that conveniently allows to pause playback of all sessions and callstopSelfto terminate the lifecycle of theMediaSessionService. - Override
MediaSessionService.onTaskRemoved(Intent)to provide a safe default implementation that keeps the service running in the foreground if playback is ongoing or stops the service otherwise.
- Change default of
- Downloads:
- Ensure that
DownloadHelperdoes not leak unreleasedRendererinstances, which can eventually result in an app crashing withIllegalStateException: Too many receivers, total of 1000, registered for pid(#1224).
- Ensure that
- Test Utilities:
- Implement
onInit()andonRelease()inFakeRenderer. - Change
TestPlayerRunHelper.runUntil/playUntilmethods to fail on nonfatal errors (e.g. those reported toAnalyticsListener.onVideoCodecError). Use the newTestPlayerRunHelper.run(player).ignoringNonFatalErrors().untilXXX()method chain to disable this behavior.
- Implement
- Demo app:
- Use
DefaultPreloadManagerin the short form demo app.
- Use
- Remove deprecated symbols:
- Remove
CronetDataSourceFactory. UseCronetDataSource.Factoryinstead. - Remove some
DataSpecconstructors. UseDataSpec.Builderinstead.
- Remove