mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Track presentation timestamps in FrameEditor.
PiperOrigin-RevId: 428763554
This commit is contained in:
parent
b22273de01
commit
9370665b79
@ -209,7 +209,13 @@ public final class DefaultCodec implements Codec {
|
|||||||
public void releaseOutputBuffer(boolean render) throws TransformationException {
|
public void releaseOutputBuffer(boolean render) throws TransformationException {
|
||||||
outputBuffer = null;
|
outputBuffer = null;
|
||||||
try {
|
try {
|
||||||
mediaCodec.releaseOutputBuffer(outputBufferIndex, render);
|
if (render) {
|
||||||
|
mediaCodec.releaseOutputBuffer(
|
||||||
|
outputBufferIndex,
|
||||||
|
/* renderTimestampNs= */ checkStateNotNull(outputBufferInfo).presentationTimeUs * 1000);
|
||||||
|
} else {
|
||||||
|
mediaCodec.releaseOutputBuffer(outputBufferIndex, /* render= */ false);
|
||||||
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
throw createTransformationException(e);
|
throw createTransformationException(e);
|
||||||
}
|
}
|
||||||
|
@ -325,8 +325,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
glProgram.bindAttributesAndUniforms();
|
glProgram.bindAttributesAndUniforms();
|
||||||
|
|
||||||
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
|
focusAndDrawQuad(eglSurface, outputWidth, outputHeight);
|
||||||
long surfaceTextureTimestampNs = inputSurfaceTexture.getTimestamp();
|
long presentationTimeNs = inputSurfaceTexture.getTimestamp();
|
||||||
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTextureTimestampNs);
|
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, presentationTimeNs);
|
||||||
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
||||||
|
|
||||||
if (debugPreviewEglSurface != null) {
|
if (debugPreviewEglSurface != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user