1880 Commits

Author SHA1 Message Date
Tofunmi Adigun-Hameed
6e9df8df77 Merge pull request #461 from almiki:release
PiperOrigin-RevId: 542228372
2023-06-22 15:34:28 +00:00
Ian Baker
35e179f080 Add a release note, fix some nullness and comments 2023-06-21 10:00:47 +01:00
Rohit Singh
d4034bb9b9 Add release notes entry for the fix 2023-06-20 18:50:14 +01:00
tonihei
e0191ddded Fix spurious sessions created for events after the playlist is cleared
Some events may arrive after the playlist is cleared (e.g. load
cancellation). In this case, the DefaultPlaybackSessionManager may
create a new session for the already removed item.

We already have checks in place that ignore events with old
windowSequenceNumbers, but these checks only work if the current
session is set (i.e. the playlist is non-empty). The fix is to add
the same check for empty playlists by keeping note of the last
removed window sequence number.

PiperOrigin-RevId: 541870812
2023-06-20 14:08:06 +01:00
tonihei
2ac5d8f1af Make FakeClock Espresso and Compose UI test compatible
FakeClock currently doesn't work well with Espresso and Compose UI
tests because view interactions in both frameworks intentionally idle
the main looper to handle pending UI effects. However, this also
advances playback progress even though we want to deterministically
trigger progress from the test itself.

To solve this problem, we can detect the idling Robolectric call and
postpone any further updates until we leave this state.

PiperOrigin-RevId: 541831050
2023-06-20 14:03:06 +01:00
Googler
abd1c006fc Player.Listener implementation to resolve playback suppression on Wear.
Add a Wear OS specific implementation of 'Player.Listener' to help resolving the playback suppression due to unsuitable output by launching a system media output switcher dialog.

PiperOrigin-RevId: 541698125
2023-06-20 14:02:05 +01:00
Googler
42915e9a58 Rename the APIs for playback suppression due to unsuitable output.
The APIs /related fields for playback suppression due to unsuitable output should be renamed from '..SuppressPlaybackWhenNoSuitableOutputAvailable' to '..SuppressPlaybackOnUnsuitableOutput'

PiperOrigin-RevId: 540555715
2023-06-19 16:12:33 +01:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
tonihei
b69b33206e Mark output sample as decode-only based on start time
We currently do the same check on the input timestamps and
expect the output timestamps to match. Some codecs produce
samples with modified timestamps and the logic is a lot safer
when the comparison with the start time is done on the output
side of the codec.

Issue: google/ExoPlayer#11000
PiperOrigin-RevId: 540228209
2023-06-14 20:39:49 +01:00
tofunmi
03745de432 Change the rc release date
#minor-release

PiperOrigin-RevId: 539628823
2023-06-12 14:13:15 +00:00
tofunmi
49b893f6f3 Update RELEASENOTES.md for media3-1.1.0-rc01 release
#minor-release

PiperOrigin-RevId: 539606230
2023-06-12 14:08:06 +00:00
Googler
6e46234589 Implement AudioDeviceCallbacks to auto-resume & auto-pause when suitable devices are added or removed respectively with playback suppression feature enabled.
With playback suppression in place, the devices can be added when the playback on ExoPlayer is in the suppression state. Also, it is quite possible that a suitable audio output device on which playback is ongoing gets removed requiring the Player to pause the playback. These requirements can be fullfilled using AudioDeviceCallbacks which has been implemented with this change.

PiperOrigin-RevId: 539559193
2023-06-12 14:01:15 +00:00
tianyifeng
db3e662bdc Throw exception when TimestampAdjuster initialization hits timeout
Add `HlsMediaSource.Factory.setTimestampAdjusterInitializationTimeoutMs(long)` to set the timeout for the loading thread to wait for the `TimestampAdjuster` to initialize. If the initialization doesn't complete before the timeout, a `PlaybackException` is thrown to avoid the playback endless stalling. The timeout is set to zero by default.

This can avoid HLS playback endlessly stalls when manifest has missing discontinuities. According to the HLS spec, all variants and renditions have discontinuities at the same points in time. If not, the one with discontinuities will have a new `TimestampAdjuster` not shared by the others. When the loading thread of that variant is waiting for the other threads to initialize the timestamp and hits the timeout, the playback will stall.

Issue: androidx/media#323

#minor-release

PiperOrigin-RevId: 539108886
2023-06-10 20:25:05 +00:00
bachinger
319854d624 Do not reset period uid when DashMediaSource is released
When the source is prepared again after stop, the period uid
is calculated by subtracting the `firstPeriodId` from the
period uid that is passed in to `createPeriod`. When this
happens after stop, the uid from the old period uid that
is still stored and has the value of the last played uid.

Hence the `firstPeriodId` must not be reset when released.

Issue: google/ExoPlayer#10838
PiperOrigin-RevId: 539028570
2023-06-09 14:03:22 +00:00
rohks
b55ddf12b4 Implement logging support for Common Media Client Data (CMCD)
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 539021056
2023-06-09 14:01:25 +00:00
Googler
605af62d00 Add playback suppression for the attempted playbacks on an unsuitable output.
This CL introduces the new public API setSuppressPlaybackWhenUnsuitableOutput which if set to TRUE will cause suppression of a requested playback if that is going to happen on an unsuitable audio output (e.g. builtin speaker on a WearOS device).

PiperOrigin-RevId: 538867212
2023-06-09 13:58:42 +00:00
tianyifeng
2e2f19351f Add seekPrev and seekNext buttons on the default compact notification
This change is for Android 12 and below, where the buttons are derived from the actions added with the notification. From Android 13 (https://developer.android.com/about/versions/13/behavior-changes-13#playback-controls), the system derives media controls from `PlaybackState` actions.

When adding the actions onto the notification, the logic will iterate all the command buttons. The `COMMAND_KEY_CONPACT_VIEW_INDEX` extra will be checked for each button. If that extra is set for the three buttons on the compact view, then the customized buttons and their order will be used. Otherwise, the compact view will be "seekPrev" (if any), "play/pause" (if any), "seekNext" (if any) buttons (in such order).

Issue: androidx/media#410
PiperOrigin-RevId: 538797874
2023-06-09 13:54:13 +00:00
Tofunmi Adigun-Hameed
886717e3fe Merge pull request #439 from kaidokert:pick_workaround
PiperOrigin-RevId: 538209925
2023-06-06 18:15:04 +00:00
tianyifeng
f4bf376e89 Defer outputting the metadata sample when TimestampAdjuster isn't initialized
The sample timestamp carried by the emsg box can have a significant delta when comparing to the earliest presentation timestamp of the segment. Using this timestamp to intialize the timestamp offset in TimestampAdjuster will cause the media sample to have a wrong adjusted timestamp. So we should defer adjusting the metadata sample timestamp until the TimestampAdjuster is initialized with a real media sample.

PiperOrigin-RevId: 538172841
2023-06-06 18:10:41 +00:00
jbibik
d9764c18ad Allow playback of MediaItems with LocalConfiguration
When initiated by MediaController, it should be possible for `MediaSession` to pass `MediaItems` to the `Player` if they have `LocalConfiguration`. In such case, it is not required to override `MediaSession.Callback.onAddMediaItems`, because the new current default implementation will handle it.

However, in other cases, MediaItem.toBundle() will continue to strip the LocalConfiguration information.

Issue: androidx/media#282

#minor-release

PiperOrigin-RevId: 537993460
2023-06-06 18:08:17 +00:00
michaelkatz
6b7b97ccfe Requiring offload disables any tracks that are non-compatible
With `AudioOffloadModePreference` `AUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED`, the `DefaultTrackSelector` will select a single audio track that it finds is offload compatible. If not any audio track is supported in offload, then no track will be selected.

PiperOrigin-RevId: 537877183
2023-06-06 18:03:02 +00:00
tofunmi
4306e0bb82 Move Audio Offload section to unreleased changes
PiperOrigin-RevId: 537857911
2023-06-06 18:00:07 +00:00
ibaker
3cb6fe9fcf Add Throwable parameter to all methods on Log.Logger interface
This is a breaking change, but the alternatives seem either equally
breaking or worse, since the only way to make this non-breaking is
to add the `Throwable` overloads as `default` methods. It's then
unclear how we would ever migrate to these being the 'only' methods
or whether we'd have to keep both forms forever (which results in
duplication in the `Logger` implementations).

The clean break here also makes it clear that the `message` parameter
of `Log.Logger.{d,i,w,w}()` no longer automatically includes any info
from the `Throwable` passed to the static `Log.{d,i,w,e}() methods.

----

This CL also cleans up the javadoc on the static `Log.{d,w,i,e}` methods
since they no longer necessarily call straight through to the
corresponding `android.util.Log` methods (and haven't since <unknown commit>
and Issue: google/ExoPlayer#10185).

PiperOrigin-RevId: 537817974
2023-06-06 17:56:36 +00:00
Marc Baechinger
385c1497e3 Update release notes 2023-06-06 16:41:09 +01:00
kimvde
04d8edf19e Read Exif orientation data in DataSourceBitmapLoader
PiperOrigin-RevId: 537258424
2023-06-05 09:46:26 +00:00
christosts
757247e2ae Release MIDI decoder module in open-source
PiperOrigin-RevId: 537034577
2023-06-02 09:18:09 +00:00
tofunmi
02322e11fb Move unreleased change into the right section
PiperOrigin-RevId: 536974180
2023-06-02 09:14:08 +00:00
huangdarwin
20f90cb1bf ExoPlayer: set videoFrameProcessorFactory in MCVR ctor.
Also, move to using a Supplier<?> to load a singleton value.

PiperOrigin-RevId: 536733480
2023-05-31 18:01:35 +00:00
huangdarwin
06908e1a86 Rollback of 438ae0ed6a
*** Original commit ***

ExoPlayer: Add setVideoFrameProcessorFactory().

This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.
***

PiperOrigin-RevId: 536391597
2023-05-30 14:26:39 +00:00
tofunmi
ebbbcf9ac9 Update release notes for 1.1.0-beta01 release
PiperOrigin-RevId: 536383299
2023-05-30 14:25:22 +00:00
jbibik
25bf0c6738 Remove previously deprecated MediaItem.PlaybackProperties in favour of LocalConfiguration.
Deprecated field `MediaItem.playbackProperties` remains for backwards compatibility, but its type is changed from `MediaItem.PlaybackProperties` to `MediaItem.LocalConfiguration`. The private `MediaItem` constructor will now also take in a `LocalConfiguration` argument instead.

PiperOrigin-RevId: 535648420
2023-05-30 10:13:11 +00:00
Tofunmi Adigun-Hameed
c3dd88d715 Merge pull request #335 from cedricxperi:dts-direct-passthrough-support
PiperOrigin-RevId: 535255453
2023-05-25 15:13:38 +00:00
ibaker
41b19df5fa Add sections for each minor release to RELEASENOTES.md
#minor-release

PiperOrigin-RevId: 535240816
2023-05-25 15:12:19 +00:00
Tianyi Feng
730cfecd57 Make the API 34 check inline and refactor the comment 2023-05-25 09:58:07 +00:00
Tianyi Feng
5a6906a2b6 Add release note 2023-05-25 09:57:48 +00:00
michaelkatz
85f83b1208 Use base Uri from the RTSP DESCRIBE response header for relative paths
Issue: google/ExoPlayer#11160

#minor-release

PiperOrigin-RevId: 534896789
2023-05-25 09:58:12 +01:00
ibaker
41492b6e29 Clean up release notes (again)
I undid my last clean-up (b762ca993e) in 5a5c3ce3bd

#minor-release

PiperOrigin-RevId: 534763770
2023-05-24 16:07:43 +01:00
ibaker
5c713feb60 Remove deprecated onSeekProcessed
This change removes it from `Player.Listener` and `AnalyticsListener`,
use `onPositionDiscontinuity` with `DISCONTINUITY_REASON_SEEK` instead.

#minor-release

PiperOrigin-RevId: 534757426
2023-05-24 16:06:05 +01:00
michaelkatz
4f0a256cc9 Set offload mode preference through TrackSelectionParameters
Added piping to present offload support from the audio sink to the renderer and track selection. Applications can set offload mode preference and with both sink support and compatible track selection, renderer will be configured for offload.

PiperOrigin-RevId: 534450534
2023-05-24 16:00:42 +01:00
ibaker
5a5c3ce3bd Remove four deprecated AnalyticsListener decoder methods
Use the audio or video specific variants instead.

#minor-release

PiperOrigin-RevId: 534436644
2023-05-24 15:58:19 +01:00
ibaker
48348df58a Remove deprecated OfflineLicenseHelper constructor
Use the non-deprecated constructor instead.

#minor-release

PiperOrigin-RevId: 534426655
2023-05-24 15:57:20 +01:00
ibaker
e6f5f58e47 Remove deprecated Cue constructors, use Cue.Builder instead
#minor-release

PiperOrigin-RevId: 534412494
2023-05-24 15:56:23 +01:00
ibaker
ff0f1c4e9c Remove deprecated DownloadManager constructor
Use the constructor that takes an `Executor` instead.

#minor-release

PiperOrigin-RevId: 534370613
2023-05-24 15:53:22 +01:00
ibaker
b762ca993e Clean up release notes
This change merges some duplicate sections, moves some items to more
appropriate sections and removes unnecessary items (deprecations are
self-documenting, so don't need to be included here).

#minor-release

PiperOrigin-RevId: 534363065
2023-05-24 15:51:11 +01:00
ibaker
594e9ac50d Remove deprecated DefaultLoadControl.Builder.createDefaultLoadControl()
Use `build()` instead.

#minor-release

PiperOrigin-RevId: 534348979
2023-05-24 15:50:05 +01:00
ibaker
cad1ac2eb5 Remove deprecated ExoPlayer.setHandleWakeLock(boolean)
Use `setWakeMode(int)` instead.

#minor-release

PiperOrigin-RevId: 534344010
2023-05-24 15:49:01 +01:00
bachinger
46fb454b3f Add artwork display mode to PlayerView
This change deprecates `PlayerView.setUseArtwork(boolean)` and
introduces `setArtworkDisplayMode(mode)` and
`artworkDisplayMode="off|fit|fill"` instead.

- off: no artwork is displayed (like deprecated useArtwork=false)
- fit: letterbox like media (like deprecated useArtwork=true)
- fill: scales the artwork to fill the entire width/weight of the player view

#minor-release

PiperOrigin-RevId: 534167226
2023-05-24 15:47:03 +01:00
christosts
b9a4e614f7 Fix seeking bug in opus
Fix a bug when seeking in an opus container. The calculations inside
DefaultOggSeeker may overflow a long primitive.

Issue: androidx/media#391

#minor-release

PiperOrigin-RevId: 534128513
2023-05-24 15:44:49 +01:00
huangdarwin
438ae0ed6a ExoPlayer: Add setVideoFrameProcessorFactory().
This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.

PiperOrigin-RevId: 534044831
2023-05-24 15:41:46 +01:00
ibaker
2b409da881 Remove deprecated zero-arg DefaultTrackSelector constructor
Use `DefaultTrackSelector(Context)` instead.

#minor-release

PiperOrigin-RevId: 533985937
2023-05-24 15:31:41 +01:00