14090 Commits

Author SHA1 Message Date
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
Ian Baker
494fc40810 Merge branch 'release-v2' into dev-v2 2022-03-08 12:10:40 +00:00
Rakesh Kumar
8afa7a548a Fix review comments in RtpVP8Reader
Change-Id: Id47c746b199831d0bb51dc736c43fd20c2e79c08
2022-03-08 16:54:36 +05:30
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
bachinger
25e5680415 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
d7df426069 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
olly
aafe5f48bd 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
3f615040c0 Add method to disable passthrough.
PiperOrigin-RevId: 432461547
2022-03-04 17:15:16 +00:00
claincly
6ae2629c60 Add method to disable passthrough.
PiperOrigin-RevId: 432461547
2022-03-04 17:15:16 +00:00
olly
b83c2cb8cb 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
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
samrobinson
039de75f1f Move AndroidTestUtil run methods to a TransformerAndroidTestRunner.
This will allow for easier customisation of the additional tasks
performed by the test runner, such as calculating metrics like SSIM.

PiperOrigin-RevId: 432434850
2022-03-04 14:52:55 +00:00
samrobinson
0316c03319 Move AndroidTestUtil run methods to a TransformerAndroidTestRunner.
This will allow for easier customisation of the additional tasks
performed by the test runner, such as calculating metrics like SSIM.

PiperOrigin-RevId: 432434850
2022-03-04 14:52:55 +00:00
christosts
8e98187a1e Misc cleanup in session tests
PiperOrigin-RevId: 432430345
2022-03-04 14:24:42 +00:00
ibaker
52a8caedf6 Remove unused constants from (Styled/Legacy)PlayerView
These were added in
b57aa34b66
and then not removed when the rest of the code was removed in
0b0277af50

PiperOrigin-RevId: 432419684
2022-03-04 13:07:27 +00:00
ibaker
41276e8b9b 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
2022-03-07 11:38:51 +00:00
andrewlewis
e66d0c9039 Fix E-AC3 output capability check without sample rate
#minor-release

PiperOrigin-RevId: 432189509
2022-03-07 11:35:09 +00:00
ibaker
540f2061cb 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
2022-03-07 11:31:27 +00:00
ibaker
c2a3249f98 Remove unused constants from (Styled/Legacy)PlayerView
These were added in
b57aa34b66
and then not removed when the rest of the code was removed in
0b0277af50

PiperOrigin-RevId: 432419684
2022-03-04 13:07:27 +00:00
ibaker
a353b3332a 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
2022-03-07 11:30:48 +00:00
christosts
45d512160c 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
2022-03-07 11:30:00 +00:00
andrewlewis
a73a9e9ca5 Fix E-AC3 output capability check without sample rate
#minor-release

PiperOrigin-RevId: 432189509
2022-03-07 11:29:06 +00:00
ibaker
232f2d815d 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
2022-03-07 11:28:25 +00:00
Rakesh Kumar
f2e0953643 Updated way to create a formatBuilder
Change-Id: I2c8eb8d6ee28d8c044d71db042f3b186ea5762f3
2022-03-03 19:59:56 +05:30
olly
2cb2f6ded4 DownloadHelper: Accept generic TrackSelectionParameters
DownloadHelper is in the ExoPlayer module, so there's no reason
why it can't use ExoPlayer specific track selections. That said,
we want our UI components to operate on generic
TrackSelectionParameters, and we want such UI components to be
useful for selecting tracks for download. To keep this interop,
it's necessary to have DownloadHelper accept generic
TrackSelectionParameters, or to require application code to
convert them. The first approach seems preferable!

PiperOrigin-RevId: 432158846
2022-03-03 12:34:30 +00:00
ibaker
733cd609a0 More 2.17.0 release note fixes
#minor-release

PiperOrigin-RevId: 432154626
2022-03-03 12:31:02 +00:00
olly
ad81d5dd20 TrackSelectionOverride: Remove select-all-tracks constructor
This constructor always does the wrong thing for non-adaptive groups
containing more than 1 track, because it'll incorrectly generate an
adaptive selection. Replace it with a constructor for specifying a
single track within the group instead.

PiperOrigin-RevId: 431673458
2022-03-03 12:27:28 +00:00
hschlueter
e53dbf893e Use asset with increasing timestamps for matrix transformation test.
PiperOrigin-RevId: 431658068
2022-03-03 12:23:53 +00:00
hschlueter
550299db9a Avoid duplicate logging of GL exceptions.
Only log GL exceptions in GlUtil if they aren't thrown. Otherwise,
it's up to the caller whether or not to log them to avoid logging them
twice.

PiperOrigin-RevId: 431657397
2022-03-03 12:20:18 +00:00
olly
2d3eea1e24 DownloadHelper: Accept generic TrackSelectionParameters
DownloadHelper is in the ExoPlayer module, so there's no reason
why it can't use ExoPlayer specific track selections. That said,
we want our UI components to operate on generic
TrackSelectionParameters, and we want such UI components to be
useful for selecting tracks for download. To keep this interop,
it's necessary to have DownloadHelper accept generic
TrackSelectionParameters, or to require application code to
convert them. The first approach seems preferable!

PiperOrigin-RevId: 432158846
2022-03-03 12:17:33 +00:00