mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Use VideoSink directly in MCVR where possible
PiperOrigin-RevId: 630030889
This commit is contained in:
parent
0893275841
commit
d059e97b28
1 changed files with 4 additions and 6 deletions
|
|
@ -647,11 +647,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
|
||||
@Override
|
||||
protected void onPositionReset(long positionUs, boolean joining) throws ExoPlaybackException {
|
||||
// When this renderer doesn't own the VideoSinkProvider, it's possible that the VideoSink is
|
||||
// already initialized by another renderer, before this renderer is enabled.
|
||||
// When this renderer doesn't own the VideoSink, it's possible that the VideoSink is already
|
||||
// initialized by another renderer, before this renderer is enabled.
|
||||
// Flush the video sink first to ensure it stops reading textures that will be owned by
|
||||
// MediaCodec once the codec is flushed.
|
||||
videoSinkProvider.getSink().flush();
|
||||
videoSink.flush();
|
||||
super.onPositionReset(positionUs, joining);
|
||||
videoFrameReleaseControl.reset();
|
||||
if (joining) {
|
||||
|
|
@ -1451,9 +1451,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
super.onProcessedStreamChange();
|
||||
videoFrameReleaseControl.onProcessedStreamChange();
|
||||
maybeSetupTunnelingForFirstFrame();
|
||||
// If the renderer does not own the VideoSinkProvider, it's possible the VideoSink is null when
|
||||
// this method is invoked, that is when transitioning from another renderer.
|
||||
videoSinkProvider.getSink().setStreamOffsetUs(getOutputStreamOffsetUs());
|
||||
videoSink.setStreamOffsetUs(getOutputStreamOffsetUs());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue