2024-06-06
·
83 commits
to main
since this release
Media3: v1.4.0-alpha02
June 07, 2024
androidx.media3:media3-*:1.4.0-alpha02 is released. Version 1.4.0-alpha02 contains these commits.
- Common Library:
- Forward presumed no-op seek calls to the protected
BasePlayer.seekToandSimpleBasePlayer.handleSeekmethods instead of ignoring them. If you are implementing these methods in a custom player, you may need to handle these additional calls withmediaItemIndex == C.INDEX_UNSET. - Remove compile dependency on enhanced Java 8 desugaring (#1312).
- Ensure the duration passed to
MediaItem.Builder.setImageDurationMsis ignored for a non-imageMediaItem(as documented).
- Forward presumed no-op seek calls to the protected
- ExoPlayer:
- Add
resettoBasePreloadManagerto release all the holding sources while keep the preload manager instance. - Add
ExoPlayer.setPriority(andBuilder.setPriority) to define the priority value used inPriorityTaskManagerand for MediaCodec importance from API 35. - Fix issue with updating the last rebuffer time which resulted in incorrect
bs(buffer starvation) key in CMCD (#1124). - Add
PreloadMediaSource.PreloadControl.onLoadedToTheEndOfSource(PreloadMediaSource)to indicate that the source has loaded to the end. This allows theDefaultPreloadManagerand the customPreloadMediaSource.PreloadControlimplementations to preload the next source or take other actions. - Fix bug where silence skipping at the end of items can trigger a playback exception.
- Add
cleartoPreloadMediaSourceto discard the preloading period. - Add new error code
PlaybackException.ERROR_CODE_DECODING_RESOURCES_RECLAIMEDthat is used when codec resources are reclaimed for higher priority tasks. - Let
AdsMediaSourceload preroll ads before initial content media preparation completes (#1358). - Fix bug where playback moved to
STATE_ENDEDwhen re-preparing a multi-period DASH live stream after the original period was already removed from the manifest. - Rename
onTimelineRefreshedtoonSourcePreparedandonPreparedtoonTracksSelectedinPreloadMediaSource.PreloadControl. Also rename the IntDefs inDefaultPreloadManager.Stageaccordingly. - Add experimental support for dynamic scheduling to better align work with CPU wake-cycles and delay waking up to when renderers can progress. You can enable this using
experimentalSetDynamicSchedulingEnabledwhen setting up your ExoPlayer instance. - Add
Renderer.getDurationToProgressMs. ARenderercan implement this method to return to ExoPlayer the duration that playback must advance for the renderer to progress. IfExoPlayeris set withexperimentalSetDynamicSchedulingEnabledthenExoPlayerwill call this method when calculating the time to schedule its work task. - Add
MediaCodecAdapter#OnBufferAvailableListenerto alert when input and output buffers are available for use byMediaCodecRenderer.MediaCodecRendererwill signalExoPlayerwhen receiving these callbacks and ifExoPlayeris set withexperimentalSetDynamicSchedulingEnabled, thenExoPlayerwill schedule its work loop as renderers can make progress. - Use data class for
LoadControlmethods instead of individual parameters.
- Add
- Transformer:
- Work around a decoder bug where the number of audio channels was capped at stereo when handling PCM input.
- When selecting tracks in
ExoPlayerAssetLoader, ignore audio channel count constraints as they only apply for playback. - Replace
androidx.media3.transformer.Muxerinterface withandroidx.media3.muxer.Muxerand removeandroidx.media3.transformer.Muxer. - Fix HEIC image loading from content URI schemes. (#1373).
- Adjust audio track duration in
AudioGraphInputto improve AV sync.
- Extractors:
- MPEG-TS: Roll forward the change ensuring the last frame is rendered by passing the last access unit of a stream to the sample queue (#7909). Incorporating fixes to resolve the issues that emerged in I-frame only HLS streams(#1150) and H.262 HLS streams (#1126).
- MP3: Prefer the data size from an
Infoframe over the size reported by the underlying stream (e.g. file size, or HTTPContent-Lengthheader). This helps to exclude non-playable trailer data (e.g. album artwork) from constant bitrate seeking calculations, making seeks more accurate (#1376). - MP3: Use the frame count and other data in an
Infoframe (if present) to compute an average bitrate for constant bitrate seeking, rather than extrapolating from the bitrate of the frame after theInfoframe, which may be artificially small, e.g.PCUTframe (#1376).
- Audio:
- Fix DTS:X Profile 2 encoding attributes for passthrough playback (#1299).
- For offloaded playback, reset the tracking field for stream completion in
DefaultAudioSinkprior to callingAudioTrack.stop()so thatAudioTrack.StreamEventCallback#onPresentationEndedcorrectly identifies when all pending data has been played. - Fix bug in
SilenceSkippingAudioProcessorwhere transitions between different audio formats (for example stereo to mono) can cause the processor to throw an exception (#1352). - Implement
MediaCodecAudioRenderer.getDurationToProgressUsso that ExoPlayer will dynamically schedule its main work loop to when the MediaCodecAudioRenderer can make progress.
- Video:
- Fix decoder fallback logic for Dolby Vision to use a compatible AV1 decoder if needed (#1389).
- Text:
- Fix issue where subtitles starting before a seek position are skipped. This issue was only introduced in Media3 1.4.0-alpha01.
- Change default subtitle parsing behavior so it happens during extraction instead of during rendering (see ExoPlayer's architecture diagram for the difference between extraction and rendering).
- This change can be overridden by calling both
MediaSource.Factory.experimentalParseSubtitlesDuringExtraction(false)andTextRenderer.experimentalSetLegacyDecodingEnabled(true). See the docs on customization for how to plumb these components into anExoPlayerinstance. These methods (and all support for legacy subtitle decoding) will be removed in a future release. - Apps with custom
SubtitleDecoderimplementations need to update them to implementSubtitleParserinstead (andSubtitleParser.Factoryinstead ofSubtitleDecoderFactory).
- This change can be overridden by calling both
- PGS: Fix run-length decoding to resolve
0as a color index, instead of a literal color value (#1367). - CEA-708: Ignore
rowLockvalue. The CEA-708-E S-2023 spec states thatrowLockandcolumnLockshould both be assumed to be true, regardless of the values present in the stream (columnLocksupport is not implemented, so it's effectively assumed to always be false).- This was originally included in the
1.3.0-alpha01release notes, but the change was accidentally reverted before the1.3.0-rc01release. This is now fixed, so the change is present again.
- This was originally included in the
- CEA-708: Avoid duplicate newlines being added by ExoPlayer's naive handling of the 'set pen location' command (#1315).
- Metadata:
- Fix mapping of MP4 to ID3 sort tags. Previously the 'album sort' (
soal), 'artist sort' (soar) and 'album artist sort' (soaa) MP4 tags were wrongly mapped to theTSO2,TSOAandTSOPID3 tags (#1302). - Fix reading of MP4 (/iTunes) numeric
gnre(genre) andtmpo(tempo) tags when the value is more than one byte long. - Propagate ID3
TCONframe toMediaMetadata.genre(#1305).
- Fix mapping of MP4 to ID3 sort tags. Previously the 'album sort' (
- Image:
- Add support for non-square DASH thumbnail grids (#1300).
- Add support for AVIF for API 34+.
- DataSource:
- Allow
ByteArrayDataSourceto resolve a URI to a byte array duringopen(), instead of being hard-coded at construction (#1405).
- Allow
- DRM:
- Allow setting a
LoadErrorHandlingPolicyonDefaultDrmSessionManagerProvider(#1271).
- Allow setting a
- Effect:
- Fix bug where
TimestampWrappercrashes when used withExoPlayer#setVideoEffects(#821). - Change default SDR color working space from linear colors to electrical BT 709 SDR video. Also provide third option to retain the original colorspace.
- Allow defining indeterminate z-order of EditedMediaItemSequences (#1055).
- Maintain a consistent luminance range across different pieces of HDR content (uses the HLG range).
- Add support for Ultra HDR (bitmap) overlays on HDR content.
- Allow
SeparableConvolutioneffects to be used before API 26.
- Fix bug where
- IMA extension:
- Promote API that is required for apps to play DAI ad streams to stable.
- Add
replaceAdTagParameters(Map <String, String>)toImaServerSideAdInsertionMediaSource.AdLoaderthat allows replacing ad tag parameters at runtime. - Fix bug where
VideoAdPlayer.VideoAdPlayerCallback.onErrorwas not called when a player error happened during ad playback (#1334). - Bump IMA SDK version to 3.33.0 to fix a
NullPointerExceptionwhen usingdata://ad tag URIs (#700).
- Session:
- Hide seekbar in the media notification for live streams by not setting the duration into the platform session metadata (#1256).
- Align conversion of
MediaMetadatatoMediaDescriptionCompat, to use the same preferred order and logic when selecting metadata properties as in media1. - Add
MediaSession.sendError()that allows sending non-fatal errors to Media3 controller. When using the notification controller (seeMediaSession.getMediaNotificationControllerInfo()), the custom error is used to update thePlaybackStateof the platform session to an error state with the given error information (#543).
- Cronet Extension:
- Fix
SocketTimeoutExceptioninCronetDataSource. In some versions of Cronet, the request provided by the callback is not always the same. This leads to callback not completing and request timing out (https://issuetracker.google.com/328442628).
- Fix
- HLS Extension:
- Fix bug where pending EMSG samples waiting for a discontinuity were delegated in
HlsSampleStreamWrapperwith an incorrect offset causing anIndexOutOfBoundsExceptionor anIllegalArgumentException(#1002). - Fix bug where non-primary playlists keep reloading for LL-HLS streams (#1240).
- Fix bug where enabling CMCD for HLS with initialization segments resulted in
Source ErrorandIllegalArgumentException.
- Fix bug where pending EMSG samples waiting for a discontinuity were delegated in
- DASH Extension:
- Cast Extension:
- Fix bug that converted the album title of the
MediaQueueItemto the artist in the Media3 media item (#1255).
- Fix bug that converted the album title of the
- Demo app:
- Allow setting repeat mode with
Intentarguments from command line (#1266).
- Allow setting repeat mode with
- Remove deprecated symbols:
- Remove
setContentTypePredicate(Predicate)method fromDefaultHttpDataSource,OkHttpDataSourceandCronetDataSource. Use the equivalent method on eachXXXDataSource.Factoryinstead. - Remove
OkHttpDataSourceconstructors andOkHttpDataSourceFactory. UseOkHttpDataSource.Factoryinstead. - Remove
PlayerMessage.setHandler(Handler). UsesetLooper(Looper)instead. - Remove
Timeline.Window.isLivefield. Use theisLive()method instead. - Remove
DefaultHttpDataSourceconstructors. UseDefaultHttpDataSource.Factoryinstead. - Remove
DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS. UseDashMediaSource.DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MSinstead. - Remove
MediaCodecInfo.isSeamlessAdaptationSupported(Format, Format, boolean). UseMediaCodecInfo.canReuseCodec(Format, Format)instead. - Remove
DrmSessionManager.DUMMYandgetDummyDrmSessionManager()method. UseDrmSessionManager.DRM_UNSUPPORTEDinstead. - Remove
AnalyticsListener.onAudioInputFormatChanged(EventTime, Format),AnalyticsListener.onVideoInputFormatChanged(EventTime, Format),AudioRendererEventListener.onAudioInputFormatChanged(Format),VideoRendererEventListener.onVideoInputFormatChanged(Format). Use the overloads that take aDecoderReuseEvaluationinstead. - Remove
RendererSupport.FormatSupportIntDef andFORMAT_HANDLED,FORMAT_EXCEEDS_CAPABILITIES,FORMAT_UNSUPPORTED_DRM,FORMAT_UNSUPPORTED_SUBTYPE,FORMAT_UNSUPPORTED_TYPEconstants. Use the equivalent IntDef and constants inandroidx.media3.common.Cinstead (e.g.C.FORMAT_HANDLED).
- Remove