18729 Commits

Author SHA1 Message Date
cushon
45d35c5d78 Suppress warnings in preparation for Checker Framework version 3.34.0-eisop1
More information: go/checker-lsc

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:539686832:BASE:539663180:1686589466563:d12d5eb7
PiperOrigin-RevId: 539887073
2023-06-14 20:29:07 +01:00
claincly
5961637c0a Add test for per-MediaItem effect
The test transcodes four media items with distinct effects, keeping one frame
each; extracts the four frames in the produced video, and compares them against
the expected results.

PiperOrigin-RevId: 539697344
2023-06-14 20:27:37 +01:00
ibaker
959e974138 Release ExoPlayer instances in ExoPlayerTest
This was recommended in https://github.com/robolectric/robolectric/issues/8187#issuecomment-1552060094

PiperOrigin-RevId: 539691757
2023-06-14 20:25:53 +01:00
tofunmi
4bceb64dee Version bump to media3:1.1.0-rc01
#minor-release

PiperOrigin-RevId: 539632164
2023-06-12 14:14:33 +00:00
tofunmi
03745de432 Change the rc release date
#minor-release

PiperOrigin-RevId: 539628823
2023-06-12 14:13:15 +00:00
bachinger
c2f78db87e Clean up HLS sample for cast demo
Issue: androidx/media#452
#minor-release
PiperOrigin-RevId: 539613535
2023-06-12 14:11:36 +00:00
claincly
4b1ac2f172 Factor out video decoding and fix two minor issues
1. Not treating 0 as valid buffer index
2. Not handling the case the last frame is a comparison frame

PiperOrigin-RevId: 539607482
2023-06-12 14:09:48 +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
tofunmi
219212d54f rename videoFrameProcessorTestRunner.queueInputBitmap
This methods currently registers and queues the bitmaps Will need to have a method that just queues bitmaps in future CLs.

#minor-release

PiperOrigin-RevId: 539605628
2023-06-12 14:06:22 +00:00
claincly
5f43180a68 Allow using different video effects per MediaItem
PiperOrigin-RevId: 539596345
2023-06-12 14:04:42 +00:00
kimvde
1c18503ad0 Transmux video with negative rotation if possible
PiperOrigin-RevId: 539593035
2023-06-12 14:03: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
Googler
5c29abbbf4 Rollback of a66f08ba97
*** Original commit ***

Add a timer to end a video stream prematurely in ExtTexMgr

***

This has been submitting for more than 1.5hrs. "This presubmit is running slowly because you have been throttled by Build Queue due to using too much of your Product Area's quota."

adding NO_SQ as this is a pure rollback

PiperOrigin-RevId: 539135970
2023-06-09 18:36:17 +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
cd604e7ead Fix splitting ad playback state for partial ad group when joining
This change addresses the case when the user joins the live stream
on an ad period but the metadata for the ad period is not emitted.
This results in inserting a partial ad group.

In this case the ad group duration is longer than the partial ad
group. If now the partial ad group ends at the period before the
last period of the window (unknown duration), the splitting algorithm
didn't recognize that the ad group already ended and made the last
period wrongly an ad period.

This change handles this edge case by counting the mapped ads in
the partial ad group to detect this situation and stops splitting.

#minor-release

PiperOrigin-RevId: 539102785
2023-06-10 20:23:56 +00:00
claincly
edf30433b6 Add missing empty lines
PiperOrigin-RevId: 539100987
2023-06-10 20:22:38 +00:00
ibaker
3cf21bd5d5 Require the list returned by SubtitleParser to be sorted by timestamp
This makes it more efficient to consume (e.g. we can binary search
through it).

PiperOrigin-RevId: 539095673
2023-06-10 20:21:29 +00:00
michaelkatz
fafeafa72d Return offload unsupported for formats not supported by the sdk level
PiperOrigin-RevId: 539079342
2023-06-10 20:20:20 +00:00
bachinger
71153a43a8 Make current period a placeholder when a live stream is reset
In case the player is reset while a live stream is playing, the current
period needs to be a placeholder. This makes sure that the default start
position is used when the first live timeline arrives after re-preparing.

#minor-release

PiperOrigin-RevId: 539044360
2023-06-09 14:06:11 +00:00
claincly
a66f08ba97 Add a timer to end a video stream prematurely in ExtTexMgr
PiperOrigin-RevId: 539036285
2023-06-09 14:04:49 +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
bachinger
a67ce066df Enable re-preparing the ImaSSAIMediaSource
#minor-release

PiperOrigin-RevId: 538927855
2023-06-09 13:59:59 +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
jbibik
28b8fb706a Make StreamKey Bundleable and remove deprecated trackIndex
#minor-release

PiperOrigin-RevId: 538809105
2023-06-09 13:57:05 +00:00
tofunmi
276f2f1fe6 Add 'Keep every nth frame' frame dropping strategy.
#minor-release

PiperOrigin-RevId: 538804347
2023-06-09 13:55:39 +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
claincly
a7cff4e0e3 Fix calling extra registerInputStream and not handling EOS
PiperOrigin-RevId: 538796466
2023-06-09 13:52:44 +00:00
sheenachhabra
53c174f047 Add support for passing custom metadata via transformer
Changes included:
1. Enable MP4 extractor to read all types of metadata.
2. Allow passing String and Float metadata via Transformer.

Reference to QuickTime spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW21

PiperOrigin-RevId: 538783982
2023-06-09 13:51:15 +00:00
michaelkatz
c86fff5393 Catch exceptions for creating AudioFormat with unsupported arguments
PiperOrigin-RevId: 538753539
2023-06-08 12:49:38 +00:00
sheenachhabra
2753fb0e3e Enable nullness checker for Muxer module androidTest library
PiperOrigin-RevId: 538742957
2023-06-08 12:48:03 +00:00
huangdarwin
0c924fcb40 Test: Add no-op effect test for GL tone mapping.
To ensure no regressions for the potentially confusing pipeline of:
* HDR electrical -> SDR linear EOTF+OOTF, and
* SDR linear -> SDR electrical OETF

PiperOrigin-RevId: 538741079
2023-06-08 12:46:34 +00:00
tofunmi
ce203ccfed DefaultVideoFrameProcessorMultipleTextureOutputPixelTest fixes & cleanup
PiperOrigin-RevId: 538495675
2023-06-08 12:45:07 +00:00
huangdarwin
9dad207603 Test: Move duplicated GL tone mapping logic into helper methods.
PiperOrigin-RevId: 538491957
2023-06-08 12:43:40 +00:00
kimvde
3ba8f6dd8f Remove unnecessary thread in AssetLoader tests
Also queue textures from a different thread in TextureAssetLoader, to
have a behaviour closer to reality.

PiperOrigin-RevId: 538473089
2023-06-08 12:41:30 +00:00
jbibik
e7f7e86f3e Fix 1 ErrorProneStyle finding
PiperOrigin-RevId: 538469993
2023-06-08 12:40:06 +00:00
tofunmi
c3b9328d74 Tests for disabled color transfers
#minor-release

PiperOrigin-RevId: 538466615
2023-06-08 12:38:36 +00:00
huangdarwin
adf53b4d50 Effect: Add multiple texture output test.
Confirms that multiple textures can be output, and that timestamps and pixels
are as expected.

PiperOrigin-RevId: 538459296
2023-06-08 12:37:00 +00:00
andrewlewis
828a05e0fa Log additional information on test runner timeout
PiperOrigin-RevId: 538437142
2023-06-08 12:35:36 +00:00
Tofunmi Adigun-Hameed
9aa519f1ee Merge pull request #371 from tatsuyafujisaki:simplify-loadJSONFromAsset
PiperOrigin-RevId: 538423581
2023-06-08 12:34:08 +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
sheenachhabra
7e14811e25 Add support for passing creation time via InAppMuxer
PiperOrigin-RevId: 538175466
2023-06-06 18:12:51 +00:00
Tofunmi Adigun-Hameed
9ca6e5d90d Merge pull request #425 from vishnuchilakala:set_min_live_position
PiperOrigin-RevId: 538173603
2023-06-06 18:11:48 +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
claincly
08e7158be5 Add utility to create ScheduledExecutorService
PiperOrigin-RevId: 538129792
2023-06-06 18:09:26 +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
Googler
7956c80f73 Rollback of 2a6f893fba
*** Original commit ***

BEGIN_PUBLIC
Set video size to 0/0 when video render is disabled

In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior

***

PiperOrigin-RevId: 537938947
2023-06-06 18:06:46 +00:00
Googler
83e9080b71 Override ParserException#getMessage
PiperOrigin-RevId: 537908595
2023-06-06 18:05:33 +00:00
ibaker
d328e62f69 Add a 'more version details' box to the GitHub bug issue template
#minor-release

PiperOrigin-RevId: 537893360
2023-06-06 18:04:16 +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