716 Commits

Author SHA1 Message Date
andrewlewis
506aa2c999 Instantiate SurfaceView on main thread
On some devices/builds it seems that the `SurfaceView` constructor tries to create a handler. Move instantiation to the main thread when getting the debug surface view so that handler creation succeeds.

PiperOrigin-RevId: 505745387
2023-02-01 14:55:01 +00:00
kimvde
341f2d6b3a Move flattenForSlowMotion to EditedMediaItem
PiperOrigin-RevId: 504867150
2023-02-01 13:50:59 +00:00
kimvde
5ed72efbe0 Move removeAudio/Video to EditedMediaItem
Also add a Builder to EditedMediaItem to avoid having a constructor with
many optional parameters, or a chain of constructors.

PiperOrigin-RevId: 504588544
2023-01-25 20:25:23 +00:00
kimvde
4f6b83e2c3 Remove usages of deprecated startTransformation
PiperOrigin-RevId: 503138745
2023-01-23 13:21:42 +00:00
samrobinson
76af4270a9 Generate silent audio if no audio track is available.
To always generate silent audio, `removeAudio(true)` can be used in conjunction.

PiperOrigin-RevId: 502814315
2023-01-18 13:21:57 +00:00
kimvde
89e14989b3 Remove setScale and setRotationDegrees from TransformationRequest
Also remove usages of TransformationRequest convenience methods
(setScale, setRotationDegrees and setResolution).

Some usages of setResolution can't be removed yet because they are used
for fallback.

PiperOrigin-RevId: 502415748
2023-01-17 03:38:19 +00:00
bachinger
6bacbaac54 Request notification permission in demo app for API 33+
Starting with API 33 the POST_NOTIFICATION permission needs to be
requested at runtime or the notification is not shown.

Note that with an app with targetSdkVersion < 33
but on a device with API 33 the notification permission is automatically
requested when the app starts for the first time. If the user does not
grant the permission, requesting the permission at runtime result in
an empty array of grant results.

Issue: google/ExoPlayer#10884
PiperOrigin-RevId: 501320632
2023-01-17 02:15:31 +00:00
kimvde
6729460993 Demo app fixes
- Do not fail silently if selectedEffects is null.
- Do not add an empty overlay effect to the Transformer to avoid
  transcoding video all the time.

PiperOrigin-RevId: 499168759
2023-01-04 19:35:15 +00:00
ibaker
010c6b96e7 Enable RTL support in the demo app
We might as well keep this enabled by default, rather than having to
manually toggle it on to investigate RTL issues like Issue: androidx/media#227.

PiperOrigin-RevId: 497159744
2023-01-04 18:59:55 +00:00
tofunmi
1fa7f22367 Use OverlayEffect for ‘Overlay logo & timer' in transformer demo.
PiperOrigin-RevId: 497112875
2023-01-04 18:48:33 +00:00
huangdarwin
dea7ab314a HDR: Implement Transformer HDR to SDR GL tone-mapping API
Note that we simply use GlEffectsFrameProcessor in-app / GL tone-mapping, so PQ->SDR tone-mapping isn't yet implemented.

Tested manually using the demo on Pixel 7, to confirm that device and in-app tone
mapping behave similarly.

PiperOrigin-RevId: 496700231
2022-12-21 17:34:35 +00:00
kimvde
18031e25bb Make AssetLoader progress not Transformer specific
To do that, rename PROGRESS_STATE_NO_TRANSFORMATION to
PROGRESS_STATE_NOT_STARTED and update Javadoc of ProgressState to not be
Transformer specific.

PiperOrigin-RevId: 496653460
2022-12-21 17:11:15 +00:00
claincly
4a3d693c3e Replace Pair with Size in effects.
PiperOrigin-RevId: 495646341
2022-12-21 15:57:19 +00:00
samrobinson
e46b4c0fdc Create and return a TransformationResult regardless of success.
The TransformationResult has some useful values that are set in error
cases, such as the codecs used.

PiperOrigin-RevId: 495568259
2022-12-15 17:15:59 +00:00
tofunmi
01ff4e37c5 Replace hardcoded selectedEffects indices with public static finals.
PiperOrigin-RevId: 493543188
2022-12-12 13:54:17 +00:00
tofunmi
c513c138f2 Update demo transformer app with text overlay demo effect.
Implements milestone 1.4.2 of the [overlays implementation plan](https://docs.google.com/document/d/1EcP2GN8k8N74hHZyD0KTqm9oQo5-W1dZMqIVyqVGtlo/edit#bookmark=id.76uzcie1dg9d)

PiperOrigin-RevId: 493324764
2022-12-12 13:41:11 +00:00
tofunmi
e85e343681 Update demo transformer app with bitmap overlay demo effect.
Implements milestone 1.4.1 of the [overlays implementation plan](https://docs.google.com/document/d/1EcP2GN8k8N74hHZyD0KTqm9oQo5-W1dZMqIVyqVGtlo/edit#bookmark=id.76uzcie1dg9d)

PiperOrigin-RevId: 493291813
2022-12-12 13:24:14 +00:00
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