792 Commits

Author SHA1 Message Date
kimvde
fed93723a3 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 21:48:54 +00:00
ibaker
69583d0ac1 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 21:39:27 +00:00
tofunmi
bea32abefc Use OverlayEffect for ‘Overlay logo & timer' in transformer demo.
PiperOrigin-RevId: 497112875
2023-01-04 21:36:27 +00:00
huangdarwin
84c81b8575 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 15:30:54 +00:00
kimvde
97e49ac312 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 15:24:47 +00:00
claincly
6376f5f7c7 Replace Pair with Size in effects.
PiperOrigin-RevId: 495646341
2022-12-21 15:02:20 +00:00
samrobinson
63cc0338e1 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 16:15:40 +00:00
tonihei
ae8000aeca Replace MediaMetadata folderType by isBrowsable
The folder type has a mix of information about the item. It shows
whether the item is browsable (type != FOLDER_TYPE_NONE) and
which Bluetooth folder type to set for legacy session information.

It's a lot clearer to split this into a boolean isBrowsable and
use the existing mediaType to map back to the bluetooth folder type
where required.

folderType is not marked as deprecated yet as this would be an API
change, which will be done later.

PiperOrigin-RevId: 493544589
2022-12-12 11:32:57 +00:00
tofunmi
c7e9a0404f Replace hardcoded selectedEffects indices with public static finals.
PiperOrigin-RevId: 493543188
2022-12-12 11:30:59 +00:00
tofunmi
9010e8c368 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 11:27:44 +00:00
tofunmi
49c49b34fb 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 11:23:28 +00:00
claincly
900e86ffc8 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 11:13:30 +00:00
samrobinson
ead7070b60 Add setter for some audio effects to demo app.
PiperOrigin-RevId: 493001630
2022-12-12 11:12:19 +00:00
samrobinson
991010f24c 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 11:11:19 +00:00
michaelkatz
64603cba8d Added cancellation check for MediaBrowserFuture in demo session app
When app is deployed with device's screen being off, MainActivity's onStart is called swiftly by its onStop. The onStop method cancels the browserFuture task which in turn "completes" the task. Upon task "completion", pushRoot() runs and then throws error as it calls get() a cancelled task.

PiperOrigin-RevId: 492416445
2022-12-12 11:03:37 +00:00
bachinger
6a5ac19140 Stop service when app is terminated while the player is paused
If the service ever has been started but is not in the foreground, the
service would be terminated without calling onDestroy(). This is because
when onStartCommand returns START_STICKY [1], the app takes the
responsibility to stop the service.

Note that this change interrupts the user journey when paused, because the
notification is removed. Apps can implement playback resumption [2] to give
the user an option to resume playback after the service has been terminated.

[1] https://developer.android.com/reference/android/app/Service#START_STICKY
[2] https://developer.android.com/guide/topics/media/media-controls#supporting_playback_resumption

Issue: androidx/media#175
#minor-release
PiperOrigin-RevId: 492192690
2022-12-12 10:59:23 +00:00
kimvde
fed53362c9 Add checkbox in demo to enable watchdog timer
PiperOrigin-RevId: 490836952
2022-11-29 18:30:00 +00:00
kimvde
e12dd1ac5d Surface player release timeouts
Also make sure the demo app doesn't crash when it happens.

PiperOrigin-RevId: 490725959
2022-11-24 15:00:34 +00:00
tofunmi
dd9741399b Reordering views for consistency in transformer demo app
PiperOrigin-RevId: 489216085
2022-11-22 09:56:55 +00:00
tofunmi
8cec71b3e8 Fix video disappearing when the app is brought out of the background
PiperOrigin-RevId: 489212224
2022-11-22 09:55:49 +00:00
tianyifeng
cfe36af847 Update targetSdkVersion of demo session app to appTargetSdkVersion
PiperOrigin-RevId: 488884403
2022-11-16 12:18:46 +00:00
huangdarwin
53cff556bf 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:16:21 +00:00
ibaker
adc993dc57 Reformat demo build.gradle file
PiperOrigin-RevId: 488376715
2022-11-14 17:55:58 +00:00
huangdarwin
6820704b08 HDR: For HDR videos, enableHdrEditing by default.
Previously, tone-mapping was the default.

PiperOrigin-RevId: 488362209
2022-11-14 17:54:51 +00:00
huangdarwin
0cd1edd834 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:52:37 +00:00
ibaker
62d6c303c1 Reformat demo build.gradle file
PiperOrigin-RevId: 487539107
2022-11-14 17:46:14 +00:00
christosts
40c6c43197 Set targetSdkVersion of main demo app to 29
#minor-release

PiperOrigin-RevId: 487479366
2022-11-10 14:50:41 +00:00
huangdarwin
2ff5dab003 HDR: Implement ForceInterpretHdrVideoAsSdr
Also, document that we tone map when no HDR features are explicitly set

PiperOrigin-RevId: 487310971
2022-11-10 14:41:05 +00:00
tonihei
ab9f0608cd Set matching folder type in Session demo app.
The folder type is useful metadata to understand programmatically
what criterion was used to create the folder.

PiperOrigin-RevId: 486653317
2022-11-08 11:32:18 +00:00
bachinger
64e9e88823 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 11:42:19 +00:00
tofunmi
f1ca4f41b1 Mute input video player in transformer demo
PiperOrigin-RevId: 483969411
2022-10-31 11:37:29 +00:00
Googler
7e8f0f0918 Fix blank toast in Transformer Demo
PiperOrigin-RevId: 480847967
2022-10-17 15:55:35 +00:00
huangdarwin
f35bda3524 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-17 15:52:35 +00:00
huangdarwin
51edb329a1 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-17 15:51:35 +00:00
huangdarwin
fb5cd18dcd 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-17 15:50:42 +00:00
Googler
b515e0bd7f Add local file picker to ConfigurationActivity
PiperOrigin-RevId: 480349627
2022-10-17 15:49:23 +00:00
tonihei
5d6d069e4e 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
2022-10-17 15:42:30 +00:00
Googler
50df923b25 Add button to show/hide input player in TransformerActivity
PiperOrigin-RevId: 479003655
2022-10-17 15:30:35 +00:00
Googler
48a7f6a924 Add second player for input video
PiperOrigin-RevId: 478510687
2022-10-17 15:26:27 +00:00
samrobinson
1cfe18cd1f Demo: Split video Effect generation out of createTransformer.
PiperOrigin-RevId: 477524540
2022-09-30 18:31:02 +00:00
Googler
bb811f0da5 Fix checkboxes on configuration page
PiperOrigin-RevId: 477166507
2022-09-30 18:26:20 +00:00
huangdarwin
16dca1828c HDR: Update gamma comments to linear.
Comment-only change.

PiperOrigin-RevId: 476873286
2022-09-30 18:20:18 +00:00
leonwind
5b3efa8ad9 Add example CLUT to demo.
PiperOrigin-RevId: 476390089
2022-09-30 18:17:21 +00:00
leonwind
7626f70cef Add HSL Adjustments to the demo.
PiperOrigin-RevId: 476373520
2022-09-30 18:14:22 +00:00
leonwind
9ccdd22e85 Add RGB Adjustments to transformer demo.
PiperOrigin-RevId: 476049125
2022-09-30 18:06:22 +00:00
leonwind
305ea20518 Add sepia, grayscale, and inverted filters to the demo app.
PiperOrigin-RevId: 471782565
2022-09-30 17:23:01 +00:00
rohks
9a6745431a Use ContextCompat.getMainExecutor when calling MediaBrowser methods
Replacing remaining usage of MoreExecutors.directExecutor. This allows the service to be switched to run in another process and the app still works the same as if it is running in the same process.

Issue: androidx/media#100
PiperOrigin-RevId: 471547177
2022-09-30 17:19:30 +00:00
rohks
d260b0c2a0 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-09-30 17:05:23 +00:00
leonwind
a7d3752c66 Delete glPrograms in Contrast and RgbMatrix.
Remove unecessary null checks.

PiperOrigin-RevId: 469999952
2022-09-30 17:03:27 +00:00
rohks
8457794978 Fix missing id error
PiperOrigin-RevId: 469750922
2022-09-30 17:01:26 +00:00