mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
7b5dcb3786
commit
e094ceb079
4 changed files with 7 additions and 8 deletions
|
|
@ -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 androidx.media3.common.Format;
|
import androidx.media3.common.C;
|
||||||
import androidx.media3.common.util.GlUtil;
|
import androidx.media3.common.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;
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import androidx.media3.common.C;
|
import androidx.media3.common.C;
|
||||||
import androidx.media3.common.Format;
|
|
||||||
import androidx.media3.common.MediaItem;
|
import androidx.media3.common.MediaItem;
|
||||||
import androidx.media3.common.MediaLibraryInfo;
|
import androidx.media3.common.MediaLibraryInfo;
|
||||||
import androidx.media3.common.MimeTypes;
|
import androidx.media3.common.MimeTypes;
|
||||||
|
|
@ -115,7 +114,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() {};
|
||||||
|
|
@ -132,7 +131,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;
|
||||||
&& !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;
|
||||||
// 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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue