This commit is contained in:
Romain Vimont 2025-01-07 22:01:12 +01:00
parent c27d116a66
commit 139b3e688a
2 changed files with 18 additions and 8 deletions

View File

@ -193,14 +193,20 @@ public final class OpenGLRunner {
filter.init();
surfaceTexture.setOnFrameAvailableListener(surfaceTexture -> {
if (stopped) {
// Make sure to never render after resources have been released
return;
}
Runnable runnable = new Runnable() {
@Override public void run() {
if (stopped) {
// Make sure to never render after resources have been released
return;
}
render(outputSize);
}, handler);
render(outputSize);
handler.postDelayed(this, 15);
}
};
handler.post(runnable);
}
private void render(Size outputSize) {
@ -219,7 +225,7 @@ public final class OpenGLRunner {
filter.draw(textureId, matrix);
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTexture.getTimestamp());
//EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTexture.getTimestamp());
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
}

View File

@ -111,6 +111,10 @@ public class ScreenCapture extends SurfaceCapture {
virtualDisplay = null;
}
if (transform == null) {
transform = AffineMatrix.IDENTITY;
}
Size inputSize;
if (transform != null) {
// If there is a filter, it must receive the full display content