14987 Commits

Author SHA1 Message Date
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
huangdarwin
09776f3d72 HDR: Add period to end of error message.
For tone mapping error messages.

PiperOrigin-RevId: 477447799
(cherry picked from commit 05ce639ea05b8806f6c8bae7d1816ddae5d99fb7)
2022-09-28 14:30:48 +00:00
huangdarwin
619333fe3c HDR: Add tests for tone mapping.
Also, add checks for output file color.

PiperOrigin-RevId: 477439139
(cherry picked from commit 507a1be61d24baf8fd26047938360db48dffabdb)
2022-09-28 13:42:36 +00:00
ibaker
0be36d084b Add a troubleshooting section about slow seeking
#minor-release

PiperOrigin-RevId: 477432256
(cherry picked from commit f8f2ec64c9b8ba8c19e95cd68e52cc67fb0094fa)
2022-09-28 13:15:03 +00:00
Googler
3b97b99230 Fix checkboxes on configuration page
PiperOrigin-RevId: 477166507
(cherry picked from commit bcea7bd355b7c33e6c56b4c911817de1f2f34e0e)
2022-09-27 14:31:59 +00:00
samrobinson
d348157777 Fix badly formatted AudioProcessor javadoc.
PiperOrigin-RevId: 476909855
(cherry picked from commit 9b1909e56362a5b44ba41d8cad9c3d927bdb650b)
2022-09-26 16:00:10 +00:00
huangdarwin
c9f019eb15 HDR: Update gamma comments to linear.
Comment-only change.

PiperOrigin-RevId: 476873286
(cherry picked from commit f3d132141e2c40797b80fab674e9ed8f4062e7ba)
2022-09-26 13:00:17 +00:00
tonihei
289d039410 Add setPreferredAudioDevice method to ExoPlayer
This allows to access the associated functionality of AudioTrack and
fills a feature gap to MediaPlayer, which has a similar method.

Issue: androidx/media#135
PiperOrigin-RevId: 476398964
(cherry picked from commit ccb820dd2f43ff20dff06a92a4e29c13676e647d)
2022-09-23 17:05:43 +00:00
leonwind
8b807432ca Add example CLUT to demo.
PiperOrigin-RevId: 476390089
(cherry picked from commit 29cf09316e8056e3703809d6b6ac8eea890e2e4e)
2022-09-23 16:28:25 +00:00
leonwind
0a1f30aba5 Store LUT bitmap as texture with processor creation.
* Before this CL, the texture was stored during the construction of the LUT processor. This failed since if one creates a list of GlEffects on the application thread, the texture will get stored in the application thread during the effect creation and not on the GL thread, which executes the FrameProcessors.
* This is an issue since the executing thread then can't index from the texture stored on a different thread.

PiperOrigin-RevId: 476388021
(cherry picked from commit f745c6ee0ea0b610cfdf6a146818b0da7d06326a)
2022-09-23 16:19:43 +00:00
Marc Baechinger
d648c1910c Merge pull request #123 from stoyicker:wrapping_media_source
PiperOrigin-RevId: 476376463
(cherry picked from commit 8623f1f01657abc6a1359f3677a59d1cbde07b37)
2022-10-19 23:42:52 +00:00
leonwind
61a2cc76aa Add HSL Adjustments to the demo.
PiperOrigin-RevId: 476373520
(cherry picked from commit 5725ebbeeaf1cbb1a1ffc156d67472640059bd0a)
2022-09-23 15:11:52 +00:00
ibaker
55e44b1399 Fix broken links on https://exoplayer.dev/troubleshooting.html
#minor-release

PiperOrigin-RevId: 476366214
(cherry picked from commit 0969118041e9fb0a8641240282c91959805c271d)
2022-09-23 14:41:59 +00:00
leonwind
91fb951e2a Remove TODOs for merging RGB and MatrixTransformation processors.
PiperOrigin-RevId: 476362571
(cherry picked from commit af19f82f994e5820889a9166c0a97606496fd17d)
2022-09-23 14:21:38 +00:00
michaelkatz
9ac9322a45 Try alternative decoder for Dolby Vision if display does not support
If the sample type is dolby vision and the following conditions match
a)There is a supported alternative codec mimetype
b)Display does not support Dolby Vision
Then getDecoderInfos will return the alternative types.

Issue: google/ExoPlayer#9794
PiperOrigin-RevId: 476356223
(cherry picked from commit 94a88e93d91e86c93239639a65612eab297efa9b)
2022-09-23 13:43:21 +00:00
huangdarwin
a3a08f8355 HDR: Assert output C.ColorTransfer for tests.
To confirm that tone mapping did or did not happen.

PiperOrigin-RevId: 476354606
(cherry picked from commit df58107eae0dd7e19f9b551751d1fbb19ca05e6d)
2022-09-23 13:33:28 +00:00
leonwind
55d3c5ac0c Add HSL Adjustments to the effects module.
PiperOrigin-RevId: 476144167
(cherry picked from commit 2c27cd82f1e97d14f609ea5bb6924398a9dddfd6)
2022-09-22 17:56:54 +00:00
leonwind
a534f60f56 Add OETF and EOTF ES2 fragment shaders for non-HDR frames.
* Transform the intermediate color space to linear SDR by applying the SMPTE 170M EOTF and OETF.
* Use linear colors for the color filter pixel tests and update all golden bitmaps.

PiperOrigin-RevId: 476124592
(cherry picked from commit afd829e5db17c48abccea30842eec20b702aa330)
2022-09-22 16:45:28 +00:00
ibaker
eb496dabcd Work around a bug in the Android 13 ClearKey implementation
The ClearKey CDM will attach an 'invalid' URL in `KeyRequest` objects,
when the documentation states this should be an empty string if a
default URL is not known.

#minor-release

PiperOrigin-RevId: 476113513
(cherry picked from commit 331d4d626fcb1b65088c7ab849c0a0a3f5f6ba0e)
2022-09-22 15:59:44 +00:00
leonwind
109ab70e00 Add RGB Adjustments to transformer demo.
PiperOrigin-RevId: 476049125
(cherry picked from commit cfc0eef24ec4a24bc00b0a657f3dad07e9c29ade)
2022-09-22 10:04:42 +00:00
samrobinson
61acf5871a Add file size to TransformationResult at the end of a Transformation.
Tested:
  * Manually using both path and file descriptor.
PiperOrigin-RevId: 475860978
(cherry picked from commit 08bb01b218461506352ae4c2f17efd27989553e5)
2022-09-21 17:18:42 +00:00
leonwind
b23c966c5a Use golden bitmaps in contrast pixel tests.
PiperOrigin-RevId: 475805421
(cherry picked from commit 06c0040ab43820164bc048d85556727aaa9fa4f8)
2022-09-21 12:53:42 +00:00
rohks
a6f58bdb29 Fix instrumentation tests not working via Gradle
PiperOrigin-RevId: 475560401
(cherry picked from commit 6015f052ba1b21bea4ded5bfc4924dc1c096b07a)
2022-09-20 15:25:38 +00:00
leonwind
0a811bd4a1 Fix outdated command in bitmap/README.md.
* The command changed after creating a custom effects module.

PiperOrigin-RevId: 474777823
(cherry picked from commit fd6b0d1551af6db9de49dd17c30937a4b292357d)
2022-09-16 10:40:19 +00:00
yschimke
3af297101c Fix tracing under offload.
Currently doSomeWork is never closed and so tracing is deceiving.

See https://screenshot.googleplex.com/eZDzn5APpBNnhe5

PiperOrigin-RevId: 474755816
(cherry picked from commit 005b73c82a1a3264a7167ffdf93a9387c4d22b95)
2022-09-16 08:26:54 +00:00
leonwind
eb6cf356bb Add LUT functionalities to transformer.
* Adds SDR 3D LUT functionalities with OpenGL 2.0 support.

PiperOrigin-RevId: 474561060
(cherry picked from commit 702419dd227cec4b23cd6e723a6a15908313f7c9)
2022-09-15 14:49:19 +00:00
leonwind
b041e4dce6 Fix testId and match it to the test name.
PiperOrigin-RevId: 474363545
(cherry picked from commit 0e2b6a03b5f91eda6d307b63f49986dfdcc97bfe)
2022-09-14 19:41:11 +00:00
samrobinson
3adfa48f34 Add support for skipping windows in MssimCalculator.
By skipping every other row and column, SSIM calculation time reduces by 10-30%.

PiperOrigin-RevId: 474286702
(cherry picked from commit 6dd2a6dac655f538020a4057e3ab6d997449a9fe)
2022-09-14 14:35:12 +00:00