Delete created GL programs

PiperOrigin-RevId: 554832238
This commit is contained in:
kimvde 2023-08-08 15:27:26 +00:00 committed by Tianyi Feng
parent 57086b6641
commit 5c78290d5a
3 changed files with 32 additions and 0 deletions

View File

@ -17,6 +17,7 @@ package androidx.media3.effect;
import android.content.Context;
import android.opengl.GLES20;
import androidx.annotation.CallSuper;
import androidx.media3.common.GlTextureInfo;
import androidx.media3.common.VideoFrameProcessingException;
import androidx.media3.common.util.GlProgram;
@ -82,4 +83,15 @@ import java.io.IOException;
throw VideoFrameProcessingException.from(e);
}
}
@Override
@CallSuper
public void release() throws VideoFrameProcessingException {
super.release();
try {
copyProgram.delete();
} catch (GlUtil.GlException e) {
throw new VideoFrameProcessingException(e);
}
}
}

View File

@ -91,4 +91,14 @@ import java.io.IOException;
throw new VideoFrameProcessingException(e, presentationTimeUs);
}
}
@Override
public void release() throws VideoFrameProcessingException {
super.release();
try {
glProgram.delete();
} catch (GlUtil.GlException e) {
throw new VideoFrameProcessingException(e);
}
}
}

View File

@ -86,4 +86,14 @@ import java.io.IOException;
throw new VideoFrameProcessingException(e, presentationTimeUs);
}
}
@Override
public void release() throws VideoFrameProcessingException {
super.release();
try {
glProgram.delete();
} catch (GlUtil.GlException e) {
throw new VideoFrameProcessingException(e);
}
}
}