mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00
When effects are enabled, opportunistally render to VFP
Even when there's no display surface, MCVR can render frames to VFP, becuase by the time the frame is processed: - If there's still no surface, VFP will drop the frame; - If there's surface, the processed frame would be rendered. In short, placeholder surface is not needed in effect enabled playback. FWIW, it is used to swallow frames directly from MediaCodec when there's no output surface. PiperOrigin-RevId: 609705222
This commit is contained in:
parent
0480eff6a1
commit
68a78b9218
@ -1332,7 +1332,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
}
|
||||
|
||||
// We are not rendering on a surface, the renderer will wait until a surface is set.
|
||||
if (displaySurface == placeholderSurface) {
|
||||
// Opportunistically render to VideoFrameProcessor if effects are enabled.
|
||||
if (displaySurface == placeholderSurface && !videoSinkProvider.isInitialized()) {
|
||||
// Skip frames in sync with playback, so we'll be at the right frame if the mode changes.
|
||||
if (videoFrameReleaseInfo.getEarlyUs() < 30_000) {
|
||||
skipOutputBuffer(codec, bufferIndex, presentationTimeUs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user