mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
Track presentation timestamps in FrameEditor.
PiperOrigin-RevId: 428763554
This commit is contained in:
parent
0619a96fa2
commit
c65e5cfef8
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user