Fix bug where streamOffsetUs is passed instead of streamPositionUs

Also make order of streamStartPositionUs and streamOffsetUs consistent

PiperOrigin-RevId: 487511633
This commit is contained in:
kimvde 2022-11-10 13:46:39 +00:00 committed by microkatz
parent 33bea391d4
commit c9fe52bf67
6 changed files with 14 additions and 14 deletions

View File

@ -55,8 +55,8 @@ import org.checkerframework.dataflow.qual.Pure;
public AudioTranscodingSamplePipeline(
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
Codec.DecoderFactory decoderFactory,
Codec.EncoderFactory encoderFactory,
@ -65,8 +65,8 @@ import org.checkerframework.dataflow.qual.Pure;
throws TransformationException {
super(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);

View File

@ -30,8 +30,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/* package */ abstract class BaseSamplePipeline implements SamplePipeline {
private final long streamOffsetUs;
private final long streamStartPositionUs;
private final long streamOffsetUs;
private final MuxerWrapper muxerWrapper;
private final @C.TrackType int trackType;
private final @MonotonicNonNull SefSlowMotionFlattener sefVideoSlowMotionFlattener;
@ -42,12 +42,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
public BaseSamplePipeline(
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
boolean flattenForSlowMotion,
MuxerWrapper muxerWrapper) {
this.streamOffsetUs = streamOffsetUs;
this.streamStartPositionUs = streamStartPositionUs;
this.streamOffsetUs = streamOffsetUs;
this.muxerWrapper = muxerWrapper;
trackType = MimeTypes.getTrackType(inputFormat.sampleMimeType);
sefVideoSlowMotionFlattener =

View File

@ -44,8 +44,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private final DecoderInputBuffer decoderInputBuffer;
private boolean isTransformationRunning;
private long streamOffsetUs;
private long streamStartPositionUs;
private long streamOffsetUs;
private @MonotonicNonNull SamplePipeline samplePipeline;
public ExoPlayerAssetLoaderRenderer(
@ -110,8 +110,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Override
protected void onStreamChanged(Format[] formats, long startPositionUs, long offsetUs) {
this.streamOffsetUs = offsetUs;
this.streamStartPositionUs = startPositionUs;
this.streamOffsetUs = offsetUs;
}
@Override

View File

@ -30,15 +30,15 @@ import androidx.media3.decoder.DecoderInputBuffer;
public PassthroughSamplePipeline(
Format format,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
MuxerWrapper muxerWrapper,
FallbackListener fallbackListener) {
super(
format,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);
this.format = format;

View File

@ -160,7 +160,7 @@ import com.google.common.collect.ImmutableList;
if (MimeTypes.isAudio(inputFormat.sampleMimeType) && shouldTranscodeAudio(inputFormat)) {
return new AudioTranscodingSamplePipeline(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
decoderFactory,
@ -172,8 +172,8 @@ import com.google.common.collect.ImmutableList;
return new VideoTranscodingSamplePipeline(
context,
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
videoEffects,
frameProcessorFactory,
@ -186,8 +186,8 @@ import com.google.common.collect.ImmutableList;
} else {
return new PassthroughSamplePipeline(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
muxerWrapper,
fallbackListener);

View File

@ -66,8 +66,8 @@ import org.checkerframework.dataflow.qual.Pure;
public VideoTranscodingSamplePipeline(
Context context,
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
ImmutableList<Effect> effects,
FrameProcessor.Factory frameProcessorFactory,
@ -80,8 +80,8 @@ import org.checkerframework.dataflow.qual.Pure;
throws TransformationException {
super(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);