Commit 66adeabb by hschlueter Committed by Ian Baker

Use C.LENGTH_UNSET for resolution parameter instead of Format.NO_VALUE.

Format.NO_VALUE should only be used for Format fields.

PiperOrigin-RevId: 416646415
parent 4bf7ffd9
......@@ -29,7 +29,7 @@ import android.opengl.GLES20;
import android.view.Surface;
import android.view.SurfaceView;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.GlUtil;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;
......@@ -109,8 +109,8 @@ import java.util.concurrent.atomic.AtomicInteger;
debugPreviewHeight = debugSurfaceView.getHeight();
} else {
debugPreviewEglSurface = null;
debugPreviewWidth = Format.NO_VALUE;
debugPreviewHeight = Format.NO_VALUE;
debugPreviewWidth = C.LENGTH_UNSET;
debugPreviewHeight = C.LENGTH_UNSET;
}
return new FrameEditor(
eglDisplay,
......
......@@ -38,7 +38,6 @@ import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player;
......@@ -113,7 +112,7 @@ public final class Transformer {
@Deprecated
public Builder() {
muxerFactory = new FrameworkMuxer.Factory();
outputHeight = Format.NO_VALUE;
outputHeight = C.LENGTH_UNSET;
transformationMatrix = new Matrix();
containerMimeType = MimeTypes.VIDEO_MP4;
listener = new Listener() {};
......@@ -130,7 +129,7 @@ public final class Transformer {
public Builder(Context context) {
this.context = context.getApplicationContext();
muxerFactory = new FrameworkMuxer.Factory();
outputHeight = Format.NO_VALUE;
outputHeight = C.LENGTH_UNSET;
transformationMatrix = new Matrix();
containerMimeType = MimeTypes.VIDEO_MP4;
listener = new Listener() {};
......
......@@ -89,7 +89,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
&& !transformation.videoMimeType.equals(inputFormat.sampleMimeType)) {
return true;
}
if (transformation.outputHeight != Format.NO_VALUE
if (transformation.outputHeight != C.LENGTH_UNSET
&& transformation.outputHeight != inputFormat.height) {
return true;
}
......
......@@ -66,7 +66,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// TODO(internal b/209781577): Think about which edge length should be set for portrait videos.
int outputWidth = inputFormat.width;
int outputHeight = inputFormat.height;
if (transformation.outputHeight != Format.NO_VALUE
if (transformation.outputHeight != C.LENGTH_UNSET
&& transformation.outputHeight != inputFormat.height) {
outputWidth = inputFormat.width * transformation.outputHeight / inputFormat.height;
outputHeight = transformation.outputHeight;
......
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