Commit 5ebbe320 by tofunmi Committed by Rohit Singh

Release BitmapTextureManager resources

PiperOrigin-RevId: 525434071
parent 9ca440eb
...@@ -99,6 +99,20 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -99,6 +99,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)
......
...@@ -408,6 +408,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -408,6 +408,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