Commit 756b77eb by tofunmi Committed by Tofunmi Adigun-Hameed

Change order of operations in videoSamplePipeline

similar error to https://github.com/google/ExoPlayer/commit/2c4a567c74088c639d699eeefe139c38e254e230L `registerInputStream` sets the textureManager, so reordering makes sure the textureManager is set before you set the frame info. This is important for texture input, where the frame info provides the width and height.

PiperOrigin-RevId: 530579584
parent 4abd34d8
...@@ -210,12 +210,6 @@ import org.checkerframework.dataflow.qual.Pure; ...@@ -210,12 +210,6 @@ import org.checkerframework.dataflow.qual.Pure;
boolean isLast) { boolean isLast) {
if (trackFormat != null) { if (trackFormat != null) {
Size decodedSize = getDecodedSize(trackFormat); Size decodedSize = getDecodedSize(trackFormat);
videoFrameProcessor.setInputFrameInfo(
new FrameInfo.Builder(decodedSize.getWidth(), decodedSize.getHeight())
.setPixelWidthHeightRatio(trackFormat.pixelWidthHeightRatio)
.setOffsetToAddUs(mediaItemOffsetUs.get())
.build());
String mimeType = checkNotNull(trackFormat.sampleMimeType); String mimeType = checkNotNull(trackFormat.sampleMimeType);
if (MimeTypes.isVideo(mimeType)) { if (MimeTypes.isVideo(mimeType)) {
videoFrameProcessor.registerInputStream(INPUT_TYPE_SURFACE); videoFrameProcessor.registerInputStream(INPUT_TYPE_SURFACE);
...@@ -224,6 +218,11 @@ import org.checkerframework.dataflow.qual.Pure; ...@@ -224,6 +218,11 @@ import org.checkerframework.dataflow.qual.Pure;
} else { } else {
throw new IllegalArgumentException("MIME type not supported " + mimeType); throw new IllegalArgumentException("MIME type not supported " + mimeType);
} }
videoFrameProcessor.setInputFrameInfo(
new FrameInfo.Builder(decodedSize.getWidth(), decodedSize.getHeight())
.setPixelWidthHeightRatio(trackFormat.pixelWidthHeightRatio)
.setOffsetToAddUs(mediaItemOffsetUs.get())
.build());
} }
mediaItemOffsetUs.addAndGet(durationUs); mediaItemOffsetUs.addAndGet(durationUs);
} }
......
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