Commit 9406410c by tofunmi Committed by Rohit Singh

Release BitmapTextureManager resources

PiperOrigin-RevId: 525434071
parent ec45c0d4
...@@ -101,6 +101,20 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -101,6 +101,20 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}); });
} }
/**
* Releases all resources.
*
* @see VideoFrameProcessor#release()
*/
public void release() {
videoFrameProcessingTaskExecutor.submit(
() -> {
if (currentGlTextureInfo != null) {
GlUtil.deleteTexture(currentGlTextureInfo.texId);
}
});
}
// Methods that must be called on the GL thread. // Methods that must be called on the GL thread.
private void setupBitmap(Bitmap bitmap, long durationUs, float frameRate, boolean useHdr) private void setupBitmap(Bitmap bitmap, long durationUs, float frameRate, boolean useHdr)
......
...@@ -410,6 +410,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -410,6 +410,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
if (inputExternalTextureManager != null) { if (inputExternalTextureManager != null) {
inputExternalTextureManager.release(); inputExternalTextureManager.release();
} }
if (inputBitmapTextureManager != null) {
inputBitmapTextureManager.release();
}
} }
/** /**
......
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