14701 Commits

Author SHA1 Message Date
bachinger
6180035ecf Add migration script
Note: This was already reviewed in <unknown commit>. This doesn't mean we cannot apply further changes though.
PiperOrigin-RevId: 460542835
(cherry picked from commit f9a39201aafdb9b660d8c57fb8ffa051a9dc31c7)
2022-07-12 20:43:24 +00:00
bachinger
05a1bbf66e Don't set the tag in CastTimeline
Leaving the media item that has been passed in unchanged, ensures that the
media item in the timeline is equal to the media item that the user has
passed into the player. The value of the tag is the uid of the window,
meaning this is redundant information.

#minor-release

PiperOrigin-RevId: 460542246
(cherry picked from commit b61a06ba2f1aa4cc75dc1702ad94e483101adc51)
2022-07-12 20:41:57 +00:00
Rohit Singh
da52b9489a Merge pull request #110 from ittiam-systems:rtp_vp8_test
PiperOrigin-RevId: 460513413
(cherry picked from commit 9d9bbe3d33721b1301ae16df7f87f9aa51d06b89)
2022-07-13 17:40:18 +00:00
bachinger
97716cd0a1 Enable onMediaMetadataChanged in CastPlayer
Issue: androidx/media#25
PiperOrigin-RevId: 460476841
(cherry picked from commit 6922bd58ee844cc8293ef885918d01e2d0fbc02b)
2022-07-12 16:04:45 +00:00
ibaker
fff99fe93f Group COMMAND_SET_MEDIA_ITEM and COMMAND_CHANGE_MEDIA_ITEMS together
I don't think it's useful to keep these in numerical order, it makes
more sense to keep them grouped into a 'logical' ordering.

#minor-release

PiperOrigin-RevId: 460453464
(cherry picked from commit ad46cb1c81addfc20b7333a451741a717e85da18)
2022-07-12 14:06:27 +00:00
bachinger
fe6baee775 Use the public MediaItem in the timeline of CastPlayer
The media item needs to be assigned to `Window.mediaItem` in `CastTimeline.setWindow`. For this the `MediaItem` needs to be available in the timeline.

When a `MediaItem` is passed to the `set/addMediaItems` method, we can't yet know the Cast `MediaQueueItem.itemId` that is generated on the device and arrives with an async update of the `RemoteMediaClient` state. Hence in the `CastTimelineTracker`, we need to store the `MediaItem` by Casts's `MediaItem.contentId`. When we then receive the updated queue, we look the media item up by the content ID to augment the `ItemData` that is available in the `CastTimeline`.

Issue: androidx/media#25
Issue: google/ExoPlayer#8212

#minor-release

PiperOrigin-RevId: 460325235
(cherry picked from commit 30fbc3a27d1c2b673c3f0a6f1c8956e183b11952)
2022-07-11 23:22:27 +00:00
christosts
329aa5864c Listen to playWhenReady changes in LeanbackPlayerAdapter
#minor-release

Issue: google/ExoPlayer#10420
PiperOrigin-RevId: 460223064
(cherry picked from commit 4eb34e4c58e9cdfc804a5e3347ef30e9991c0186)
2022-07-11 15:49:33 +00:00
rohks
c40d669c51 Add tests for extracting MP4 with large bitrates
Also added the test to `MP4PlaybackTest`.

PiperOrigin-RevId: 459492188
(cherry picked from commit 05e728a31eb85b82610a5eb83622ee2670582a26)
2022-07-07 13:04:29 +00:00
christosts
f9e082743d Add missing Nullable annotation
PiperOrigin-RevId: 459485334
(cherry picked from commit cb87b7432f4c08a597d048114b5006d09de29da9)
2022-07-07 12:17:36 +00:00
tonihei
9af65a909d Don't block AudioTrack when waiting for previous release
We wait until a previous AudioTrack has been released before
creating a new one. This is currently done with a thread
block operation, which may cause ANRs in the extreme case
when someone attempts to release the player while this is
still blocked.

The problem can be avoided by just returning false from
DefaultAudioSink.handleBuffer to try again until the previous
AudioTrack is released.

Reproduction steps to force the issue:
1. Add Thread.sleep(10000); to the AudioTrack release thread.
2. Add this to the demo app:
    private int positionMs = 0;

    Handler handler = new Handler();
    handler.post(new Runnable() {
      @Override
      public void run() {
        player.seekTo(positionMs++);
        if (positionMs == 10) {
          player.release();
        } else {
          handler.postDelayed(this, 1000);
        }
      }
3. Observe Player release timeout exception.

These steps can't be easily captured in a unit test as we can't
artifically delay the AudioTrack release from the test.

Issue: google/ExoPlayer#10057
PiperOrigin-RevId: 459468912
(cherry picked from commit a83ab05aeceb6c99f3b7b19d6fedd20f317e0aa6)
2022-07-07 10:22:56 +00:00
bachinger
87b817b0f9 Fix incorrect link tags
PiperOrigin-RevId: 459215618
(cherry picked from commit 87adb88f57afb050a96a9c67dd9eb55fb3a6706c)
2022-07-06 11:02:12 +00:00
Rohit Singh
bc47036993 Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
(cherry picked from commit f00f93a96e0c7fa4f37e32e280b073d1cef2649e)
2022-07-07 16:43:14 +00:00
tonihei
d2027a8338 Exclude HEVC 10bit profile on Pixel 1.
This profile is declared as supported although it isn't.

Issue: google/ExoPlayer#10345
Issue: google/ExoPlayer#3537

#minor-release

PiperOrigin-RevId: 459205512
(cherry picked from commit 656eaf74d13d5c35b67ef16b21c6ddbdd1266fc8)
2022-07-06 09:46:27 +00:00
bachinger
1f1460a152 Use mediaId as contentId if available
This is to be consistent with what cast `QueueMediaItem` is doing. If a contentId is
not available the contentUrl is used as the ID.

#minor-release

PiperOrigin-RevId: 459133323
(cherry picked from commit 0a9f9007c66ca725959b3fe70311dd72dc086346)
2022-07-05 23:21:59 +00:00
Marc Baechinger
1bbaec9c1b Merge pull request #96 from fengdai:release
PiperOrigin-RevId: 458883441
(cherry picked from commit 8e5af4a3aa43a3f2e0fd96415adf800a0abf8507)
2022-07-04 19:56:41 +00:00
tonihei
1def7b5a36 Only consider enabled tracks in ProgressiveMediaPeriod.bufferedPosition
ProgressiveMediaPeriod loads all available tracks into SampleStreams
(because it needs to read the data anyway and it allows easy activation
of tracks without reloading). However, the SampleStreams for disabled
tracks are not read and no one if waiting for them.

The buffered position is used for user-visible state (e.g. in the UI)
and to check how much data is already buffered to decide when to stop
buffering (using LoadControl). Both values benefit from only
using the actually enabled tracks to better reflect what is available
for playback at the moment.

Issue:Issue: google/ExoPlayer#10361
PiperOrigin-RevId: 458475038
(cherry picked from commit ceb23e69bbdc075df96943e5c29d52cf1d492db9)
2022-07-01 15:28:39 +00:00
bachinger
3de3f41757 Document custom commands in the DefaultMediaNotificationProvider
Issue: androidx/media#103
#minor-release
PiperOrigin-RevId: 458465479
(cherry picked from commit 2c0806814bd28612834b51b8489a138e5eb10ecf)
2022-07-01 14:27:24 +00:00
bachinger
23888c1217 Use ContextCompat.getMainExecutor when calling MediaBrowser methods
This allows the service to be switched to run in another process and the app still works the same as if it is running in the same process.

Issue: androidx/media#100
PiperOrigin-RevId: 458460005
(cherry picked from commit c9abe70259adabd1523b0e2aa0a4df74d78339d9)
2022-07-01 13:53:11 +00:00
rohks
1ec7148c96 Fix MP4 parser issue in reading bitrates from esds boxes.
As per MP4 spec, bitrates in esds boxes can be a 32 bit number which doesn't fits in Java int type, so now reading it as a long value. Our class for holding media format, only allows bitrates value to be an int as we don't expect the bitrates to be greater than or equal to 2^31. So we're limiting the values for bitrates to Integer.MAX_VALUE.

PiperOrigin-RevId: 458423162
(cherry picked from commit 21638fa3784078170af3be545316e062313a30b5)
2022-07-01 09:52:45 +00:00
rohks
4d6781be2c Fix MP4 parser issue in reading length of URL array from esds boxes.
As per MP4 spec, the length of URL array is a 8 bit number.

#minor-release

PiperOrigin-RevId: 458421436
(cherry picked from commit 42f13c331f8c7e28505edcd1e033c5525e5c22f2)
2022-07-01 09:39:11 +00:00
ibaker
258d9361c4 Ensure TalkBack announces the selected playback speed in the UI menu
Issue: google/ExoPlayer#10298
PiperOrigin-RevId: 457991028
(cherry picked from commit 3fc6a66527c6af940b45dd0d2ce1f3fb19491fa0)
2022-06-29 16:10:11 +00:00
ibaker
8b2b7868f3 Consider shuffle order in Timeline.equals()
Previously two timelines that differed only in shuffle order were
considered equal, which resulted in no call to
Player.Listener.onTimelineChanged when calling
ExoPlayer.setShuffleOrder. This in turn resulted in no call to
MediaControllerCompat.Callback.onQueueChanged.

Also make a small fix inside ExoPlayerImpl.setShuffleOrder, to ensure
that the new shuffle order is used when constructing the masked
timeline.

Issue: google/ExoPlayer#9889
#minor-release
PiperOrigin-RevId: 457703727
(cherry picked from commit 6f9ce4056cc427076ba48189ab192e65234da4d8)
2022-06-28 12:15:54 +00:00
ibaker
968169c784 Use a helper function and Truth Correspondence instead of NoUidTimeline
NoUidTimeline still exists as a private detail of TestUtil, but it no
longer extends ForwardingTimeline because the interactions are quite
hard to reason about.

#minor-release

PiperOrigin-RevId: 457703593
(cherry picked from commit 2a2d9e360baa6e1a44be53c39fbcd69079f34dcc)
2022-06-28 12:15:03 +00:00
ibaker
cad5134f60 Fix typo in the media3 1.0.0-alpha02 / ExoPlayer 2.17.0 release notes
PiperOrigin-RevId: 457680579
(cherry picked from commit b7241d4eb32fc049b2c6765a356ff5f18717f825)
2022-06-28 09:33:29 +00:00
ibaker
36e92aeeab Fix release notes related to track selection renames and deletions
Issue: google/ExoPlayer#10363
PiperOrigin-RevId: 457679928
(cherry picked from commit a67db3140947ec42e27bca516147483969cf1a01)
2022-06-28 09:30:11 +00:00
tonihei
9274f08b89 Clean up offload state tracking
1. The offloadSchedulingEnabled value doesn't need to be in
   PlaybackInfo because it's never updated in EPII.
2. The sleepingForOffload value in EPII wasn't updated explicitly
   (just via the return value of a method). It was also only
   meant to be enabled while the player is actively playing, but
   confusingly triggered from a path where the player may
   theoretically be buffering as well.
3. The offload sleeping (=not scheduling doSomeWork) was interwoven
   into the actual scheduling code making it slightly hard to follow.
   This can be improved slightly by keeping the offload sleeping
   decision and the scheduling separate.

PiperOrigin-RevId: 457427293
(cherry picked from commit 5c2752b4a92a076babc0bc1ff5651a306c20e693)
2022-06-27 09:34:56 +00:00
tonihei
7683c8bf6c Rename shouldUseDummySurface to shouldUsePlaceholderSurface
This was likely missed in 33373d0d0a.

PiperOrigin-RevId: 457422574
(cherry picked from commit 8e716d6804e4c5b3417a19e1ef3c07cf2810aefd)
2022-06-27 10:04:19 +01:00
olly
2f1260e346 Inform ProgressiveMediaPeriod of known length earlier
PiperOrigin-RevId: 456753343
(cherry picked from commit 1d2ad39a4d4778124a6b87c3d3a7a4415eeb8865)
2022-06-23 14:31:27 +01:00
tonihei
59fbb45506 Clear pending doSomeWork messages when sleeping for offload
The offload sleeping stops as soon as a new DO_SOME_WORK message
is handled (because this indicates an expected change in rendering
and we want to stop sleeping until we know it's safe to do so).

Every exit path from doSomeWork needs to clear other pending
DO_SOME_WORK messages as these requests have already been handled by
the current method invocation. This currently doesn't happen from the
offload sleeping return path and a previously queued DO_SOME_WORK
message can immediately wake up the rendering loop again.

Fix this by moving the message removal to the beginning of the
doSomeWork method (as it prevents forgetting it in one of the
exit paths later).

PiperOrigin-RevId: 456259715
(cherry picked from commit a7649b639cef242f70cf832f5dbf56514b7e8c4b)
2022-06-21 15:58:04 +01:00
olly
4e51ef5a2c Fix parsing H265 short term reference picture sets
Issue: google/ExoPlayer#10316
PiperOrigin-RevId: 456084302
(cherry picked from commit 6dc85dc241dca8f0783d3ffbb3448840b0e75b60)
2022-06-20 16:46:15 +01:00
Ian Baker
2c7201024e
Merge pull request #88 from androidx/main-r1.0.0-beta01
r1.0.0 beta01
1.0.0-beta01
2022-06-17 11:42:16 +01:00
Ian Baker
5f741bbe5a Add lint baseline for spurious API-level warnings
The API 32 SDK has incorrect versioning metadata for Spatializer. It
reports the whole class has only been present since API 33 (which is
surely impossible given it's present in the API 32 SDK):
https://issuetracker.google.com/234009300

The metadata seems to be correct in the API 33 SDK, so this baseline
will no longer be needed when we bump to `compileSdkVersion = 33`.
2022-06-17 10:08:37 +01:00
ibaker
68e5612c0d Publish api.txt to media3 GitHub
#minor-release

PiperOrigin-RevId: 455372568
(cherry picked from commit c7f1b465d4dfcfb1657425e4557e47e627d127cf)
2022-06-16 17:54:49 +00:00
bachinger
e2dff6e6fe Fix release notes
#minor-release

PiperOrigin-RevId: 455372269
(cherry picked from commit 4b4e7cb919ca4b2d9c889c5b82994c9d08991381)
2022-06-16 17:54:48 +00:00
christosts
265b865b26 Misc improvement in Util
#minor-release

PiperOrigin-RevId: 455380010
(cherry picked from commit 7563bd2792d85c61223c12dd0c4c5a77d1b75b13)
2022-06-16 14:39:46 +00:00
bachinger
e53a649a41 Add lint base xml file for string.xml files
Fixing lint errors in the string.xml files makes no sense because these are
overridden with the next automated string import. Adding a lint-baseline.xml
instead for the ui module.

See https://issuetracker.google.com/208178382

#minor-release

PiperOrigin-RevId: 455354304
(cherry picked from commit 61ab75b8b88050a12492c412e8c79ebf75fc1d9c)
2022-06-16 13:05:17 +00:00
bachinger
36b976f70f Version bump to exoplayer:2.18.0 and media3:1.0.0-beta01
PiperOrigin-RevId: 455350486
(cherry picked from commit 1c0b4b32a400ab9f7fb316ed7729ea2b8a32957f)
2022-06-16 11:46:35 +00:00
Marc Baechinger
9c02cdb1fb Merge pull request #63 from ittiam-systems:rtp-h263
PiperOrigin-RevId: 455347182
(cherry picked from commit dc0e5c447b926c0d1117182c4e4abf0abc0e9dcb)
2022-06-16 11:41:49 +00:00
bachinger
14aced6304 Avoid out of bounds when setting less media items than in playlist
Issue: androidx/media#86
#minor-release
PiperOrigin-RevId: 455182232
(cherry picked from commit 8f844b32fdf4d41d6a5690e57e55d0c383ee7e3e)
2022-06-15 19:05:26 +00:00
christosts
56cfa66d3b Misc javadoc fix.
PiperOrigin-RevId: 455157744
(cherry picked from commit 12e756273091f64152b0f053bee401684f9edbf6)
2022-06-15 17:05:54 +00:00
tonihei
039e102552 Update initial bitrate estimates
#minor-release

PiperOrigin-RevId: 455140203
(cherry picked from commit 646bf565c35c43ff59d4a7d51ee60036368339b6)
2022-06-15 17:00:36 +00:00
bachinger
5ebc07ce76 Updating translations
#minor-release

PiperOrigin-RevId: 455128997
(cherry picked from commit 958105c91c931fa942ce7de4e8311589eca76564)
2022-06-15 17:00:36 +00:00
tonihei
6791532778 Remove setMediaUri/onSetMediaUri
This code path is now completely redundant as the same effect can be
achieved by using player.setMediaItem.

PiperOrigin-RevId: 455115567
(cherry picked from commit 21d4e8581701e12743626f49823a667d9f05ed68)
2022-06-15 17:00:27 +00:00
tonihei
6ed3e40681 Support setMediaItem(s) in MediaControllerImplLegacy
These calls were not implemented so far as they require a mix of
initial prepareFrom/playFrom calls and addQueueItem. We can also
support clients without queue handling to set single MediaItems.

To make the calls consistent and predictable in the session,
we need to ensure that none of the play/pause/addQueueItem/
removeQueueItem/prepare/playFromXYZ/prepareFromXYZ are called
before the controller is prepared and has media.

#minor-release

PiperOrigin-RevId: 455110246
(cherry picked from commit b475f1f2daba8e0ed2497cbf17f4b834e58c59a4)
2022-06-15 16:52:51 +00:00
Marc Baechinger
080b1862c2 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
(cherry picked from commit ad3348cc69d240ed3a1248496938fda57e20368e)
2022-06-15 16:52:51 +00:00
bachinger
d867ebd1df Add lint base to make gradle lint run without errors
PiperOrigin-RevId: 454951844
(cherry picked from commit 29bf4c8aabd9003e907d31563b9eead4658c1fce)
2022-06-15 16:52:51 +00:00
bachinger
fde58ed91d Add many quantity for fr an fr-CA
See https://issuetracker.google.com/208178382

PiperOrigin-RevId: 454949204
(cherry picked from commit 1f380c1dd36b4554286d0f4e93bc0479579eb991)
2022-06-15 16:52:51 +00:00
bachinger
676f766e39 Make HttpDataSourceTestEnv require API 19
PiperOrigin-RevId: 454945333
(cherry picked from commit 7f89531c5b0c894946c2ca4bf54cfc66e3d4507b)
2022-06-15 16:52:51 +00:00
bachinger
e3e92b2448 Suppress lint errors RestrictedApis in lib-session
PiperOrigin-RevId: 454943102
(cherry picked from commit 252ae4c7a34889b8622cc2750c238dc40be0277b)
2022-06-15 16:52:50 +00:00
olly
c4479c719f Cleanup: Remove unnecessary self-refs in Util
PiperOrigin-RevId: 455121899
(cherry picked from commit 99cdc515ae13b2fecba620102a854fc6b312c3c9)
2022-06-15 14:08:00 +00:00