15446 Commits

Author SHA1 Message Date
bachinger
21022c77be Use MediaBrowserCompat.rootHints as connections hints
In Media3 there is the useful concept of connection hints that a
client can set when building the session and that are sent to the
service and passed to the `Callback.onConnect()` method when the
browser connects.

These connection hints are then included in the `ControllerInfo`
object that later will be passed to every callback method and the
implementor can then take decisions specific to these connection
hints.

These connection hints are not available in media1. However, when
an app creates a `MediaBrowserCompat` object, the constructor takes
a rootHint object that is sent to
`MediaBrowserServiceCompat.onGetRoot()`.

This change uses the browser rootHints as the connection hints when
creating the `ControllerInfo` for legacy browsers and makes them
available to the `MediaLibrarySession.Callback` domain methods in
the same way as connection hints of a Media3 browser.

PiperOrigin-RevId: 484220748
2022-10-31 11:43:21 +00:00
bachinger
64e9e88823 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
2022-10-31 11:42:19 +00:00
kimvde
16cb5cbc1f 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
2022-10-31 11:39:28 +00:00
samrobinson
e6079c38f2 Add AudioProcessor.AudioFormat equals method.
PiperOrigin-RevId: 483983486
2022-10-31 11:38:26 +00:00
tofunmi
f1ca4f41b1 Mute input video player in transformer demo
PiperOrigin-RevId: 483969411
2022-10-31 11:37:29 +00:00
ibaker
8c0f7827e2 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
2022-10-31 11:36:34 +00:00
samrobinson
7fcb53da2d 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
2022-10-31 11:35:32 +00:00
samrobinson
fc34542864 Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
2022-10-31 11:34:30 +00:00
claincly
be7bb0eea4 Add GL utility methods to get 4x4 identity and set identity
PiperOrigin-RevId: 483671580
2022-10-31 11:33:30 +00:00
tianyifeng
3f69df72db 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
2022-10-31 11:32:30 +00:00
ibaker
026aea7d3d Create NotificationChannel in DefaultMediaNotificationProvider.Api26
The inner class avoids a verification failure, which can lead to slower
execution at runtime.

PiperOrigin-RevId: 483639417
2022-10-31 11:31:31 +00:00
ibaker
c9a0aa9db0 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
2022-10-31 11:30:27 +00:00
samrobinson
8723e74b1f 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
2022-10-31 11:29:28 +00:00
microkatz
e2a77f7be9 Merge pull request #141 from tzugen:patch-4
PiperOrigin-RevId: 483395026
2022-10-31 11:28:21 +00:00
ibaker
fb75570872 Fix some incorrect comments in Cea608DecoderTest
Also used all-caps consistently

PiperOrigin-RevId: 483317405
2022-10-24 10:53:29 +00:00
bachinger
a47f530b92 Minor simplification when setting metadata to platform session
PiperOrigin-RevId: 482805730
2022-10-24 10:52:38 +00:00
tianyifeng
ca4edff1fd 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
2022-10-24 10:51:32 +00:00
bachinger
c21c486ec6 Add DAI specific methods to AdPlaybackState
PiperOrigin-RevId: 482755468
2022-10-24 10:50:38 +00:00
Rohit Singh
d21c9488df Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
2022-10-24 10:49:25 +00:00
Rohit Singh
faa4302219 Merge pull request #10618 from vishnuchilakala:fix/do_not_send_content_complete_if_midroll_skipped
PiperOrigin-RevId: 482481703
2022-10-24 10:48:25 +00:00
michaelkatz
b9c9454598 Change areSizeAndRateSupported to use PerfomancePoint.covers
PiperOrigin-RevId: 482461219
2022-10-24 10:47:22 +00:00
kimvde
e6d5595545 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
2022-10-24 10:46:26 +00:00
Googler
2c61dd9c95 Corrected ordering of javadoc params
PiperOrigin-RevId: 482231370
2022-10-24 10:45:31 +00:00
ibaker
f9a59ab3b5 Remove leading space from RELEASENOTES.md
PiperOrigin-RevId: 482229341
2022-10-24 10:44:34 +00:00
huangdarwin
bb215857e5 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
2022-10-24 10:43:40 +00:00
kimvde
cf14d0687d 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
2022-10-24 10:42:42 +00:00
christosts
601eaba7a6 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
2022-10-24 10:41:47 +00:00
huangdarwin
e39826a8db Effect: Remove unnecessary "this" qualifier
`transformationMatrix` is not ambiguous, as there's no other local
transformationMatrix variable nearby.

PiperOrigin-RevId: 482184602
2022-10-24 10:40:53 +00:00
ibaker
a4965053bd Fix DefaultMediaNotificationProvider typo in release notes
Also merge two 'Remove deprecated symbols' sections

PiperOrigin-RevId: 482171490
2022-10-24 10:39:07 +00:00
Rohit Singh
1565a2daba Merge pull request #183 from jasper-apps:bugfix/make-download-notification-appear-immediately
PiperOrigin-RevId: 482165983
2022-10-24 10:38:13 +00:00
ibaker
a5b09b8ccc 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
2022-10-24 10:37:05 +00:00
huangdarwin
cce79a7040 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
2022-10-24 10:36:09 +00:00
tonihei
f850206c51 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
2022-10-24 10:35:19 +00:00
christosts
46d5a0e33b 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
2022-10-24 10:34:30 +00:00
huangdarwin
93ee1f48ad GL: Move loadAsset to GlProgram, where it's used.
(Also, make some public methods private)

PiperOrigin-RevId: 481912071
2022-10-24 10:33:35 +00:00
kimvde
9221b1251c Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
2022-10-24 10:32:43 +00:00
samrobinson
7ac7e643ac Fix parameter comment block.
#cleanup

PiperOrigin-RevId: 481882181
2022-10-24 10:31:37 +00:00
ibaker
cc1d35cfd7 Remove more references to overriding layouts from Player(Control)View
In exoplayer2 this affects StyledPlayer(Control)View

#minor-release

PiperOrigin-RevId: 481878940
2022-10-24 10:30:39 +00:00
kimvde
3399f4ecdf 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
2022-10-24 10:29:27 +00:00
Vishnu Chilakala
b9b30c4669 Do not send content complete if any midroll is skipped 2022-10-18 18:20:55 +05:30
bachinger
2625061ec0 Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
2022-10-17 16:05:52 +00:00
ibaker
b6c45e6a2f Add release note for deleting deprecated DefaultAudioSink constructors
These were removed in 0468b5ab72

PiperOrigin-RevId: 481587098
2022-10-17 16:04:08 +00:00
Googler
0128fa36e7 Fix display settings window UI bug for foldable devices.
PiperOrigin-RevId: 481215581
2022-10-17 16:03:12 +00:00
ibaker
e1d3f1b863 Fix the position of IntDef annotations on fields in the UI module
PiperOrigin-RevId: 481150758
2022-10-17 16:02:16 +00:00
huangdarwin
f9724e9fb6 Effect: Remove unused private int ouptutTexId in pixel tests.
PiperOrigin-RevId: 481143798
2022-10-17 16:01:32 +00:00
ibaker
e97b25a668 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
2022-10-17 16:00:27 +00:00
claincly
cf65ff7cb0 Use static import for Assertions in MCVR
PiperOrigin-RevId: 481122795
2022-10-17 15:59:34 +00:00
Marc Baechinger
172cae4775 Merge pull request #10578 from thucngv:release-v2
PiperOrigin-RevId: 481115402
2022-10-17 15:58:34 +00:00
tonihei
409c9f874c 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
2022-10-17 15:57:35 +00:00
bachinger
006a519a0e 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
2022-10-17 15:56:30 +00:00