mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Composition preview: do not report errors on release
PiperOrigin-RevId: 611096895
This commit is contained in:
parent
09ac916119
commit
55bfe4f95c
1 changed files with 4 additions and 1 deletions
|
|
@ -144,6 +144,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final VideoSinkProvider videoSinkProvider;
|
private final VideoSinkProvider videoSinkProvider;
|
||||||
|
private final boolean ownsVideoSinkProvider;
|
||||||
private final EventDispatcher eventDispatcher;
|
private final EventDispatcher eventDispatcher;
|
||||||
private final int maxDroppedFramesToNotify;
|
private final int maxDroppedFramesToNotify;
|
||||||
private final boolean deviceNeedsNoPostProcessWorkaround;
|
private final boolean deviceNeedsNoPostProcessWorkaround;
|
||||||
|
|
@ -393,9 +394,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||||
this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
|
this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
|
||||||
this.context = context.getApplicationContext();
|
this.context = context.getApplicationContext();
|
||||||
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
|
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
|
||||||
|
ownsVideoSinkProvider = videoSinkProvider == null;
|
||||||
if (videoSinkProvider == null) {
|
if (videoSinkProvider == null) {
|
||||||
videoSinkProvider = new CompositingVideoSinkProvider.Builder(this.context).build();
|
videoSinkProvider = new CompositingVideoSinkProvider.Builder(this.context).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (videoSinkProvider.getVideoFrameReleaseControl() == null) {
|
if (videoSinkProvider.getVideoFrameReleaseControl() == null) {
|
||||||
@SuppressWarnings("nullness:assignment")
|
@SuppressWarnings("nullness:assignment")
|
||||||
VideoFrameReleaseControl.@Initialized FrameTimingEvaluator thisRef = this;
|
VideoFrameReleaseControl.@Initialized FrameTimingEvaluator thisRef = this;
|
||||||
|
|
@ -730,7 +733,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||||
@Override
|
@Override
|
||||||
protected void onRelease() {
|
protected void onRelease() {
|
||||||
super.onRelease();
|
super.onRelease();
|
||||||
if (videoSinkProvider.isInitialized()) {
|
if (ownsVideoSinkProvider && videoSinkProvider.isInitialized()) {
|
||||||
videoSinkProvider.release();
|
videoSinkProvider.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue