Remove direct usages of release control when video sink is used
Usages removed in this CL are: - onProcessedStreamChange, which was already called from the VideoSink (via VideoFrameRenderControl) - setOutputSurface, which was also already called from the VideoSink - setFrameRate, which this CL now sets in the VideoSink PiperOrigin-RevId: 640530903
This commit is contained in:
parent
9716985272
commit
f54380f9d8
@ -575,6 +575,7 @@ public final class CompositingVideoSinkProvider implements VideoSinkProvider, Vi
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unsupported input type " + inputType);
|
||||
}
|
||||
videoFrameReleaseControl.setFrameRate(format.frameRate);
|
||||
// MediaCodec applies rotation after API 21.
|
||||
if (inputType == INPUT_TYPE_SURFACE
|
||||
&& Util.SDK_INT < 21
|
||||
|
@ -825,7 +825,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
// We only need to update the codec if the display surface has changed.
|
||||
if (this.displaySurface != displaySurface) {
|
||||
this.displaySurface = displaySurface;
|
||||
if (!shouldUseVideoSink) {
|
||||
videoFrameReleaseControl.setOutputSurface(displaySurface);
|
||||
}
|
||||
haveReportedFirstFrameRenderedForCurrentSurface = false;
|
||||
|
||||
@State int state = getState();
|
||||
@ -1230,7 +1232,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
}
|
||||
decodedVideoSize =
|
||||
new VideoSize(width, height, unappliedRotationDegrees, pixelWidthHeightRatio);
|
||||
videoFrameReleaseControl.setFrameRate(format.frameRate);
|
||||
|
||||
if (shouldUseVideoSink) {
|
||||
onReadyToRegisterVideoSinkInputStream();
|
||||
@ -1243,6 +1244,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
.setRotationDegrees(unappliedRotationDegrees)
|
||||
.setPixelWidthHeightRatio(pixelWidthHeightRatio)
|
||||
.build());
|
||||
} else {
|
||||
videoFrameReleaseControl.setFrameRate(format.frameRate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1454,9 +1457,12 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
@Override
|
||||
protected void onProcessedStreamChange() {
|
||||
super.onProcessedStreamChange();
|
||||
videoFrameReleaseControl.onProcessedStreamChange();
|
||||
maybeSetupTunnelingForFirstFrame();
|
||||
if (shouldUseVideoSink) {
|
||||
videoSink.setStreamOffsetUs(getOutputStreamOffsetUs());
|
||||
} else {
|
||||
videoFrameReleaseControl.onProcessedStreamChange();
|
||||
}
|
||||
maybeSetupTunnelingForFirstFrame();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -432,8 +432,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
.setWidth(outputImage.getWidth())
|
||||
.setHeight(outputImage.getHeight())
|
||||
.setColorInfo(ColorInfo.SRGB_BT709_FULL)
|
||||
.setFrameRate(/* frameRate= */ DEFAULT_FRAME_RATE)
|
||||
.build());
|
||||
videoFrameReleaseControl.setFrameRate(/* frameRate= */ DEFAULT_FRAME_RATE);
|
||||
inputStreamPendingRegistration = false;
|
||||
}
|
||||
return videoSink.queueBitmap(outputImage, checkStateNotNull(timestampIterator));
|
||||
|
Loading…
x
Reference in New Issue
Block a user