15163 Commits

Author SHA1 Message Date
ibaker
add9013df4 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 8c0f7827e262c7c4609e0b677a173a1e71ef2bb0)
2022-10-26 11:09:04 +00:00
samrobinson
92dc1d34f3 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 7fcb53da2ddcbe5bc3f66c46ef3574d019712945)
2022-10-25 18:31:22 +00:00
samrobinson
35900f94fa Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
(cherry picked from commit fc34542864dac5045d0fb460fd51c6bb2f1112c6)
2022-10-25 16:40:38 +00:00
claincly
5974bee7c5 Add GL utility methods to get 4x4 identity and set identity
PiperOrigin-RevId: 483671580
(cherry picked from commit be7bb0eea4f01e5c73c2aa604c5b3126230586b4)
2022-10-25 14:47:52 +00:00
tianyifeng
88a413b2cb Add injection of BitmapLoader from MediaSession.
* Add `BitmapLoader` in `MediaSession.Builder` and `MediaLibrarySession.Builder`.
* Pass `BitmapLoader` into the constructor of `MediaSession`, `MediaSessionImpl`, `MediaLibrarySession` and `MediaLibrarySessionImpl`.
* Add an interface method `loadBitmapFromMetadata(MediaMetadata)` in `BitmapLoader`.
* Remove the reference of `BitmapLoader` in `DefaultMediaNotificationProvider`.

PiperOrigin-RevId: 483654596
(cherry picked from commit 3f69df72db7a4aa481dd315f008375148f548805)
2022-10-25 13:21:08 +00:00
ibaker
373c23c11b Create NotificationChannel in DefaultMediaNotificationProvider.Api26
The inner class avoids a verification failure, which can lead to slower
execution at runtime.

PiperOrigin-RevId: 483639417
(cherry picked from commit 026aea7d3d85406ef9acf4e65cfffbc5e683a762)
2022-10-25 11:54:05 +00:00
ibaker
7ed20efae4 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 c9a0aa9db0a44555727660957901cc601d32b16c)
2022-10-24 16:51:08 +00:00
samrobinson
6dd0ace992 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 8723e74b1f48377ea8962247e10ee54252dd2de3)
2022-10-24 16:27:18 +00:00
microkatz
9fbc464ce3 Merge pull request #141 from tzugen:patch-4
PiperOrigin-RevId: 483395026
(cherry picked from commit e2a77f7be9989aaf70749f7caf62bc8b3f1feb0b)
2022-10-31 11:28:21 +00:00
ibaker
c38543478a Fix some incorrect comments in Cea608DecoderTest
Also used all-caps consistently

PiperOrigin-RevId: 483317405
(cherry picked from commit fb755708720c133960e35d76188b70e265be29f2)
2022-10-24 09:18:36 +00:00
bachinger
adf264c7c0 Minor simplification when setting metadata to platform session
PiperOrigin-RevId: 482805730
(cherry picked from commit a47f530b926394f6e1f3c11bbcbb2d2e38434e5a)
2022-10-21 15:56:34 +00:00
tianyifeng
1ce13aa721 Add CacheBitmapLoader in the session module
* Add `CacheBitmapLoader`.
* Add `CacheBitmapLoaderTest`.
* Remove the `BitmapLoadRequest` and some bitmap caching logic in `DefaultMediaNotificationProvider` since we moved all of them in `CacheBitmapLoader`.
* Modify `DefaultMediaNotificationProviderTest`.

PiperOrigin-RevId: 482787445
(cherry picked from commit ca4edff1fd61c58ce5c56f9bbd9ff80ce8a6670c)
2022-10-21 14:28:35 +00:00
bachinger
d3e71cd61f Add DAI specific methods to AdPlaybackState
PiperOrigin-RevId: 482755468
(cherry picked from commit c21c486ec6a49da015115a64091fa760649e8fa3)
2022-10-21 11:32:44 +00:00
Rohit Singh
a2096b6f4a Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
(cherry picked from commit d21c9488dfe807cf119fcaabbaf4127759835cb4)
2022-10-24 10:49:25 +00:00
Rohit Singh
3cb1d603bf Merge pull request #10618 from vishnuchilakala:fix/do_not_send_content_complete_if_midroll_skipped
PiperOrigin-RevId: 482481703
(cherry picked from commit faa4302219ad806d099ec231e913794cd8f4ac59)
2022-10-24 10:48:25 +00:00
michaelkatz
f56193bcd7 Change areSizeAndRateSupported to use PerfomancePoint.covers
PiperOrigin-RevId: 482461219
(cherry picked from commit b9c945459820ae264670aa2548fc747bb9402e97)
2022-10-20 12:20:14 +00:00
kimvde
f10021ff7f 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 e6d5595545ac4e0715b8b914a9a4b4a2757911d7)
2022-10-20 09:36:28 +00:00
Googler
656753b809 Corrected ordering of javadoc params
PiperOrigin-RevId: 482231370
(cherry picked from commit 2c61dd9c95e64d0e137d1a4775cd23bc9c0ac42f)
2022-10-19 16:53:37 +00:00
ibaker
b3cbebb036 Remove leading space from RELEASENOTES.md
PiperOrigin-RevId: 482229341
(cherry picked from commit f9a59ab3b51f56f2b29355180518c5e990b01b2e)
2022-10-19 16:45:30 +00:00
huangdarwin
ebc6b67e72 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 bb215857e5fd0768ce53c7c61ba91c48dab14bd2)
2022-10-19 16:04:41 +00:00
kimvde
b0ad5c2681 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 cf14d0687db5b8c0ea9edeae67a0b91affacbcd8)
2022-10-19 14:31:06 +00:00
christosts
0727b1f6f2 Use Service.stopForeground(int) on API 24+
The MediaNotficationManager stops the service from the foreground
calling Service.stopForeground(boolean) which is deprecated in API 33.
This change calls Service.stopForeground(int), which was added in API
24.

#minor-release

PiperOrigin-RevId: 482190332
(cherry picked from commit 601eaba7a6dcce963d5a3547d939ea41404ad3fe)
2022-10-19 13:41:26 +00:00
huangdarwin
8aa2198667 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 e39826a8db9f478b56403c8afe7b73b88f57c1c2)
2022-10-19 13:08:03 +00:00
ibaker
b592c78ce7 Fix DefaultMediaNotificationProvider typo in release notes
Also merge two 'Remove deprecated symbols' sections

PiperOrigin-RevId: 482171490
(cherry picked from commit a4965053bdc1db2d049c64829731a1f4676ea584)
2022-10-19 11:48:34 +00:00
Rohit Singh
6ec2f1ef6d Merge pull request #183 from jasper-apps:bugfix/make-download-notification-appear-immediately
PiperOrigin-RevId: 482165983
(cherry picked from commit 1565a2dabaa490647f00c86f72a460aaad53621d)
2022-10-24 10:38:13 +00:00
ibaker
950ea910db 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 a5b09b8cccca80fb7c40a9576e029ef462b64582)
2022-10-19 10:40:06 +00:00
huangdarwin
d8b6c2971b Test: Update MatrixProcessorPixelTest to use input width and height.
Before, they used `width` and `height`, which was inconsistent with other pixel tests, and less descriptive.

Refactoring change only. No functional change intended.

PiperOrigin-RevId: 481970243
(cherry picked from commit cce79a70402a231ff1ae6924ea75d59c5680e7b4)
2022-10-18 18:12:06 +00:00
tonihei
d56d94fa0a 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 f850206c51ced023b1603aa7661dd556ee436740)
2022-10-18 17:08:09 +00:00
christosts
ba84c2a09c MediaController: Add missing event flags (1/2)
This is the first commit out of two. This change adds the missing event
flags for the onEvents() callback when MediaController is connected to a
media3 session (see MediaControllerImplBase). I updated the
MediaControllerListenerTest and MediaControllerStateMaskingTest with
assertions that on onEvents() is called alongside individual
Player.Listener callbacks.

There will be a follow-up change for the case where a MediaController is
connected to a legacy MediaSession (MediaControllerImplLegacy). I've
split this in two separate changes to make the size of the commit
manageable for reviewing.

#minor-release

PiperOrigin-RevId: 481933437
(cherry picked from commit 46d5a0e33bd562cd9e6420b342a68bf112847f83)
2022-10-18 15:54:54 +00:00
huangdarwin
e589718414 GL: Move loadAsset to GlProgram, where it's used.
(Also, make some public methods private)

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

PiperOrigin-RevId: 481893842
(cherry picked from commit 9221b1251cc1c614e4edc421c847f8fa2ce329a6)
2022-10-18 12:26:36 +00:00
samrobinson
130edf8f26 Fix parameter comment block.
#cleanup

PiperOrigin-RevId: 481882181
(cherry picked from commit 7ac7e643acb3486e5c7004e35ad3c214d47c1860)
2022-10-18 11:13:44 +00:00
ibaker
1c37ad6470 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 cc1d35cfd787a02124c48d9e7df1c94dd78da085)
2022-10-18 10:55:13 +00:00
kimvde
34dd66d674 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 3399f4ecdfd0354f49a8599d04e4cc68295f2af5)
2022-10-18 07:23:57 +00:00
bachinger
f8310de9c2 Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
(cherry picked from commit 2625061ec02056e0da01fed7b4666af449907bf6)
2022-10-17 11:33:10 +00:00
Googler
ca411a0141 Fix display settings window UI bug for foldable devices.
PiperOrigin-RevId: 481215581
(cherry picked from commit 0128fa36e7bdc63f72d8369b8c59310e2dc2ec2f)
2022-10-14 20:07:09 +00:00
ibaker
2382016e7b Fix the position of IntDef annotations on fields in the UI module
PiperOrigin-RevId: 481150758
(cherry picked from commit e1d3f1b863ed195a2bbf9a40d05da97b193383f5)
2022-10-14 15:21:58 +00:00
huangdarwin
632c9cb57d Effect: Remove unused private int ouptutTexId in pixel tests.
PiperOrigin-RevId: 481143798
(cherry picked from commit f9724e9fb61b14678d73e6d4cf1c7196e4092797)
2022-10-14 14:43:41 +00:00
ibaker
5fe0cf6af2 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 e97b25a668035679fce798e978af576303b0e10e)
2022-10-14 14:33:04 +00:00
claincly
80a242d13c Use static import for Assertions in MCVR
PiperOrigin-RevId: 481122795
(cherry picked from commit cf65ff7cb02a5ef16c834026cf849a217099921b)
2022-10-14 12:30:07 +00:00
Marc Baechinger
4423f4df7a Merge pull request #10578 from thucngv:release-v2
PiperOrigin-RevId: 481115402
(cherry picked from commit 172cae4775d02da84077df33f234ad8df069eef4)
2022-10-17 15:58:34 +00:00
tonihei
be986537ab 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 409c9f874cbfce4b6c77ee700c0c50caa218cf3d)
2022-10-13 12:29:51 +00:00
bachinger
fc1089f68a Migrate media constants from androidx.media.util.MediaConstants
Adds root extras and metadata extras to MockMediaLibraryService and MockMediaBrowserCompatService and completed test cases for asserting
interoperability with a media1 or Media3 browser.

PiperOrigin-RevId: 480854842
(cherry picked from commit 006a519a0e83d5b9e4262a5bbc228c02b3c9cf5f)
2022-10-13 11:18:46 +00:00
Googler
82e51d5669 Fix blank toast in Transformer Demo
PiperOrigin-RevId: 480847967
(cherry picked from commit 7e8f0f0918bdcaa855160151861f23c9b1a90392)
2022-10-13 10:32:32 +00:00
kimvde
7a488a192b 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 2786db9e73505a8d6d4c4f2c284aacb605006ab8)
2022-10-13 09:52:26 +00:00
ibaker
3575b68020 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 706b1299049b23dbc71a7407ffbaf8598f56b610)
2022-10-12 16:31:35 +00:00
huangdarwin
cc67241062 Demo: Shorten trim range from 60 seconds to 10 seconds.
Most demo videos aren't very long, and the default demo video is only 10 seconds.

Shorten the maximum trim duration to 10 seconds, to demonstrate transformer functionality more easily, and allow this to be used more easily when trimming short sections of a longer video (ex. to make test clips)

PiperOrigin-RevId: 480602037
(cherry picked from commit f35bda3524408d8bf560c080bd6a80698c7c08e1)
2022-10-12 12:58:12 +00:00
huangdarwin
28763e7d21 Demo: Hide player controls by default.
Player controls are somewhat distracting when showing the difference between the
input and output video, as they obscure and darken the video players.

PiperOrigin-RevId: 480597804
(cherry picked from commit 51edb329a124e5af302e1ebbd3527300619ac86a)
2022-10-12 12:26:07 +00:00
huangdarwin
8f3070834f Demo: Read long values from trim slider.
Before, slider values were read as `floor()`'ed `longValue()`s, so that trimming to
intervals less than one second would be interpreted as a request for a zero-
duration trim.

Also, rename `radiusRange` references here to `trimRange`, since this is not a
radius range.

PiperOrigin-RevId: 480401556
(cherry picked from commit fb5cd18dcd8b8e2a6baa308d6907f2e02751474e)
2022-10-11 17:57:01 +00:00
Googler
c40da71a3a Add local file picker to ConfigurationActivity
PiperOrigin-RevId: 480349627
(cherry picked from commit b515e0bd7fd382a7b3485e83ad7c65df4eff1a85)
2022-10-11 14:21:12 +00:00