mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Implement DefaultVideoSink.flush()
This is part of the effort to delegate the rendering of the VideoGraph output frames to a DefaultVideoSink. PiperOrigin-RevId: 685622019
This commit is contained in:
parent
7dbacdb011
commit
5eeedeacc6
@ -80,6 +80,7 @@ import java.util.concurrent.Executor;
|
|||||||
if (resetPosition) {
|
if (resetPosition) {
|
||||||
videoFrameReleaseControl.reset();
|
videoFrameReleaseControl.reset();
|
||||||
}
|
}
|
||||||
|
videoFrameRenderControl.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -439,12 +439,12 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
|||||||
videoFrameRenderControl.render(positionUs, elapsedRealtimeUs);
|
videoFrameRenderControl.render(positionUs, elapsedRealtimeUs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void flush() {
|
private void flush(boolean resetPosition) {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pendingFlushCount++;
|
pendingFlushCount++;
|
||||||
videoFrameRenderControl.flush();
|
defaultVideoSink.flush(resetPosition);
|
||||||
// Handle pending video graph callbacks to ensure video size changes reach the video render
|
// Handle pending video graph callbacks to ensure video size changes reach the video render
|
||||||
// control.
|
// control.
|
||||||
checkStateNotNull(handler).post(() -> pendingFlushCount--);
|
checkStateNotNull(handler).post(() -> pendingFlushCount--);
|
||||||
@ -564,8 +564,7 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
|||||||
hasRegisteredFirstInputStream = false;
|
hasRegisteredFirstInputStream = false;
|
||||||
finalBufferPresentationTimeUs = C.TIME_UNSET;
|
finalBufferPresentationTimeUs = C.TIME_UNSET;
|
||||||
lastBufferPresentationTimeUs = C.TIME_UNSET;
|
lastBufferPresentationTimeUs = C.TIME_UNSET;
|
||||||
PlaybackVideoGraphWrapper.this.flush();
|
PlaybackVideoGraphWrapper.this.flush(resetPosition);
|
||||||
defaultVideoSink.flush(resetPosition);
|
|
||||||
pendingInputStreamBufferPresentationTimeUs = C.TIME_UNSET;
|
pendingInputStreamBufferPresentationTimeUs = C.TIME_UNSET;
|
||||||
// Don't change input stream offset or reset the pending input stream offset change so that
|
// Don't change input stream offset or reset the pending input stream offset change so that
|
||||||
// it's announced with the next input frame.
|
// it's announced with the next input frame.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user