699 Commits

Author SHA1 Message Date
claincly
656b346e6c Allow specifying an Executor in FrameProcessor.Factory.create()
From this CL on, FrameProcessor listeners will be invoked from an Executor that
is passed in when creating the FrameProcessor.

GlTextureProcessor needs to invoke the ErrorListener on the said Executor too.

PiperOrigin-RevId: 493018583
2022-12-12 12:41:47 +00:00
samrobinson
8d5fe8fec9 Add setter for some audio effects to demo app.
PiperOrigin-RevId: 493001630
2022-12-12 12:37:36 +00:00
samrobinson
589b4a177b Add force silent audio to the transformer demo application.
Adds a modified version of sample.mp4 to the list, which has no audio.

PiperOrigin-RevId: 492993918
2022-12-12 12:33:15 +00:00
kimvde
7fffe65717 Add checkbox in demo to enable watchdog timer
PiperOrigin-RevId: 490836952
2022-11-29 18:44:06 +00:00
kimvde
df2c9ce4ec Surface player release timeouts
Also make sure the demo app doesn't crash when it happens.

PiperOrigin-RevId: 490725959
2022-11-24 15:37:38 +00:00
tofunmi
51e4a07b21 Reordering views for consistency in transformer demo app
PiperOrigin-RevId: 489216085
2022-11-21 15:07:21 +00:00
tofunmi
934536218c Fix video disappearing when the app is brought out of the background
PiperOrigin-RevId: 489212224
2022-11-21 15:01:43 +00:00
huangdarwin
79cc8a5956 HDR: Use HdrMode IntDef to select HDR output mode.
This is a simpler API to use than the prior tone mapping, HDR editing, and
forceInterpretHdrAsSdr options

PiperOrigin-RevId: 488742391
2022-11-16 12:38:01 +00:00
ibaker
30b73c85c5 Reformat demo build.gradle file
PiperOrigin-RevId: 488376715
2022-11-14 17:36:35 +00:00
huangdarwin
53978104e6 HDR: For HDR videos, enableHdrEditing by default.
Previously, tone-mapping was the default.

PiperOrigin-RevId: 488362209
2022-11-14 17:31:08 +00:00
huangdarwin
680f0c3af7 HDR: Add public HLG test file.
Add an HLG Pixel 7 Pro video and its associated format for testing.

PiperOrigin-RevId: 488353926
2022-11-14 17:22:26 +00:00
ibaker
0383b723b7 Reformat demo build.gradle file
PiperOrigin-RevId: 487539107
2022-11-14 16:59:48 +00:00
christosts
09bee98b8f Set targetSdkVersion of main demo app to 29
#minor-release

PiperOrigin-RevId: 487479366
2022-11-10 15:49:19 +00:00
huangdarwin
8bdd2784d3 HDR: Implement ForceInterpretHdrVideoAsSdr
Also, document that we tone map when no HDR features are explicitly set

PiperOrigin-RevId: 487310971
2022-11-10 15:09:41 +00:00
bachinger
136addf640 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 16:29:48 +00:00
Googler
8181b3c6a1 Mute input video player in transformer demo
PiperOrigin-RevId: 483969411
2022-10-31 16:15:17 +00:00
bachinger
28c4be2f6b Map lib-effect from androidx to exoplayer2
PiperOrigin-RevId: 482179761
2022-10-20 03:15:38 +00:00
Googler
446c9943f9 Fix blank toast in Transformer Demo
PiperOrigin-RevId: 480847967
2022-10-20 01:57:57 +00:00
huangdarwin
3142a2127d 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
2022-10-20 01:46:55 +00:00
huangdarwin
91a61cecbe 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
2022-10-20 01:43:22 +00:00
huangdarwin
6c59f9ece4 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
2022-10-20 01:39:10 +00:00
Googler
225d0dcdd1 Add local file picker to ConfigurationActivity
PiperOrigin-RevId: 480349627
2022-10-20 01:35:37 +00:00
Googler
20c1ae1411 Add button to show/hide input player in TransformerActivity
PiperOrigin-RevId: 479003655
2022-10-20 00:52:19 +00:00
Googler
6f2bc16b60 Add second player for input video
PiperOrigin-RevId: 478510687
2022-10-20 00:41:39 +00:00
samrobinson
26a73605f8 Demo: Split video Effect generation out of createTransformer.
PiperOrigin-RevId: 477524540
2022-10-20 00:23:57 +00:00
Googler
bcea7bd355 Fix checkboxes on configuration page
PiperOrigin-RevId: 477166507
2022-10-20 00:09:13 +00:00
huangdarwin
f3d132141e HDR: Update gamma comments to linear.
Comment-only change.

PiperOrigin-RevId: 476873286
2022-10-19 23:57:16 +00:00
leonwind
29cf09316e Add example CLUT to demo.
PiperOrigin-RevId: 476390089
2022-10-19 23:50:03 +00:00
leonwind
5725ebbeea Add HSL Adjustments to the demo.
PiperOrigin-RevId: 476373520
2022-10-19 23:39:19 +00:00
leonwind
cfc0eef24e Add RGB Adjustments to transformer demo.
PiperOrigin-RevId: 476049125
2022-10-19 23:06:07 +00:00
leonwind
87926f0ba8 Add sepia, grayscale, and inverted filters to the demo app.
PiperOrigin-RevId: 471782565
2022-10-19 20:40:47 +00:00
rohks
a395b23d98 Switch incorrectly configured native multidex to legacy for demos
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470004102
2022-10-19 19:43:43 +00:00
leonwind
f454c9aa74 Delete glPrograms in Contrast and RgbMatrix.
Remove unecessary null checks.

PiperOrigin-RevId: 469999952
2022-10-19 19:36:11 +00:00
rohks
2c70383d38 Fix missing id error
PiperOrigin-RevId: 469750922
2022-10-19 19:28:37 +00:00
huangdarwin
130a536287 HDR: Update limited range and add full range YUV to RGB color transforms.
PiperOrigin-RevId: 467910378
2022-10-19 18:26:58 +00:00
Googler
9c366b3cfd Avoid spinning in between intermediate texture processors.
This change adds a new method onReadyToAcceptInputFrame to
GlTextureProcesssor.InputListener and changes maybeQueueInputFrame
to queueInputFrame, removing the boolean return value.
This avoids the re-trying in ChainingGlTextureProcessorListener
by allowing it to only feed frames from the producing to the consuming
GlTextureProcessor when there is capacity.

MediaPipeProcessor still needs re-trying when processing isn't 1:1.

PiperOrigin-RevId: 466626369
2022-10-19 17:42:37 +00:00
huangdarwin
051dee68e3 Demo: Add legacy external storage permission for intents.
Without this permission, files in `/sdcard` or other directories cannot be read by the demo, as they're not in the transformer demo's scoped storage container.

For more information, see https://developer.android.com/training/data-storage/use-cases

Tested by uninstalling and re-installing the demo app, granting permission by
starting a transformation, and launching an intent using a local file in `/sdcard`
to start another transformation. Without this CL, this threw an error, and with
this CL it succeeded.

PiperOrigin-RevId: 466399023
2022-10-19 17:35:20 +00:00
Googler
a2166a4142 Split GlTextureProcessor.Listener into input/output/error listener.
This simplifies ChainingGlTextureProcessor as it now only connects a
consuming and a producing GlTextureProcessor rather than a previous,
current, and next GlTextureProcessor.

Also use default no-op implementations of the listeners in
SingleFrameGlTextureProcessor and MediaPipeProcessor to avoid
null-checks.

PiperOrigin-RevId: 466301642
2022-10-19 17:20:38 +00:00
Googler
6e4fc47522 Fix ConcurrentHashMap usage in demo MediaPipeProcessor.
PiperOrigin-RevId: 465563540
2022-10-19 16:51:30 +00:00
Googler
6da0a35434 Use multiple output frames in transformer MediaPipe demo pre API 23.
PiperOrigin-RevId: 465545764
2022-10-19 16:40:29 +00:00
Googler
707b061838 Move effects functionality out of transformer to effects module.
PiperOrigin-RevId: 465038852
2022-10-19 16:00:13 +00:00
Googler
06d41c2775 Move FrameProcessor and related interfaces to common.
This will allow effects preview in ExoPlayer to use the
Effect and FrameProcessor interface (and the interfaces
they depend on) without depending on transformer or the
future effects module.

PiperOrigin-RevId: 464060047
2022-10-19 15:34:54 +00:00
leonwind
9df0d40583 Add slider option for contrast in demo app
PiperOrigin-RevId: 464050072
2022-10-19 15:31:03 +00:00
Googler
66dde42989 Add Effect marker interface.
This allows non-GL effects to be passed to custom FrameProcessor
implementations.

PiperOrigin-RevId: 463696384
2022-10-19 14:56:44 +00:00
Googler
b994f8bfa0 Replace Size with Pair in effects.
Size requires API 21. Using Pair instead will allow effects to be
used from API 18 during previewing once they are moved out of
transformer.

PiperOrigin-RevId: 463206474
2022-10-19 14:11:40 +00:00
hschlueter
46ab06b816 Allow stream offset passed to GlEffectsFrameProcessor to change.
This is needed for applying effects to a playlist.

The effects are applied based on the presentation time of the
frame in its corresponding media item and the offset is added
back before encoding.

Each time the offset changes, end of input stream is signalled
to the texture processors. This is needed because the texture
processors can expect monotonically increasing timestamp within
the same input stream but when the offset changes, the timstamps
jump back to 0.

PiperOrigin-RevId: 462714966
2022-07-25 22:23:20 +01:00
huangdarwin
1ecf1eb7bf HDR: Implement HLG EOTF and OETF.
This allows us to use BT.2020 RGB linear for intermediate shaders, which also
allows us to re-enable PeriodicVignetteProcessor, which should work properly in
linear color-spaces.

Manually tested by adding a GlEffectsWrapper, and confirming that HLG HDR editing still looks correct.

PiperOrigin-RevId: 462265821
2022-07-21 13:23:20 +00:00
olly
7ef41c7321 Add ContrastProcessor for contrast adjustments.
PiperOrigin-RevId: 462232813
2022-07-21 13:19:55 +00:00
huangdarwin
f67c1a73f4 HDR: Use FP16 color representation for texture processors.
* Introduced `useHdr` for `GlEffect#toGlTextureProcessor`, so
  `TextureProcessor` implementations can decide how to handle HDR.
* Creating FP16 color textures for HDR input.

Tested via manual testing, adding a no-op GlEffectWrapper to the transformation to
force use of intermediate textures, adding a linear ramp to the fragment shader,
and trying to ascertain that there's a real reduction in posterization when
switching from 4-bit to 8-bit unsigned bytes, and again from 8-bit unsigned bytes
to 16-bit floating point.

PiperOrigin-RevId: 461613117
2022-07-21 12:55:36 +00:00
andrewlewis
405be80fe5 Update demo HDR10 video URL
The old URL doesn't correctly signal the HDR10 color info in the container.

The new URL signals ST2084 (PQ) transfer function and BT.2020 color space as expected.

PiperOrigin-RevId: 461560107
2022-07-21 12:40:03 +00:00