mirror of
https://github.com/samsonjs/media.git
synced 2026-04-06 11:25:46 +00:00
Release BitmapTextureManager resources
PiperOrigin-RevId: 525434071
This commit is contained in:
parent
ec45c0d441
commit
9406410c48
2 changed files with 17 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -410,6 +410,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
|
|||
if (inputExternalTextureManager != null) {
|
||||
inputExternalTextureManager.release();
|
||||
}
|
||||
if (inputBitmapTextureManager != null) {
|
||||
inputBitmapTextureManager.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue