Commit c65e5cfe by hschlueter Committed by Ian Baker

Track presentation timestamps in FrameEditor.

PiperOrigin-RevId: 428763554
parent 0619a96f
......@@ -207,7 +207,13 @@ public final class DefaultCodec implements Codec {
public void releaseOutputBuffer(boolean render) throws TransformationException {
outputBuffer = null;
try {
mediaCodec.releaseOutputBuffer(outputBufferIndex, render);
if (render) {
mediaCodec.releaseOutputBuffer(
outputBufferIndex,
/* renderTimestampNs= */ checkStateNotNull(outputBufferInfo).presentationTimeUs * 1000);
} else {
mediaCodec.releaseOutputBuffer(outputBufferIndex, /* render= */ false);
}
} catch (RuntimeException e) {
throw createTransformationException(e);
}
......
......@@ -325,8 +325,8 @@ import java.util.concurrent.atomic.AtomicInteger;
glProgram.bindAttributesAndUniforms();
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
long surfaceTextureTimestampNs = inputSurfaceTexture.getTimestamp();
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTextureTimestampNs);
long presentationTimeNs = inputSurfaceTexture.getTimestamp();
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, presentationTimeNs);
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
if (debugPreviewEglSurface != null) {
......
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