Commit 07fe6071 by claincly Committed by Rohit Singh

Fix not able to set a null output surface.

Previously, after calling MCVR.setOutput() with null, `frameProcessorManager`'s output surface is cleared. What was unexpected is `ExoPlayerInternal` notifies a zero output resolution after clearing the output surface. This zero resolution causes FrameProcessor to fail.

PiperOrigin-RevId: 501861993
parent e7730319
...@@ -682,7 +682,10 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -682,7 +682,10 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
break; break;
case MSG_SET_VIDEO_OUTPUT_RESOLUTION: case MSG_SET_VIDEO_OUTPUT_RESOLUTION:
Size outputResolution = (Size) checkNotNull(message); Size outputResolution = (Size) checkNotNull(message);
if (displaySurface != null && frameProcessorManager.isEnabled()) { if (outputResolution.getWidth() != 0
&& outputResolution.getHeight() != 0
&& displaySurface != null
&& frameProcessorManager.isEnabled()) {
frameProcessorManager.setOutputSurfaceInfo(displaySurface, outputResolution); frameProcessorManager.setOutputSurfaceInfo(displaySurface, outputResolution);
} }
break; break;
...@@ -2047,6 +2050,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -2047,6 +2050,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
checkNotNull(frameProcessor).setOutputSurfaceInfo(null); checkNotNull(frameProcessor).setOutputSurfaceInfo(null);
currentSurfaceAndSize = null; currentSurfaceAndSize = null;
} }
/** /**
* Sets the input surface info. * Sets the input surface info.
* *
......
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