13824 Commits

Author SHA1 Message Date
ibaker
b165f2c098 Switch the RELEASENOTES source-of-truth from exoplayer2 to media3
Both files will be updated when new versions are released, but
unreleased notes will only be accumulated in the media3 file.

PiperOrigin-RevId: 433736599
2022-03-24 17:23:19 +00:00
claincly
2e991acbdc Fix namings in SsimHelper.
There's no use of encoders in SsimHelper, changed all to "decoder".

PiperOrigin-RevId: 433730292
2022-03-24 17:22:12 +00:00
olly
2ea902c1b2 Move TrackSelection back to ExoPlayer module
PiperOrigin-RevId: 433729648
2022-03-24 17:21:11 +00:00
ibaker
50efd86619 Rollback of d5482fe343
*** Original commit ***

Don't call MediaDrm.setLogSessionId in FrameworkMediaDrm

This method throws an UnsupportedOperationException on some Android 12
devices.

***

PiperOrigin-RevId: 433708582
2022-03-24 17:19:59 +00:00
Ian Baker
d0db1114c6 Merge branch 'release' 2022-03-15 15:41:46 +00:00
Ian Baker
72a4fb082d
Merge pull request #52 from androidx/release-1.0
r1.0.0-alpha03
2022-03-15 15:37:28 +00:00
huangdarwin
0587a4f9c4 Transformer GL: Rename TexCoords to TexSampleCoords.
The variable marks the coordinates used to sample from a texture, so hopefully
this makes the naming a bit more descriptive.

This renames vTexCoords and aTexCoords. No functional changes intended.

PiperOrigin-RevId: 433499934
2022-03-09 17:38:35 +00:00
bachinger
e531e788df Transform map of AdsLoader.State to a Bundle
This fixes an exception thrown when parceling becasue the type can not be found
(expects the AdsPlaybackState to be Serializable). Transforming the map and the
ad playback states to a Bundle fixes the problem.

#minor-release

PiperOrigin-RevId: 433491993
2022-03-09 17:37:34 +00:00
ibaker
583249345a Version bump to exoplayer:2.17.1 and media3:1.0.0-alpha03
#minor-release

PiperOrigin-RevId: 433467068
(cherry picked from commit af6f6bb40666d5c27fd4274ad5e3479cf593ce04)
2022-03-09 16:38:20 +00:00
huangdarwin
d06d690d78 Transformer GL: Remove unused setResolution exception javadoc.
PiperOrigin-RevId: 433467719
2022-03-09 14:55:33 +00:00
ibaker
af6f6bb406 Version bump to exoplayer:2.17.1 and media3:1.0.0-alpha03
#minor-release

PiperOrigin-RevId: 433467068
2022-03-09 14:51:19 +00:00
bachinger
e5d1466731 Avoid rebuffering at the end of SSAI post-rolls
When the start position of a MediaPeriodInfo is equal or higher than the duration,
we set the start position to `duration - 1` to end on the last frame. With server
side inserted ad streams, this has the effect that we actually need to seek back to
the last content frame after a post-roll.

This is desirable when actually ending on that frame but produces a BUFFERING event
when transitioning from an SSAI stream with a post-roll to the next media item in
the playlist. This change sets the start position to the duration when we are
clipping the last content period of an SSAI stream that is played in a playlist.

PiperOrigin-RevId: 433445680
2022-03-09 12:22:02 +00:00
hschlueter
140be836dd Use background thread for FrameEditor's OpenGL calls.
If an OpenGL call blocks because the encoder's input surface is full,
this will now block the background thread while the main thread can
continue querying encoder output and free up encoder capacity until
it accepts more input unblocking the background thread.

PiperOrigin-RevId: 433283287
2022-03-09 15:12:28 +00:00
olly
98e039d872 Rollback of aa22bc2dbe
*** Original commit ***

Fix PlayerView touch handling

Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the vi...

***

PiperOrigin-RevId: 433262414
2022-03-09 15:11:23 +00:00
samrobinson
3ef4f6ff24 Disable calculating SSIM on instrumentation tests.
PiperOrigin-RevId: 433237266
2022-03-09 15:10:24 +00:00
christosts
b94ca4f2ad Only COMMAND_PLAY starts the service in the foreground
This change makes all notification actions start MediaSessionService
in the background except COMMAND_PLAY which starts the service
in the foreground. This is to avoid ANRs that are raised if we don't
call MediaSessionService.startForeground() within 5 seconds since the
service was started in the foreground.

We only call MediaSessionService.startForeground() when
Player.getPlayWhenReady() returns true, and only COMMAND_PLAY sets
playWhenReady to true.

Issue: androidx/media#20

#minor-release

PiperOrigin-RevId: 433229604
2022-03-09 15:09:27 +00:00
claincly
2f4630a8e8 Improve resolution fallback logic.
With the new version, we try the following before fixing resolution:

- Fix size alignment
- Try 3/4 the width and height
- Try 2/3 the width and height
- Try 1/2 the width and height

Also: align the resolution ends in 1 or 9 to 0.
PiperOrigin-RevId: 433206358
2022-03-09 15:08:15 +00:00
samrobinson
a349f311d4 Nit cleanup of SsimHelper.
PiperOrigin-RevId: 433174767
2022-03-09 15:07:15 +00:00
christosts
fae8097aca Custom notification actions start the service in background
PiperOrigin-RevId: 433172330
2022-03-09 15:06:07 +00:00
olly
aa22bc2dbe Fix PlayerView touch handling
Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the view before ACTION_UP as a click,
   both for delivery to OnClickListener and for toggling
   the controls.

Note: After this change, control visibility will not be
toggled if the application developer explicitly sets the
view to be non-clickable. I think that's probably working
as intended though. It seems correct that a non-clickable
view would not respond to clicks.

Issue: google/ExoPlayer#8627
Issue: google/ExoPlayer#9605
Issue: google/ExoPlayer#9861
PiperOrigin-RevId: 433016626
2022-03-09 15:05:07 +00:00
olly
08b861b61a Decouple UI module from ExoPlayer
This change rewrites the UI module's track selection
components to depend on the Player API, allowing us to
finally remove the UI module's dependency on ExoPlayer
as a concrete player implementation.

PiperOrigin-RevId: 432989318
2022-03-09 15:04:11 +00:00
claincly
5ab32b6e0d Record transformation duration in TransformerAndroidTestRunner.
The change will be useful in testing transcoding performance

PiperOrigin-RevId: 432956283
2022-03-09 15:03:10 +00:00
samrobinson
743c6cf5f8 Remove SSIM calculation on audio only output.
PiperOrigin-RevId: 432937645
2022-03-09 15:02:02 +00:00
samrobinson
04ed774bef Add regression test forcing encode/decode.
PiperOrigin-RevId: 432928418
2022-03-09 15:01:00 +00:00
claincly
461effc6c2 Use getSupportedWidth/HeightFor() API for finding resolution.
Previously, we've used getSupportedHeights/Widths() to find the supported
resolution. However, the height/width can be over-reported when using these
APIs. For example, getSupportedWidths and getSupportedHeights can both return
3840, but the supported height when using 3840 as width is only 2160.

PiperOrigin-RevId: 432926192
2022-03-09 15:00:00 +00:00
bachinger
dc83fae19d Ignore MetadataRenderer when evaluating SSAI period transitions
This makes the reading period advance early as expected at the end of an ad
period. Before this change the reading position of the metadata renderer
prevented advancing the period until metadata arrived after the start position of
the following period. Only then the reading position of the metadata renderer
is updated and beyond the start position of the following period which is a
condition to advance the reading period.

Because transitioning to the next period is a virtual transition and the
SharedMediaPeriod keeps reading from the same underlying sample streams, the
metadata renderer can safely be ignored for this check.

#minor-release

PiperOrigin-RevId: 432646037
(cherry picked from commit c7c75173224057defd031aa30bbf8346442700a6)
2022-03-08 17:11:59 +00:00
christosts
c56c6a2ea4 Start playback from notification
This change fixes two bugs where MediaSessionServe shows a notification
with the Play icon but tapping it will not start playback:
1. After playback ends: we need to seek to the beginning of the media
   item.
2. After adding media items to the player but not starting playback:
   We need to call Player.prepare() too.

PiperOrigin-RevId: 432469953
(cherry picked from commit 1023b9d55efe8f0470c5f3b75cd84e40860f79be)
2022-03-08 17:11:55 +00:00
christosts
4456a865cc Misc cleanup in session tests
PiperOrigin-RevId: 432430345
(cherry picked from commit 8e98187a1e08167cbef08c94e632c8d84a4667f1)
2022-03-08 16:58:05 +00:00
ibaker
50550ab191 Remove media3 PlayerView javadoc references to overriding layouts
These should have been removed as part of 1391b7c65d, since we no
longer officially support overriding the layout file for this class.

This class is known as StyledPlayerView in exoplayer2.

#minor-release

PiperOrigin-RevId: 432411322
(cherry picked from commit a353b3332abefc798d9751f037e7ef7a78ecbeae)
2022-03-08 16:58:05 +00:00
christosts
25004f8988 Remove CountDownLatch from MockPlayer
The MockPlayer has a single CountDownLatch field and multiple boolean
flags that track if a player method was called. Upon calling the methods
the latch count. Tests set the latch count to match exactly with the
number of expected player interactions then block the test thread until
the latch reaches zero and assert the respective method flags are true.

This is subject to false positives. If the underneath implementation
changes and call more player method, then the test thread will unblock
as soon as a certain number of interactions is performed, which may be
less than what the test expected originally. However, the test may stil
pass if the player thread had enough time to update the expected method
flag.

This change removes the single CountDownLatch and the boolean flags and
instead it adds APIs to query the MockPlayer if a method has been called
and await until a method is called. Internally, the MockPlayer has a
ConditionVariable per method.

PiperOrigin-RevId: 432399077
(cherry picked from commit 45d512160c7c14eda33785a632a1fc3eebc9769d)
2022-03-08 16:58:05 +00:00
andrewlewis
7afaf97489 Fix E-AC3 output capability check without sample rate
#minor-release

PiperOrigin-RevId: 432189509
(cherry picked from commit a73a9e9ca5e1a93518443e3e20953727a4189e9a)
2022-03-08 16:58:05 +00:00
ibaker
d20160d751 Deprecate SingleSampleMediaSource.Factory#setTrackId
This method is no longer needed since we added SubtitleConfiguration#id
in 59d98b9a4e.

Issue: google/ExoPlayer#10016

#minor-release

PiperOrigin-RevId: 432169262
(cherry picked from commit 232f2d815d4bf306bddca033b8b5a1454af8601f)
2022-03-08 16:58:05 +00:00
ibaker
8e386ef21c More 2.17.0 release note fixes
#minor-release

PiperOrigin-RevId: 432154626
(cherry picked from commit 986928a89c7291ce997153e1b9351f2b4fb94f69)
2022-03-08 16:58:05 +00:00
Ian Baker
49e6fa805a Merge pull request #10011 from tonykwok:dev-v2
PiperOrigin-RevId: 431395359
(cherry picked from commit c961ea1ca7c119b309456033021434dd38ad0e84)
2022-03-08 16:58:05 +00:00
bachinger
291c95daa0 Accept page index 0 for getChildren() in MediaLibraryServiceLegacyStub
This is consistent with the new MediaSessionStub that accepts page index 0
and the JavaDoc of legacy and new service callbacks.

Issue: androidx/media#32
PiperOrigin-RevId: 431390454
(cherry picked from commit 9821dd282c05dde945d787b8c1d4259fbc22bfef)
2022-03-08 16:58:05 +00:00
ibaker
405795ca98 Cross-reference the corresponding media3 and exoplayer releases
PiperOrigin-RevId: 431376857
(cherry picked from commit 3e9dfaa5865217420c2ac5dc8f103a7c2d9f152d)
2022-03-08 16:58:05 +00:00
bachinger
6f5206cd76 Drop ads for which we don't have metadata when joining a live stream
When a live stream is joined while ads are already playing, the LOADED event is
missed and we don't have ad information for those ads in the ad group that are
before the ad index at which we joined. This way we can clip the duration when we
receive the LOADED event for the last ad in the group. This fixes the problem of
the playback controls being hidden when content resumes after the ad group.

#minor-release

PiperOrigin-RevId: 431269627
(cherry picked from commit 8e8c59031c328e4c64a16193732078568712a632)
2022-03-08 16:58:05 +00:00
ibaker
bc1bcab553 Remove exoplayer-only release note from media3
There's no media3 equivalent to the
`com.google.android.exoplayer:exoplayer` dependency.

PiperOrigin-RevId: 430955037
(cherry picked from commit 8ae74ad873e18cd8510b9a398a264b3359766347)
2022-03-08 16:58:05 +00:00
ibaker
ca50beee6c Remove duplicate media3 release note and fix formatting
PiperOrigin-RevId: 430946606
(cherry picked from commit 5d0c7b91d042970811b5fcc095c4148542b31cf8)
2022-03-08 16:58:04 +00:00
ibaker
a8fd90ec84 Update media3 docs with details of new release branch
PiperOrigin-RevId: 430911179
(cherry picked from commit 7d389361063059656ee54c7297c99a76683b19bd)
2022-03-08 16:58:04 +00:00
ibaker
16819edebd Remove unecessary git checkout command from README
The command is not needed, because the specified branch is already the
default branch on GitHub so will be checked out by clone automatically.

PiperOrigin-RevId: 430910549
(cherry picked from commit d34221519d907f002abce245a3450ccacf988de8)
2022-03-08 16:58:04 +00:00
olly
d10700456d FMP4: Fix output of mixed v0 and v1 emsg samples
Issue: google/ExoPlayer#9996
#minor-release
PiperOrigin-RevId: 430773329
(cherry picked from commit 5a304fdbd9bc8af8229b1a9cddc79f359fe8e215)
2022-03-08 16:58:04 +00:00
ibaker
7125a3361b Update the gradle wrapper scripts
Generated by running:
./gradlew wrapper --gradle-version 7.4 --distribution-type all

#minor-release

PiperOrigin-RevId: 430666317
(cherry picked from commit 92af42bf2588e9f9a102b8f6812e140e077f2d6a)
2022-03-08 16:58:04 +00:00
ibaker
c5b046900d Update gradle wrapper to 7.4
#minor-release

PiperOrigin-RevId: 430454251
(cherry picked from commit e8096f07b9a458310589685b6019d5d79cbde433)
2022-03-08 16:58:04 +00:00
bachinger
c7c7517322 Ignore MetadataRenderer when evaluating SSAI period transitions
This makes the reading period advance early as expected at the end of an ad
period. Before this change the reading position of the metadata renderer
prevented advancing the period until metadata arrived after the start position of
the following period. Only then the reading position of the metadata renderer
is updated and beyond the start position of the following period which is a
condition to advance the reading period.

Because transitioning to the next period is a virtual transition and the
SharedMediaPeriod keeps reading from the same underlying sample streams, the
metadata renderer can safely be ignored for this check.

#minor-release

PiperOrigin-RevId: 432646037
2022-03-05 14:16:43 +00:00
olly
fdbae6379d Simplify application of track overrides
PiperOrigin-RevId: 432485797
2022-03-04 18:54:25 +00:00
olly
23db11453d DownloadHelper: Add getTracksInfo
We will be migrating our track selection UI components to be
based on TracksInfo. We need DownloadHelper to expose TracksInfo
to make it compatible with such components.

PiperOrigin-RevId: 432474487
2022-03-04 18:10:45 +00:00
christosts
1023b9d55e Start playback from notification
This change fixes two bugs where MediaSessionServe shows a notification
with the Play icon but tapping it will not start playback:
1. After playback ends: we need to seek to the beginning of the media
   item.
2. After adding media items to the player but not starting playback:
   We need to call Player.prepare() too.

PiperOrigin-RevId: 432469953
2022-03-04 17:52:46 +00:00
claincly
6ae2629c60 Add method to disable passthrough.
PiperOrigin-RevId: 432461547
2022-03-04 17:15:16 +00:00
olly
0206622370 DownloadHelper: Support multiple track selection overrides
addTrackSelectionForSingleRenderer takes a list of legacy overrides,
which are then set on the supplied parameters one at a time to run
track selection. This allows multiple overrides for a single track
type to be applied in the download use case, despite it not being
possible to place such overrides directly into a single parameters.

For new style overrides, multiple overrides for the same track type
can be placed directly into a single parameters. Therefore we'll be
able to replace use of addTrackSelectionForSingleRenderer with use
of addTrackSelection, which is a much cleaner API. For this to work,
we need to make DownloadHelper apply multiple overrides in this case.

PiperOrigin-RevId: 432459834
2022-03-04 17:06:26 +00:00