Commit daeea81e by huangdarwin Committed by Ian Baker

Transformer GL: Create demo UI for changing resolution.

Also, add 144p as an acceptable output resolution, to allow for
a more obvious resolution difference when running the demo.

PiperOrigin-RevId: 414406664
parent a40a71a5
...@@ -235,7 +235,7 @@ public final class Transformer { ...@@ -235,7 +235,7 @@ public final class Transformer {
* Sets the output resolution using the output height. The default value is the same height as * Sets the output resolution using the output height. The default value is the same height as
* the input. Output width will scale to preserve the input video's aspect ratio. * the input. Output width will scale to preserve the input video's aspect ratio.
* *
* <p>For now, only "popular" heights like 240, 360, 480, 720, 1080, 1440, or 2160 are * <p>For now, only "popular" heights like 144, 240, 360, 480, 720, 1080, 1440, or 2160 are
* supported, to ensure compatibility on different devices. * supported, to ensure compatibility on different devices.
* *
* <p>For example, a 1920x1440 video can be scaled to 640x480 by calling setResolution(480). * <p>For example, a 1920x1440 video can be scaled to 640x480 by calling setResolution(480).
...@@ -247,7 +247,8 @@ public final class Transformer { ...@@ -247,7 +247,8 @@ public final class Transformer {
// TODO(Internal b/201293185): Restructure to input a Presentation class. // TODO(Internal b/201293185): Restructure to input a Presentation class.
// TODO(Internal b/201293185): Check encoder codec capabilities in order to allow arbitrary // TODO(Internal b/201293185): Check encoder codec capabilities in order to allow arbitrary
// resolutions and reasonable fallbacks. // resolutions and reasonable fallbacks.
if (outputHeight != 240 if (outputHeight != 144
&& outputHeight != 240
&& outputHeight != 360 && outputHeight != 360
&& outputHeight != 480 && outputHeight != 480
&& outputHeight != 720 && outputHeight != 720
...@@ -255,7 +256,7 @@ public final class Transformer { ...@@ -255,7 +256,7 @@ public final class Transformer {
&& outputHeight != 1440 && outputHeight != 1440
&& outputHeight != 2160) { && outputHeight != 2160) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Please use a height of 240, 360, 480, 720, 1080, 1440, or 2160."); "Please use a height of 144, 240, 360, 480, 720, 1080, 1440, or 2160.");
} }
this.outputHeight = outputHeight; this.outputHeight = outputHeight;
return this; return this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment