9360 Commits

Author SHA1 Message Date
huangdarwin
9ad5650876 HDR: Update test FileUtil to handle null ColorInfo.
PiperOrigin-RevId: 486706595
(cherry picked from commit 0b53c934d8f391000c72a0a9d6ced9c2bdb77a95)
2022-11-07 18:49:14 +00:00
Googler
fe47393618 Add @SuppressWarnings to unblock T SDK for <unknown commit>
LSC: https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

TESTED=NA
BEGIN_PUBLIC/END_PUBLIC
PiperOrigin-RevId: 486180995

(cherry picked from commit 88445d213a3ebfd30b32994dbdacc9488923041e)
2022-11-04 17:57:11 +00:00
huangdarwin
b949b6b5f3 HDR Test: Add link to tested method.
PiperOrigin-RevId: 485890141
(cherry picked from commit bd4e58d68bd219154e3d90b0a1031236f8608e96)
2022-11-03 16:13:17 +00:00
Googler
dadf2812ec Add 'Player.getVideoSurfaceSize' that returns the size of the surface
on which the video is rendered.

Design Doc: go/aaos-mu-media-dd

PiperOrigin-RevId: 485884772
2022-11-03 15:50:19 +00:00
ibaker
b25e1e2f24 Fix Dackka javadoc errors in protected methods
If there's an @param javadoc tag in a supertype then all overrides
of this method that don't also override the javadoc must use the same
parameter name.

PiperOrigin-RevId: 485857711
(cherry picked from commit b8e5d708fc77a06e831abd7f2c2e57f68bb3720f)
2022-11-03 13:35:39 +00:00
ibaker
10d06dd12f Fix Dackka/Metalava errors in the effects module
Public methods may only refer to public types in their signature. This
change ensures that by switching to a public supertype everywhere.

PiperOrigin-RevId: 485568625
(cherry picked from commit 3fdfe585ffe927c90f412b892101dbe01119b8df)
2022-11-02 12:21:56 +00:00
huangdarwin
e48fe57cc7 Apply tone mapping workaround to Pixel Watch as well.
Not sure what BUILD.ID the fix will first be applied on though.

PiperOrigin-RevId: 485389618
(cherry picked from commit 2ddd645a3484aed4b9e519f99f4ab1bc989b6a0e)
2022-11-01 19:36:40 +00:00
huangdarwin
69112df555 HDR: Generalize Pixel 6 workaround to TP
PiperOrigin-RevId: 485366659
(cherry picked from commit 6de5d9336db68cab7ffa886869fe882af6299223)
2022-11-01 18:09:01 +00:00
rohks
721487a701 Disable failing tests of FlacExtractorSeekTest
PiperOrigin-RevId: 485061783
(cherry picked from commit 55b82ff8ae491f6bcc7f3901476d2b1571a10005)
2022-10-31 15:53:41 +00:00
samrobinson
a3de075b3d Disable the muxer watchdog if all tracks have ended.
PiperOrigin-RevId: 484512661
(cherry picked from commit 2390322a00a9e71f16dfe28088ae7cd3e462129f)
2022-10-28 13:13:05 +00:00
andrewlewis
c02d477cc2 Upgrade dackka and fix some generation errors
#minor-release

PiperOrigin-RevId: 484483080
(cherry picked from commit fc1eca10f4934fd92c84db222815fc1e77ddd5f6)
2022-10-28 10:03:56 +00:00
kimvde
d652020229 Add test for muxer watchdog timer
PiperOrigin-RevId: 484298261
(cherry picked from commit 42057cc9f8f81e24c64c629d2e11e7102afd0f30)
2022-10-27 18:01:11 +00:00
bachinger
f06e8ee736 Make adding ad live breaks more robust
This change makes adding ad events in live streams more robust by allowing ad
groups to grow in number of ads if more ad events are received than initially
announced by the SDK.

With the IMA prefetch feature, an AdPod can grow in size in certain conditions
like from initially 2 ads to 4 ads being part of the ad group. With this change,
if an additional ad event arrives while the ad group is still being played,
the ad group is expanded. If the event arrives late and the ad group is already
completed, a new group is created for the remaining ads.

This also covers the case where we join the live stream while an ad is being
played and we missed at least one LOADED event from the SDK. Ads of the group
before the first LOADED event are ignored in such a case.

PiperOrigin-RevId: 484214760
(cherry picked from commit 136addf640e451602163be9e4272d1e27b8ed5b8)
2022-10-27 11:10:10 +00:00
kimvde
94f3b1bf53 Add muxer timer to detect when generating an output sample is too slow
This allows to throw when the Transformer is stuck or is too slow.

PiperOrigin-RevId: 484179037
(cherry picked from commit 376ee77f52bed47de54c6478b4006f1b25a543d0)
2022-10-27 07:58:56 +00:00
samrobinson
861cd9a00e Add AudioProcessor.AudioFormat equals method.
PiperOrigin-RevId: 483983486
(cherry picked from commit c9585d0154980c576710d035be51eb472fbd6665)
2022-10-26 16:02:24 +00:00
ibaker
6b3bec8618 Fix Cea608Decoder handling of service switch commands in field 2
From ANSI-CTA-608-E R-2014 section 8.4:
> When closed captioning is used on line 21, field 2, it shall conform
> to all of the applicable specifications and recommended practices as
> defined for field 1 services with the following differences:
> 1. The non-printing character of the miscellaneous control-character
>    pairs that fall in the range of 0x14, 0x20 to 0x14, 0x2F in field 1,
>    shall be replaced with 0x15, 0x20 to 0x15, 0x2F when used in field
>    2.
> 2. The non-printing character of the miscellaneous control-character
>    pairs that fall in the range of 0x1C, 0x20 to 0x1C, 0x2F in field
>    1, shall be replaced with 0x1D, 0x20 to 0x1D, 0x2F when used in
>    field 2.

This basically means that `cc1=0x15` in field 2 should be interpreted as
`cc1=0x14` in field 1, and same for `0x1D -> 0x1C`.

The `isMiscCode`  method above already handles this by ignoring the LSB
(the only difference between `0x14` and `0x15`, and `0x1C` and `0x1D`)
by AND-ing with `0xF6` instead of `0xF7`. This change uses the same
trick in `isServiceSwitchCommand`.

Issue: google/ExoPlayer#10666
#minor-release
PiperOrigin-RevId: 483927506
(cherry picked from commit 7c6d492ff19b6aead4cc6f1f9a426145fc1faa0d)
2022-10-26 11:09:04 +00:00
samrobinson
fe9bad1119 Move DefaultAudioSink.AudioProcessorChain to AudioProcessorChain
Split inner interface into separate file, which will go in common
module. The old interface will be deprecated and extends the new.

#cleanup

PiperOrigin-RevId: 483732226
(cherry picked from commit ad52b68c738e8321b966b904d3cd2139f7a560ef)
2022-10-25 18:31:22 +00:00
samrobinson
8debe79333 Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
(cherry picked from commit dda17db261758f7211ffa793ee9cc6fea842addb)
2022-10-25 16:40:38 +00:00
claincly
053e14aaaa Add GL utility methods to get 4x4 identity and set identity
PiperOrigin-RevId: 483671580
(cherry picked from commit f5ad4e098dd71bd4f99b87350e042acab4f95746)
2022-10-25 14:47:52 +00:00
ibaker
0f5245f7b1 Use int for an unsigned byte value in Cea608Decoder
This is a no-op, but it's more 'correct' because it avoids any potential
sign mix-ups that come from storing an unsigned byte (with a
potentially set MSB) in a signed java byte variable.

PiperOrigin-RevId: 483409798
(cherry picked from commit 3d0f43a149c846670480c993e09def1a2d2eeeea)
2022-10-24 16:51:08 +00:00
samrobinson
154cd42437 Add CanIgnoreReturnValue to AudioProcessor#configure + implementations
Although it can be useful to check the output format, it's not required or needed.

For some AudioProcessor implementations, it is stated/obvious that
the output format will match the input, in which case there is no
a need to check the return value.

#cleanup

PiperOrigin-RevId: 483403679
(cherry picked from commit a7bfa12eecb42cbdd13bd7e612603a4d400ebda4)
2022-10-24 16:27:18 +00:00
ibaker
84375a4588 Fix some incorrect comments in Cea608DecoderTest
Also used all-caps consistently

PiperOrigin-RevId: 483317405
(cherry picked from commit 6dcb9aaaa87d1a11a0eb41d1f80312796bceb55a)
2022-10-24 09:18:36 +00:00
bachinger
b20752f6d4 Add DAI specific methods to AdPlaybackState
PiperOrigin-RevId: 482755468
(cherry picked from commit a8e6894ad63271293a831d13419b1372fe0f387a)
2022-10-21 11:32:44 +00:00
Rohit Singh
23b070d151 Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
(cherry picked from commit fd2ba37b1d67576313aec0512d630331b7c99f4b)
2022-10-24 10:55:19 +00:00
michaelkatz
b97a9593fa Change areSizeAndRateSupported to use PerfomancePoint.covers
PiperOrigin-RevId: 482461219
(cherry picked from commit 0eb30eacc7f65f84e34e038567d0dd86dc4b6e2c)
2022-10-20 12:20:14 +00:00
kimvde
dc8098a5dc Remove muxerFactory dependency on playerListener
This listener will need to be passed to the MuxerWrapper to throw when
the Transformer is stuck.

PiperOrigin-RevId: 482433552
(cherry picked from commit e3f28421fd85f1c44135f24c3df1fac000834f67)
2022-10-20 09:36:28 +00:00
Googler
1b6bef008f Corrected ordering of javadoc params
PiperOrigin-RevId: 482231370
(cherry picked from commit 897722071e90f7b79527a75ac667a4e2143fbdfd)
2022-10-19 16:53:37 +00:00
huangdarwin
0b0101e5f8 HDR: Support RGBA_1010102 in GlUtil as a parameter.
Make it easier to support use of RGBA_101012 rather than RGBA_8888 for EGL
contexts, displays, and surfaces.

This tangentially supports adding HDR tests, by slightly simplifying the color
selection logic we'd have to add in HDR tests.

PiperOrigin-RevId: 482219428
(cherry picked from commit 9e1adee4cbc3386672f42d580734175c442bdbea)
2022-10-19 16:04:41 +00:00
kimvde
f42d18f213 Make Muxer public
The reason for making the Muxer public is that we want to add an option
to disable or configure the timer that will throw when the muxer doesn't
receive any data for a given period of time.

PiperOrigin-RevId: 482199360
(cherry picked from commit d213b93958fce7e2a25851ec44b7c1938fcf0d7d)
2022-10-19 14:31:06 +00:00
huangdarwin
5c0175e4e3 Effect: Remove unnecessary "this" qualifier
`transformationMatrix` is not ambiguous, as there's no other local
transformationMatrix variable nearby.

PiperOrigin-RevId: 482184602
(cherry picked from commit c698ec51a24bdf42e2affad181d2a6d812cbe47b)
2022-10-19 13:08:03 +00:00
bachinger
6f94b8efe5 Map lib-effect from androidx to exoplayer2
PiperOrigin-RevId: 482179761
(cherry picked from commit 28c4be2f6bd56205e3b8128bf710c34b3b3d65e9)
2022-10-19 12:38:14 +00:00
Marc Baechinger
fc32f0ded3 Merge pull request #183 from jasper-apps:bugfix/make-download-notification-appear-immediately
PiperOrigin-RevId: 482165983
(cherry picked from commit 405455b06c6d596552c695670664309319f5570c)
2022-10-20 03:11:46 +00:00
ibaker
f56d714dd3 Remove ForwardingPlayer special case from PlayerControlView.setPlayer
This was originally added in 4fd7d777b6, but it hasn't done anything
since 98ee159df1 (when the instanceof ExoPlayer check was removed).

PiperOrigin-RevId: 482161662
(cherry picked from commit 7d5f1a24be204321961aba81f2de5b1ce1328c71)
2022-10-19 10:40:06 +00:00
tonihei
ed9bc9ad5d Ensure onMediaItemTransition is sent for repeats of the same item
Currently, repeating the same item (via seekNext/Previous) implicitly
results in a seek to the default position of the current item, which
looks exactly the same as a direct seek. As a result, we don't send
onMediaItemTransition as we would for every other seekNext/Previous
call.

This can be fixed by explicitly marking the repeat case in the internal
BasePlayer/ExoPlayerImpl methods, so that the callback can be triggered.

Issue: google/ExoPlayer#10667
PiperOrigin-RevId: 481951788
(cherry picked from commit 76ce0cc69fa12a9b2592103da97dd45c15bfe4d3)
2022-10-18 17:08:09 +00:00
huangdarwin
66bae6059b GL: Move loadAsset to GlProgram, where it's used.
(Also, make some public methods private)

PiperOrigin-RevId: 481912071
(cherry picked from commit a404fde4fa9d9d16b0be3c6e08dabd059c07f471)
2022-10-18 14:10:39 +00:00
kimvde
66d56be3aa Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
(cherry picked from commit bd9181e6ba5daf865f9c2f4338f1238b108dafd8)
2022-10-18 12:26:36 +00:00
samrobinson
5de37d2849 Fix parameter comment block.
#cleanup

PiperOrigin-RevId: 481882181
(cherry picked from commit b6bd35860cda60f27439df737fdee815060ed6fe)
2022-10-18 11:13:44 +00:00
ibaker
fb1c9dee04 Remove more references to overriding layouts from Player(Control)View
In exoplayer2 this affects StyledPlayer(Control)View

#minor-release

PiperOrigin-RevId: 481878940
(cherry picked from commit a5583c04bb6c199633e2b1edf036060c0d33b616)
2022-10-18 10:55:13 +00:00
kimvde
1c6cea80eb Add DefaultMuxer forwarding to FrameworkMuxer
- The naming DefaultMuxer is more consistent with the rest of
Transformer codebase (e.g. DefaultEncoderFactory).
- By hiding the implementation details of DefaultMuxer, the transition
to in-app Muxer will be seamless for apps using DefaultMuxer.
- The current plan is that DefaultMuxer will become the in-app muxer.

PiperOrigin-RevId: 481838790
(cherry picked from commit b4d7f066dd31cce1e3d7ab14cc47d3b7be364a88)
2022-10-18 07:23:57 +00:00
bachinger
fbc8019164 Add copybara annotated import statement for special cases
PiperOrigin-RevId: 481605567
(cherry picked from commit fd315dadebe479f2cc75fb4fa482cb414270bdcf)
2022-10-17 11:28:21 +00:00
Googler
e3d0ee990d Fix display settings window UI bug for foldable devices.
PiperOrigin-RevId: 481215581
(cherry picked from commit 6cdaf2c031258221939eead3b11075a90e2c742c)
2022-10-14 20:07:09 +00:00
ibaker
12314abbf0 Fix the position of IntDef annotations on fields in the UI module
PiperOrigin-RevId: 481150758
(cherry picked from commit 871a5e685e9bc78544107c803306320e7d53ee53)
2022-10-14 15:21:58 +00:00
ibaker
8ffdc3abf1 Mark effectively-final PlayerControlView fields as actually final
This means the null checker can be more sure that these fields don't
get reassigned between a null-check and a usage.

PiperOrigin-RevId: 481142004
(cherry picked from commit 248ee469ad243a86b66445f96782b915296eec4c)
2022-10-14 14:33:04 +00:00
claincly
df15f9c5c5 Use static import for Assertions in MCVR
PiperOrigin-RevId: 481122795
(cherry picked from commit 12f7174e1f8a2c2b1f36df749b43262efb88f60a)
2022-10-14 12:30:07 +00:00
Marc Baechinger
e13bbbcdd7 Merge pull request #10578 from thucngv:release-v2
PiperOrigin-RevId: 481115402
(cherry picked from commit 9861f88f3db419553b893efd98a5e1a0c8c6287c)
2022-10-20 02:08:44 +00:00
tonihei
b3627361f5 Ensure sessions without MediaPeriodId are ended after seek to new item
We already have logic to end all session except the current one if the
current one doesn't have a MediaPeriodId yet. This is assuming that this
only happens after a seek on the app side where the player doesn't have
detailled knowledge about the MediaPeriodIds yet.

Currently this logic isn't triggered if the window we are coming from
doesn't have its MediaPeriodId either as we run into another check that
keeps sessions around until we have a valid windowSequenceNumber.

Swapping both conditions fixes this case without breaking any of the
other known transition scenarios.

Issue: androidx/media#180
PiperOrigin-RevId: 480866465
(cherry picked from commit 6070d9110a9cec61f6073c7669f2f8185a635767)
2022-10-13 12:29:51 +00:00
kimvde
267725c54a Remove supportsSampleMimeType from Muxer.Factory
- This method is redundant with getSupportedSampleMimeTypes().
- This is to prepare the Muxer class to become public.

PiperOrigin-RevId: 480840902
(cherry picked from commit 8962f5a3f4b505224ceb22ac5771b85f24e30358)
2022-10-13 09:52:26 +00:00
ibaker
3aca9bc0d3 Add Cea608DecoderTest
When debugging and fixing Issue: google/ExoPlayer#10666 I wanted to write a regression
test, but needed to add a test first... This is just a small bit of
coverage to start with. It checks the field/channel filtering works
correctly, but doesn't check any styling info. It also doesn't test
'pop on' subtitles (i.e. when the subtitle isn't shown until a 'end of
subtitle' signal is received).

PiperOrigin-RevId: 480644568
(cherry picked from commit 6052212c15b89d71846f1f3855728ce863304bca)
2022-10-12 16:31:35 +00:00
tonihei
dc805232a3 Treat NO_VALUE as zero when adding up total required bitrate
We currently use the literal -1 (=NO_VALUE) when adding up the
total. Tracks without known bitrate can be ignored in the
calculation, but we should use an explicit value of 0.

#minor-release

Issue: google/ExoPlayer#10664
PiperOrigin-RevId: 480048126
(cherry picked from commit af19e0ea890e7b274b6f75f409f00f11e11c1c81)
2022-10-10 11:11:30 +00:00
michaelkatz
e8a5ac91ef Adjust track selection with Dolby Vision if display does not support
If the sample type is Dolby Vision and the display does not support Dolby Vision, then the capabilities DecoderSupport flag is set to DECODER_SUPPORT_FALLBACK_MIMETYPE. This denotes that the renderer will use a decoder for a fallback mimetype if possible. This alters track selection as tracks with DecoderSupport DECODER_SUPPORT_PRIMARY are preferred.

UnitTests included
-DefaultTrackSelector test that checks track selection reordering with DECODER_SUPPORT_FALLBACK_MIMETYPE
-MediaCodecVideoRenderer test that checks setting of DecoderSupport flag based on Display's Dolby Vision support

Issue: google/ExoPlayer#8944
PiperOrigin-RevId: 480040876
(cherry picked from commit a366590a0425ff138520752e2fc94c70429c20ab)
2022-10-10 10:35:17 +00:00