15047 Commits

Author SHA1 Message Date
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
christosts
ae5685427a MediaControllerWithMediaSessionCompatTest
Fix a race condition making test flaky.

PiperOrigin-RevId: 480104467
(cherry picked from commit cb3a6725083d4a1037c6081fe732ea999a5263c9)
2022-10-10 16:34:13 +00:00
tonihei
166b201ae4 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 b0daae72cfa5b5390d2fe2077e011955952d858d)
2022-10-10 11:11:30 +00:00
christosts
48de6838b4 Minor naming cleanup in MediaControllerListenerTest
PiperOrigin-RevId: 480041937
(cherry picked from commit 6f8863fc112aa49cddf8d43bfb3da24f140ef33f)
2022-10-10 10:42:01 +00:00
michaelkatz
46dfb1b7b2 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 266de1b21bae6ed267022547d42601a00ea14e88)
2022-10-10 10:35:17 +00:00
christosts
20b086ce23 MediaControllerListenerTest: use local MediaController instances
Replace the instance-field MediaController with a local instance created
in each test.

PiperOrigin-RevId: 480039768
(cherry picked from commit ba1ecafb8f0db2a0e822eceffa724f1baae4a073)
2022-10-10 10:26:45 +00:00
tonihei
d35f67a8a6 Set new playlist and start index with one command
PlayableFolderActivity currently uses two seperate commands
to set the playlist and then seek to the requested item.

This is slightly inefficient and also causes analytics
listeners to believe the first item in the playlist was
briefly active.

#minor-release

Issue: androidx/media#180
PiperOrigin-RevId: 480031682
(cherry picked from commit 5d6d069e4e946a46884a838482567ff085e88283)
2022-10-10 09:33:21 +00:00
claincly
b436001e32 Remove late frame dropping in FrameProcessor
Currently, a frame is dropped if it's requested release time is in the past.
This mode was added to support previewing. However, in normal ExoPlayer
playback, slightly late frames (<30ms late) are also rendered. On MediaCodec
side, this means calling `releaseOutputBuffer` with a release time in the
past.

PiperOrigin-RevId: 479615291
(cherry picked from commit a426cb27c0d0c85bd6cb4c04cb27957e3075754c)
2022-10-07 17:29:15 +00:00
christosts
0ceec3ebb9 MediaControllerImplBase: clean imports
Remove static imports to constants and imports to intdefs, to make the
code more readable.

PiperOrigin-RevId: 479594144
(cherry picked from commit 36e12fbadb7b274f770a5904675493300c8fa89c)
2022-10-07 16:07:50 +00:00
christosts
14e259d44f Bump dexmaker version
PiperOrigin-RevId: 479579252
(cherry picked from commit 49bfca54827f1cfb6f75dfded9427b2398537abe)
2022-10-07 14:49:37 +00:00
huangdarwin
355d81c6bb HDR: Disable tone mapping on unsupported pixel build ID.
Also, update tests to allow AnyOf error codes, and no longer check exception messages, which caused quite a bit of churn.

PiperOrigin-RevId: 479570861
(cherry picked from commit 8548e3519e3d6ef214d5c18d640a8bf6efe19c83)
2022-10-07 13:57:06 +00:00
ibaker
110fe2b61b Document the allowed values of TsPayloadReader.Flags IntDef
PiperOrigin-RevId: 479569806
(cherry picked from commit 91caf7a650a688eec9d2d8e976ae6e90a4be322c)
2022-10-07 13:50:28 +00:00
claincly
8b193f2bb9 Add a FrameProcessor flag to drop the processed frame
This mode is supported by using `C.TIME_UNSET` (which is a negative value). The
new logic decouples the value of `C.TIME_UNSET` and the frame dropping
behaviour.

PiperOrigin-RevId: 479368880
(cherry picked from commit 26be9ae88548bcf95327801931b3b5797304bc66)
2022-10-06 18:30:14 +00:00
aquilescanta
506653bbcc Fix typo in MediaController javadoc
PiperOrigin-RevId: 479268879
(cherry picked from commit 0beccb6e141f40d6cb8cca4839213df2ab600c01)
2022-10-06 10:21:12 +00:00
tianyifeng
243c29a8ad Provide access to original media timestamps in AudioSink.
* Add `setOutputStreamOffsetUs(long)` method in `AudioSink`.
* Add private methods `setOutputStreamOffsetUs(long)` method in `MediaCodecRenderer` and `DecoderAudioRenderer`.
* Add protected method `onOutputStreamOffsetUs(long)` method in `MediaCodecRenderer`, in which:
  * `MediaCodecRenderer` itself will be no-op for this method.
  * `MediaCodecAudioRenderer` will propagate this value to its `audioSink`.
* Add logics in `DecoderAudioRenderer` to calculate `outputStreamOffsetUs`.

PiperOrigin-RevId: 479265429
(cherry picked from commit 5bff8623748a1ce9e411cfa9df171143925da89f)
2022-10-06 09:58:37 +00:00
christosts
1cfeddc369 Misc fix on DefaultMediaNotificationProviderTest
PiperOrigin-RevId: 479079184
(cherry picked from commit bf948db669c32ab5eea2432b7c2c61667af1388a)
2022-10-05 17:22:40 +00:00
tonihei
a31a6c6c1a Fix RequestMetadata JavaDoc link to point to the right MediaController.
The JavaDoc of RequestMetadata should point to the media3 controller,
not the platform one.

PiperOrigin-RevId: 479047924
(cherry picked from commit b70258e43dd9a9aead05eb2247f2058044bee1a5)
2022-10-05 15:03:16 +00:00