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