Release BitmapTextureManager resources

PiperOrigin-RevId: 525434071
This commit is contained in:
tofunmi 2023-04-19 14:47:20 +01:00 committed by Rohit Singh
parent ec45c0d441
commit 9406410c48
2 changed files with 17 additions and 0 deletions

View File

@ -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.
private void setupBitmap(Bitmap bitmap, long durationUs, float frameRate, boolean useHdr)

View File

@ -410,6 +410,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
if (inputExternalTextureManager != null) {
inputExternalTextureManager.release();
}
if (inputBitmapTextureManager != null) {
inputBitmapTextureManager.release();
}
}
/**