Commit graph

18350 commits

Author SHA1 Message Date
tofunmi
aa0d7d7339 Add srgb color transfer
PiperOrigin-RevId: 525467798
2023-04-24 11:18:48 +01:00
tofunmi
9406410c48 Release BitmapTextureManager resources
PiperOrigin-RevId: 525434071
2023-04-24 11:17:31 +01:00
tofunmi
ec45c0d441 Add javadoc for ExternalTextureManager.release()
PiperOrigin-RevId: 525430439
2023-04-24 11:16:13 +01:00
Rohit Singh
e96b7cc5c7 Merge branch 'release' 2023-04-19 18:42:08 +01:00
Rohit Kumar Singh
3c01488f8d
Merge pull request #336 from androidx/release-1.0.1-stable
1.0.1
2023-04-19 18:08:17 +01:00
rohks
4f0b30b8a5 Add com.google.truth.extensions:truth-java8-extension to JAR list
PiperOrigin-RevId: 525415067
(cherry picked from commit 3788172afd)
2023-04-19 13:10:35 +01:00
rohks
3788172afd Add com.google.truth.extensions:truth-java8-extension to JAR list
PiperOrigin-RevId: 525415067
2023-04-19 13:00:06 +01:00
rohks
b1e3eac0f2 Update release notes for Media3 1.0.1 / ExoPlayer 2.18.6
PiperOrigin-RevId: 525176828
(cherry picked from commit 07ff3eeead)
2023-04-18 19:07:04 +01:00
bachinger
85fb32d70f Use withLivePostrollPlaeholderAppended to add placeholder
PiperOrigin-RevId: 525177113
2023-04-18 18:14:32 +01:00
rohks
07ff3eeead Update release notes for Media3 1.0.1 / ExoPlayer 2.18.6
PiperOrigin-RevId: 525176828
2023-04-18 18:13:24 +01:00
tofunmi
9c3d30791a Move glObjectsProvider to DefaultVideoFrameProcessor.Factory.Builder
Removes glObjectsProvider from `VideoFrameProcessor` and `Effects`. Apps will set the glObjectsProvider on the DefaultVideoFrameProcessor.Factory.Builder when providing a custom DefaultVideoFrameProcessor.Factory, rather than in `Effects`.

PiperOrigin-RevId: 525169059
2023-04-18 18:12:14 +01:00
tofunmi
fae8111f59 Rename InternalTextureManager to BitmapTextureManager
A new texture manager will be created for input by texture ID so this texture manager won't be the only one to handle internal (i.e. non-external) textures.

PiperOrigin-RevId: 525116460
2023-04-18 18:11:02 +01:00
bachinger
c623b965c5 Use DataSourceBitmapLoader in session demo app
Issue: androidx/media#327
PiperOrigin-RevId: 525103046
2023-04-18 18:09:24 +01:00
andrewlewis
990f7ef5b5 Select codecs without util methods
`findDecoder/EncoderForFormat` seem to be more restrictive than querying
`MediaCodecList` as done for playback, and it's not clear that the cases where
no codec is found correspond to actual cases that would fail given that it
seems this returns an empty string for many cases in production.

Switch to using `MediaCodecUtil` and `EncoderUtil` for querying codecs instead.

PiperOrigin-RevId: 525078321
2023-04-18 18:08:18 +01:00
kimvde
23b1cab56c Fix video timestamp 0 set to large value in some cases
PiperOrigin-RevId: 525064269
2023-04-18 18:07:19 +01:00
Googler
ffa969f97c Expose MssimCaluclator for use in Duetdev tests
Child: <unknown commit>

PiperOrigin-RevId: 524876651
2023-04-18 18:06:01 +01:00
tonihei
fa972d9c1f Fix thread access when creating notifications for media sessions
The sessions may have different application threads for their players,
and the service with its notification provider runs on the main thread.
To ensure everything runs on the correct thread, this change labels
methods where needed and fixes thread access in some places.

Issue: androidx/media#318
PiperOrigin-RevId: 524849598
(cherry picked from commit ffa3743069)
2023-04-18 17:05:28 +01:00
tonihei
8c5c58ec7e Remove unnecessary check for currentMediaItem in legacy session stub
This check was a leftover from when the metadata was generated from
the MediaItem only. Since we moved to the actual MediaMetadata fields,
the check is completely unnecessary and prevents accessing metadata
when the GET_CURRENT_MEDIA_ITEM command is not available.

PiperOrigin-RevId: 524837587
(cherry picked from commit e0bb23d463)
2023-04-18 15:19:27 +01:00
ibaker
d784857f1f Document style guide and google-java-format in CONTRIBUTING.md
Prompted by discussion on this commit: e8117496e0

#minor-release

PiperOrigin-RevId: 524795901
(cherry picked from commit f799766db5)
2023-04-18 15:18:42 +01:00
ibaker
d5a81c5c41 Use @link instead of @value
Dackka doesn't support `@value`

PiperOrigin-RevId: 524309695
(cherry picked from commit b834e49f9f)
2023-04-18 15:18:39 +01:00
tonihei
3b2b8d528d Ensure TrackSelectionParameters overrides match existing groups
The overrides specified by a MediaController may not use the exact
same TrackGroup instances as known to the Player because the groups
have been bundled to and from the controller. This bundling may
alter the instance slightly depending on the version used on each
side of the communication and the fields set (e.g. Format.metadata
is not supported for bundling).

This issue can be solved by creating unique track group ids for
each group on the session side before bundling. On the way back,
the groups in the track selection parameters can be mapped backed
to their original instances based on this id.

Issue: androidx/media#296
PiperOrigin-RevId: 523986626
(cherry picked from commit 1c557e2fd1)
2023-04-18 15:17:40 +01:00
rohks
ba6ccee802 Update colr box values to be overridden by bitstream boxes
#minor-release

PiperOrigin-RevId: 523983688
(cherry picked from commit 596a7c7033)
2023-04-18 15:16:49 +01:00
rohks
ade8831166 Bump version numbers to Media3 1.0.1 and ExoPlayer 2.18.6
#minor-release

PiperOrigin-RevId: 523959161
(cherry picked from commit e033dbac03)
2023-04-18 15:16:49 +01:00
rohks
1076756d1c Enable multidex for demo-gl app
#minor-release

PiperOrigin-RevId: 523708424
(cherry picked from commit 81fd9d2867)
2023-04-18 15:16:49 +01:00
bachinger
eb322b7c2e Precedence for app provided media button receiver
This change selects the best suited media button receiver
component and pending intent when creating the legacy
session. This is important to ensure that a service can
be started with a media button event from BT headsets
after the app has been terminated.

The `MediaSessionLegacyStub` selects the best suited
receiver to be passed to the `MediaSessionCompat`
constructor.

1. When the app has declared a broadcast receiver for
 `ACTION_MEDIA_BUTTON` in the manifest, this broadcast
 receiver is used.
2. When the session is housed in a service, the service
 component is used as a fallback.
3. As a last resort a receiver is created at runtime.

When the `MediaSessionLegacyStub` is released, the media
button receiver is removed unless the app has provided a
media button receiver in the manifest. In this case we
assume the app supports resuming when the BT play intent
arrives at `MediaSessionService.onStartCommand`.

Issue: androidx/media#167
Issue: androidx/media#27
Issue: androidx/media#314
PiperOrigin-RevId: 523638051
(cherry picked from commit e54a934398)
2023-04-18 15:16:46 +01:00
tonihei
93605303ad Update available commands when setting a new player in MediaSession
PiperOrigin-RevId: 523633865
(cherry picked from commit ae875648a7)
2023-04-18 15:00:09 +01:00
christosts
abc9d8ceda Change format logged when AudioSink throws InitializationException
Change what format is logged from MediaCodecAudioRenderer when
AudioSink throws InitializationException. We printed the
AudioSink's format, which most of the times is audio/raw (PCM)
and not the renderer's format. With this change both formats are
logged.

#minor-release

Issue: google/ExoPlayer#11066
PiperOrigin-RevId: 523456840
(cherry picked from commit baf1aa1cdb)
2023-04-18 14:59:20 +01:00
tonihei
0690c9ba67 Replace deprecated onBackPressed call
PiperOrigin-RevId: 523361561
(cherry picked from commit be85684dc9)
2023-04-18 14:59:19 +01:00
tonihei
8aec88b2b4 Add missing initial update to the subtitle button in the session demo
The button gets only updated after an onTracksChanged callback but
isn't set to the initial state similar to other changes triggered
by callbacks (e.g. updateRepeatSwitchUI)

PiperOrigin-RevId: 522274800
(cherry picked from commit 14ba173dfe)
2023-04-18 14:59:19 +01:00
tonihei
5d11aa95ef Implement missing broadcastCustomCommand to legacy controller
And also mention a few restrictions regarding legacy components
in Javadoc.

Issue: androidx/media#293
PiperOrigin-RevId: 522005562
(cherry picked from commit 502969a42b)
2023-04-18 14:58:24 +01:00
tonihei
86cc91687c Allow duplicated MediaItems in a legacy session
MediaItems are not meant to be unique in a playlist. If a legacy
session publishes multiple items that get converted to equal MediaItems,
the current code fails because we look up queue ids in a Map (that
doesn't allow duplicate entries).

Fix this by storing a simple list of items with additional data.

Issue: androidx/media#290
PiperOrigin-RevId: 521993802
(cherry picked from commit 219967c5a3)
2023-04-18 14:57:31 +01:00
rohks
10e2dfd2fa Remove Javadoc TODO from README of decoder extensions
As most classes are used via interface only and people depending on it locally can always find the Javadoc in Android Studio directly, we don't plan to add Javadocs for these extensions module in developer.android.com.

PiperOrigin-RevId: 521993756
(cherry picked from commit e4cb583af2)
2023-04-18 14:56:46 +01:00
tonihei
654a6786a6 Improve check for invalid connection request
The check currently relies on the default value of 0 returned if the
Bundle doesn't define a pid. But in some cases, like Robolectric unit tests,
0 is a possible pid. The check can be improved by directly asserting that
the value is defined.

PiperOrigin-RevId: 521414649
(cherry picked from commit 694d690bc0)
2023-04-18 14:56:46 +01:00
ibaker
3480a27994 Add warning logs if DefaultDrmSessionManager is used on wrong thread
Issue: google/ExoPlayer#11008
PiperOrigin-RevId: 520864579
(cherry picked from commit 7ca9668421)
2023-04-18 14:56:46 +01:00
Googler
3daaad7acd ...Suppress MissingSuperCall warnings on onBackPressed()...
PiperOrigin-RevId: 520709134
(cherry picked from commit 5af28a980d)
2023-04-18 14:56:45 +01:00
ibaker
10342507f7 Temporarily use exoplayer2-hosted SVGs in media3 javadoc
The media3-hosted versions of these SVGs were removed due to a change in
the way the reference docs are generated. While work on getting them
hosted on developer.android.com, this change simply links to the
(identical) exoplayer2 versions in order to fix the media3 docs.

#minor-release

PiperOrigin-RevId: 520647905
(cherry picked from commit 2e4f49fef7)
2023-04-18 14:56:45 +01:00
tonihei
d07fcc3457 Remove remaining references to exoplayer.dev
PiperOrigin-RevId: 520314781
(cherry picked from commit 6952771e2f)
2023-04-18 14:56:45 +01:00
ibaker
66b1282517 Post OfflineLicenseHelper interactions to its internal handler thread
`DefaultDrmSession(Manager)` expect most of their methods to be called
on the 'playback thread'. There isn't a playback thread in the case of
`OfflineLicenseHelper`, but in that case it's the thread backing
`DefaultDrmSessionManager.playbackLooper`, which is `OfflineLicenseHelper.handlerThread`.

PiperOrigin-RevId: 520053006
(cherry picked from commit 376bddef47)
2023-04-18 14:56:45 +01:00
tonihei
56dd0f761d Handle output format changes for empty sample streams correctly
When MediaCodecRenderer is given an empty sample stream, it puts
its output format change tracking in a bad state where we never
process future stream changes because we are waiting for a sample
that doesn't exist.

We can fix this by:
 - Looping the pending output stream changes to see if we processed
   more than one change at once (this fixes the tracking for empty
   sample streams that are not the first in the queue).
 - Checking if none of the previous streams queued any samples in
   onStreamChanged to handle this in the same way as the case
   where we already output all samples (this fixes the problem when
   the empty sample stream comes first in the queue).
 - Also calling onProcessedStreamChange for the case above, which
   was missing previously.

#minor-release

PiperOrigin-RevId: 519226637
(cherry picked from commit b9790e69d7)
2023-04-18 14:56:45 +01:00
Tianyi Feng
690ac23a20 Merge pull request #11051 from TiVo:p-fix-for-issue-11050
PiperOrigin-RevId: 518953648
(cherry picked from commit dc3481fca7)
2023-04-18 14:56:41 +01:00
michaelkatz
eea37031d1 Retry RTSP Setup with TCP if response with UDP is UnsupportedTransport
If RTSP Setup Request with UDP receives HTTP Error Status 461 UnsupportedTransport, then client will retry with TCP.

Issue: google/ExoPlayer#11069
PiperOrigin-RevId: 518807829
(cherry picked from commit ecf4d8b891)
2023-04-18 14:55:46 +01:00
Rohit Singh
b70b320c49 Merge pull request #11064 from haixia-meta:release-v2
PiperOrigin-RevId: 517128752
(cherry picked from commit 0e3f407e0e)
2023-04-18 14:54:34 +01:00
rohks
65d4202f6e Add support to fetch ColorInfo from hvcc box in AtomParsers
#minor-release

PiperOrigin-RevId: 517086016
(cherry picked from commit 8a5fcf82d3)
2023-04-18 14:54:34 +01:00
Rohit Singh
60e0546bea Merge pull request #11061 from cedricxperi:dts-udts-support
PiperOrigin-RevId: 517067549
(cherry picked from commit 49d85d625c)
2023-04-18 14:54:34 +01:00
tonihei
a94fb21dcb Make DefaultDashChunkSource more robust against empty segment timelines
Segment timelines are technically allowed to be empty, but not all places
add the necessary checks.

Issue: google/ExoPlayer#11014
PiperOrigin-RevId: 514722205
(cherry picked from commit 788132b9dc)
2023-04-18 14:54:30 +01:00
ibaker
4666d57b12 Ensure ForwardingPlayer users do listener registration correctly
The `@CallSuper` annotation should help catch cases where subclasses are
calling `delegate.addListener` instead of `super.addListener` but it
will also (unintentionally) prevent subclasses from either completely
no-opping the listener registration, or implementing it themselves in a
very custom way. I think that's probably OK, since these cases are
probably unusual, and they should be able to suppress the warning/error.

Issue: androidx/media#258

#minor-release

PiperOrigin-RevId: 513848402
(cherry picked from commit 5d23a92923)
2023-04-18 14:49:09 +01:00
tonihei
6f4fca8cbf Delete unused and unfinished legacy MediaPlayer wrapper
This was just for testing and finishing this class is not useful
as it can't wrap an existing MediaPlayer without owning it to
track its state.

PiperOrigin-RevId: 524851654
2023-04-17 17:22:18 +01:00
sheenachhabra
3b9ee1c1a1 Add NAL unit start code in csd0/csd1 test data
The actual csd data contains NAL units so it should always start with
a NAL unit start code (00 00 00 01).
This issue was not caught before because in the code there was no
validation to check whether its a valid NAL unit.

PiperOrigin-RevId: 524849867
2023-04-17 17:21:32 +01:00
tonihei
ffa3743069 Fix thread access when creating notifications for media sessions
The sessions may have different application threads for their players,
and the service with its notification provider runs on the main thread.
To ensure everything runs on the correct thread, this change labels
methods where needed and fixes thread access in some places.

Issue: androidx/media#318
PiperOrigin-RevId: 524849598
2023-04-17 17:20:36 +01:00
christosts
9081c70788 Publish experimental bandwidth meter classes
PiperOrigin-RevId: 524846153
2023-04-17 17:19:44 +01:00