Add release method to VideoSink

PiperOrigin-RevId: 630958612
This commit is contained in:
kimvde 2024-05-06 00:58:59 -07:00 committed by Copybara-Service
parent 8a8dfbed71
commit 6add3a1dba
3 changed files with 9 additions and 1 deletions

View File

@ -764,6 +764,11 @@ public final class CompositingVideoSinkProvider
}
}
@Override
public void release() {
CompositingVideoSinkProvider.this.release();
}
// Other methods
/** Sets the {@linkplain Effect video effects}. */

View File

@ -734,7 +734,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
protected void onRelease() {
super.onRelease();
if (ownsVideoSinkProvider) {
videoSinkProvider.release();
videoSink.release();
}
}

View File

@ -212,4 +212,7 @@ public interface VideoSink {
* @throws VideoSinkException If an error occurs during rendering.
*/
void render(long positionUs, long elapsedRealtimeUs) throws VideoSinkException;
/** Releases the sink. */
void release();
}