1645 Commits

Author SHA1 Message Date
yschimke
1cfde16efd Make AudioTrackBufferSizeProvider public.
Was getting "java.lang.IllegalAccessError: Illegal class access" in debug app.

PiperOrigin-RevId: 465562541
2022-08-05 14:51:07 +00:00
yschimke
7893531888 Expose AudioOffload track state.
Adds a new event to AudioOffloadListener to get the offload state of the track, which indicates when software decoding is taking place.

PiperOrigin-RevId: 465264362
2022-08-04 09:47:41 +00:00
tonihei
61e4f92310 Merge pull request #109 from tzugen:patch-1
PiperOrigin-RevId: 464045351
2022-08-08 08:28:35 +00:00
tonihei
92816023f1 Merge pull request #115 from ittiam-systems:rtp_vp9fix
PiperOrigin-RevId: 463852948
2022-08-08 08:23:56 +00:00
tonihei
7f08ab729a Merge pull request #126 from stoyicker:cap_concurrent_remove_tasks
PiperOrigin-RevId: 463792127
2022-08-08 08:18:45 +00:00
olly
3786b64217 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
2022-08-08 08:02:36 +00:00
tonihei
e54d2f5658 Merge pull request #119 from ittiam-systems:rtp_h263_test_and_fix
PiperOrigin-RevId: 463146426
2022-08-08 08:01:44 +00:00
rohks
2312c185af Refactor unreleased changes in RELEASENOTES.md
#minor-release

PiperOrigin-RevId: 462395554
2022-08-08 07:58:07 +00:00
rohks
5c41b5a270 Move release notes for Issue: google/ExoPlayer#10429 to unreleased changes
#minor-release

PiperOrigin-RevId: 462391856
2022-08-08 07:57:12 +00:00
rohks
26c8478de6 Modify release date for 2.18.1 and media3:1.0.0-beta02
Also rearranged release notes to correctly show when the changes were released.

#minor-release

PiperOrigin-RevId: 462361982
2022-07-21 13:01:18 +00:00
tonihei
ee209690cb Ensure pending commands are still sent in MediaController.release()
We currently clear all pending messages, including the one that flushes
pending commands to the MediaSession. To ensure all commands that have
been called before controller.release() are still sent, we can manually
trigger the flush message from the release call.

Related to handling the final flush because disconnecting the controller,
MediaSessionStub didn't post the removal of the controller to the
session thread, creating a race condition between removing the controller
and actually handling the flush.

Issue: androidx/media#99
PiperOrigin-RevId: 462342860
2022-07-21 13:00:20 +00:00
christosts
436ff6d86a Make DefaultMediaNotificationProvider more configurable
Add a Builder to constructor DefaultMediaNotificationProvider. The
Builder can also set the provider's:
- notification ID
- notification channel ID
- notification channel name

The change adds an API for apps to set the small icon in notifications.

#minor-release
Issue: androidx/media#104
PiperOrigin-RevId: 462111536
2022-07-21 12:54:59 +00:00
tonihei
7cb7636ed9 Run MediaSessionStub commands in order
Some commands are run asynchronously and subsequent commands need
to wait until the previous one finished. This can be supported
by returning a Future for each command and using the existing
command execution logic to wait for each Future to complete.

As some MediaSessionStub code is now executed delayed to when it
was originally created, we also need to check if the session is
not released before triggering any actions or sending result codes.

Issue: androidx/media#85
PiperOrigin-RevId: 462101136
2022-07-21 12:54:06 +00:00
bachinger
5c2aabca66 Use the current overrides of the player as preset
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
2022-07-21 12:39:46 +00:00
rohks
be27daebc4 Version bump to exoplayer:2.18.1 and media3:1.0.0-beta02
#minor-release

PiperOrigin-RevId: 461162552
2022-07-15 10:20:58 +00:00
tonihei
adc50515e9 Fix setDataSourceFactory handling in DefaultMediaSourceFactory
The call doesn't currently reset the already loaded suppliers and
factories. Also fix the supplier loading code to use a local copy
of the current dataSourceFactory to avoid leaking an updated
instance to a later invocation.

Issue: androidx/media#116

#minor-release

PiperOrigin-RevId: 460721541
2022-07-13 17:48:16 +00:00
tonihei
9a616c0cee Use SingleThreadExecutor to release AudioTracks
We currently start a simple Thread to release AudioTracks
asynchronously. If many AudioTracks are released at the same
time, this may lead to OOM situations because we attempt to
create multiple new threads.

This can be improved by using a shared SingleThreadExecutor.
In the simple case of one simmultaneous release, it's exactly
the same behavior as before: create a thread and release it
as soon as it's done. For multiple simultanous releases we
get the advantage of sharing a single thread to avoid creating
more than one at the same time.

Issue: google/ExoPlayer#10057
PiperOrigin-RevId: 460698942
2022-07-13 17:47:20 +00:00
Rohit Singh
bd8723e35a Merge pull request #10185 from TiVo:p-custom-logger
PiperOrigin-RevId: 460689252
2022-07-13 17:45:54 +00:00
Rohit Singh
9d9bbe3d33 Merge pull request #110 from ittiam-systems:rtp_vp8_test
PiperOrigin-RevId: 460513413
2022-07-13 17:40:18 +00:00
tonihei
549496f1fa Add method to check if tunneling is enabled.
Issue: google/ExoPlayer#2518
PiperOrigin-RevId: 460482615
2022-07-13 17:36:42 +00:00
bachinger
6922bd58ee Enable onMediaMetadataChanged in CastPlayer
Issue: androidx/media#25
PiperOrigin-RevId: 460476841
2022-07-13 17:35:36 +00:00
bachinger
30fbc3a27d 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
2022-07-12 15:10:24 +00:00
christosts
4eb34e4c58 Listen to playWhenReady changes in LeanbackPlayerAdapter
#minor-release

Issue: google/ExoPlayer#10420
PiperOrigin-RevId: 460223064
2022-07-12 15:07:10 +00:00
Rohit Singh
f00f93a96e Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
2022-07-07 16:43:14 +00:00
tonihei
ceb23e69bb 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
2022-07-04 19:53:18 +00:00
rohks
21638fa378 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.

#minor-release

PiperOrigin-RevId: 458423162
2022-07-04 19:47:51 +00:00
rohks
c0359cad92 Fix formatting in release notes.
PiperOrigin-RevId: 458283415
2022-07-04 19:46:13 +00:00
ibaker
3fc6a66527 Ensure TalkBack announces the selected playback speed in the UI menu
Issue: google/ExoPlayer#10298
#minor-release
PiperOrigin-RevId: 457991028
2022-07-04 19:43:48 +00:00
rohks
621617f981 Make MetadataRenderer configurable to output metadata early.
PiperOrigin-RevId: 457974611
2022-07-04 19:42:59 +00:00
ibaker
6f9ce4056c 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
2022-07-04 19:41:19 +00:00
ibaker
b7241d4eb3 Fix typo in the media3 1.0.0-alpha02 / ExoPlayer 2.17.0 release notes
PiperOrigin-RevId: 457680579
2022-07-04 19:38:44 +00:00
ibaker
a67db31409 Fix release notes related to track selection renames and deletions
Issue: google/ExoPlayer#10363
PiperOrigin-RevId: 457679928
2022-07-04 19:37:47 +00:00
olly
6dc85dc241 Fix parsing H265 short term reference picture sets
Issue: google/ExoPlayer#10316
PiperOrigin-RevId: 456084302
2022-06-27 10:35:27 +01:00
bachinger
e2dff6e6fe Fix release notes
#minor-release

PiperOrigin-RevId: 455372269
(cherry picked from commit 4b4e7cb919ca4b2d9c889c5b82994c9d08991381)
2022-06-16 17:54:48 +00:00
bachinger
4b4e7cb919 Fix release notes
#minor-release

PiperOrigin-RevId: 455372269
2022-06-16 13:57:44 +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
1c0b4b32a4 Version bump to exoplayer:2.18.0 and media3:1.0.0-beta01
#minor-release

PiperOrigin-RevId: 455350486
2022-06-16 11:25:41 +00:00
Marc Baechinger
dc0e5c447b Merge pull request #63 from ittiam-systems:rtp-h263
PiperOrigin-RevId: 455347182
2022-06-16 11:24:41 +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
bachinger
8f844b32fd Avoid out of bounds when setting less media items than in playlist
Issue: androidx/media#86
#minor-release
PiperOrigin-RevId: 455182232
2022-06-15 18:55:54 +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
tonihei
21d4e85817 Remove setMediaUri/onSetMediaUri
This code path is now completely redundant as the same effect can be
achieved by using player.setMediaItem.

#minor-release

PiperOrigin-RevId: 455115567
2022-06-15 15:32:14 +00:00
tonihei
b475f1f2da 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
2022-06-15 15:30:05 +00:00
Marc Baechinger
ad3348cc69 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
2022-06-15 15:28:22 +00:00
Marc Baechinger
6377f9130d Merge pull request #10322 from DolbyLaboratories:dev-v2-multichannel
PiperOrigin-RevId: 454641746
(cherry picked from commit 970eb4444c54f7bf899e429d845cf978b97dced7)
2022-06-14 17:42:29 +00:00
Marc Baechinger
970eb4444c Merge pull request #10322 from DolbyLaboratories:dev-v2-multichannel
PiperOrigin-RevId: 454641746
2022-06-14 17:10:08 +00:00
ibaker
f6b987d8ec Ensure DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION is always executed
`codecDrainAction` is set to `DRAIN_ACTION_NONE` in 3 places in
`MediaCodecRenderer`:
* The constructor (so there's no prior state to worry about)
* `updateDrmSessionV23()`: Where `mediaCrypto` is reconfigured based
  on `sourceDrmSession` and `codecDrmSession` is also updated to
  `sourceDrmSession`.
* `resetCodecStateForFlush()`: Where (before this change) the action
  is unconditionally set back to `DRAIN_ACTION_NONE` and so any
  required updated implied by
  `DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` is not done.

This change ensures that `flushOrReleaseCodec()` handles
`DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` before calling .

This probably also resolves Issue: google/ExoPlayer#10274

#minor-release

PiperOrigin-RevId: 454114428
(cherry picked from commit 222faa96d063ba4a7f7e9fe8089228394bf1f97b)
2022-06-13 11:54:09 +00:00