14964 Commits

Author SHA1 Message Date
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
huangdarwin
e54127cf52 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 620d8c9479469f11bdd372e80d231a64e0132808)
2022-10-18 18:12: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
7cc3f119b1 Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
(cherry picked from commit 325e973ace929efa193b114271d844f20814705a)
2022-10-17 11:33:10 +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
huangdarwin
d9c60dc966 Effect: Remove unused private int ouptutTexId in pixel tests.
PiperOrigin-RevId: 481143798
(cherry picked from commit 026699bafc6d73bc63b6cf416ea183fc3d506039)
2022-10-14 14:43:41 +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
bachinger
1bea5067cf 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 f95406e75d1eca9b96477132d33d752e2485bee6)
2022-10-13 11:18:46 +00:00
Googler
a8921b7449 Fix blank toast in Transformer Demo
PiperOrigin-RevId: 480847967
(cherry picked from commit 446c9943f935541d7b76fc1dfa62ee969d775f60)
2022-10-13 10:32:32 +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
huangdarwin
4198ddebe2 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 3142a2127dc224e4c2124989b952a8bd1e06d510)
2022-10-12 12:58:12 +00:00
huangdarwin
2244549146 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 91a61cecbe37f4c5595f534ee237011289c0ac18)
2022-10-12 12:26:07 +00:00
huangdarwin
abefef9b59 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 6c59f9ece40f6450405d29acd559492145158409)
2022-10-11 17:57:01 +00:00
Googler
5d8daba5c5 Add local file picker to ConfigurationActivity
PiperOrigin-RevId: 480349627
(cherry picked from commit 225d0dcdd1e7e7f1f41d8ac1d2dee7340c40cf3a)
2022-10-11 14:21:12 +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
claincly
efb7bf2fc2 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 2188685c465aa6d641e78ab33eaa93fbb92185b8)
2022-10-07 17:29:15 +00:00
christosts
bd616e164a Bump dexmaker version
PiperOrigin-RevId: 479579252
(cherry picked from commit a6b9772f0e6f5a31baafb6965c3386d819d3c1e9)
2022-10-07 14:49:37 +00:00
huangdarwin
15e316da3f 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 faa796d7365330d1f1d4f5b17901d6b1a78ce868)
2022-10-07 13:57:06 +00:00
ibaker
ee9bff08da Document the allowed values of TsPayloadReader.Flags IntDef
PiperOrigin-RevId: 479569806
(cherry picked from commit 7c68b8d4500cb25779a473b52029944ec4d29543)
2022-10-07 13:50:28 +00:00
claincly
808180455a 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 ccab9fba0369ea9709a6987024177e8b73a5c7ac)
2022-10-06 18:30:14 +00:00
tianyifeng
d2f7fb1d50 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 4c73241058041fd978e9748b2158168d4e6e702d)
2022-10-06 09:58:37 +00:00
tonihei
e37f16a749 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 088958994776a65666045b3e7b332f5f0c336bcf)
2022-10-05 15:03:16 +00:00
claincly
92ceeda5b8 Add FrameProcessor functionality to release a frame immediately
Currently `FrameProcessor.releaseOutputFrame()` method supports

Release at a specific system time
Drops the frame
This API is not that convenient to use when the caller wants to release a frame, now, regardless of the release time. A use case is to release (present) a frame when no frame is shown for a while, and it's thus better to just release the frame, now.

Currently if MCVR wants a frame to be rendered now, MCVR calls release frame with a set offset like 10us: `releaseOutputFrame(System.nanoTime() + 10_000)`. The 10us offset is to prevent the frame processor dropping the frame, due to thread hopping delays.

To make the API better usable, consider adding a mode for releasing the frame now, like (bold marks the new mode)

- Use C.TIME_UNSET to drop
- **Use -1 to release the frame immediately, or**
- Use an actual release time.

PiperOrigin-RevId: 479044215
(cherry picked from commit ff8dd0b4b9aa498a831c9721c530e77bf099a4ed)
2022-10-05 14:45:27 +00:00
Googler
997cdf377b Add button to show/hide input player in TransformerActivity
PiperOrigin-RevId: 479003655
(cherry picked from commit 20c1ae141185d8f0e69977c82598488ae12e3b30)
2022-10-05 10:26:27 +00:00
huangdarwin
a06b0ba5f6 HDR: Check isToneMappingApplied in HDR editing test.
Assert that tone mapping is applied when an HDR edit cannot be HDR, but is successfully tone mapped. Meanwhile, assert that fallback, which is applied after codec configuration (which throws the "Tone-mapping requested but not supported by the decoder" error) is not applied when that error is called.

PiperOrigin-RevId: 478762951
(cherry picked from commit 36e41059ea9e98aeab105375a683f7cd7481c5a8)
2022-10-04 13:01:27 +00:00
Googler
c3a6943373 Add second player for input video
PiperOrigin-RevId: 478510687
(cherry picked from commit 6f2bc16b609265160154b173df6bd687bc5bcb17)
2022-10-03 15:27:33 +00:00
huangdarwin
2361213d8f HDR: Add tests with HLG10 input.
PiperOrigin-RevId: 478019046
(cherry picked from commit b9a3aa5ca1b7fb01fc6500a57d9ddcbba6ff9b54)
2022-09-30 17:02:37 +00:00
huangdarwin
fdd72aed5a Effect: Update javadoc to remove "final effect" references
"Final" was likely added to reference the FinalMatrixTextureProcessorWrapper,
which is a package-private class. However, I think more clear to express that
this is the input size, which then has all effects applied, to get the output
size.

PiperOrigin-RevId: 477975358
(cherry picked from commit 7286155fc327b1ffcd72903a739368b4bdeebcf8)
2022-09-30 13:24:26 +00:00
huangdarwin
49cc724a32 Tests: Statically import BitmapTestUtil methods.
Per go/java-practices/imports#static

No functional changes intended.

PiperOrigin-RevId: 477974779
(cherry picked from commit da2c6376cd86b7b8e9fd450cd61ed8fbc3a739dd)
2022-09-30 13:20:49 +00:00
huangdarwin
b49c2aab62 Test: Rename to avoid redundant substrings.
Rename test files to avoid substrings that can be implied by the directory name,
like "Transformation" and "Test"

No functional changes. Renaming-only.

PiperOrigin-RevId: 477724724
(cherry picked from commit 97868025275e5fb6dd62e8407a7384ff44e204f6)
2022-09-29 14:54:25 +00:00
samrobinson
9639f82879 Demo: Split video Effect generation out of createTransformer.
PiperOrigin-RevId: 477524540
(cherry picked from commit 26a73605f811acad1bc5de6dbc5f651036f35e13)
2022-09-28 19:39:09 +00:00