Add surface setters on VideoSink
PiperOrigin-RevId: 631025710
This commit is contained in:
parent
506944dcfd
commit
a03f30bea9
@ -687,6 +687,16 @@ public final class CompositingVideoSinkProvider
|
||||
inputStreamOffsetUs = streamOffsetUs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOutputSurfaceInfo(Surface outputSurface, Size outputResolution) {
|
||||
CompositingVideoSinkProvider.this.setOutputSurfaceInfo(outputSurface, outputResolution);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearOutputSurfaceInfo() {
|
||||
CompositingVideoSinkProvider.this.clearOutputSurfaceInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long registerInputFrame(long framePresentationTimeUs, boolean isLastFrame) {
|
||||
checkState(isInitialized());
|
||||
|
@ -776,8 +776,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
case MSG_SET_VIDEO_OUTPUT_RESOLUTION:
|
||||
Size outputResolution = (Size) checkNotNull(message);
|
||||
if (outputResolution.getWidth() != 0 && outputResolution.getHeight() != 0) {
|
||||
videoSinkProvider.setOutputSurfaceInfo(
|
||||
checkStateNotNull(displaySurface), outputResolution);
|
||||
videoSink.setOutputSurfaceInfo(checkStateNotNull(displaySurface), outputResolution);
|
||||
}
|
||||
break;
|
||||
case MSG_SET_PRIORITY:
|
||||
@ -838,7 +837,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
} else {
|
||||
// The display surface has been removed.
|
||||
reportedVideoSize = null;
|
||||
videoSinkProvider.clearOutputSurfaceInfo();
|
||||
videoSink.clearOutputSurfaceInfo();
|
||||
}
|
||||
maybeSetupTunnelingForFirstFrame();
|
||||
} else if (displaySurface != null && displaySurface != placeholderSurface) {
|
||||
|
@ -26,6 +26,7 @@ import androidx.media3.common.Effect;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.VideoSize;
|
||||
import androidx.media3.common.util.Clock;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.common.util.TimestampIterator;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import java.lang.annotation.Documented;
|
||||
@ -175,6 +176,12 @@ public interface VideoSink {
|
||||
*/
|
||||
void setStreamOffsetUs(long streamOffsetUs);
|
||||
|
||||
/** Sets the output surface info. */
|
||||
void setOutputSurfaceInfo(Surface outputSurface, Size outputResolution);
|
||||
|
||||
/** Clears the set output surface info. */
|
||||
void clearOutputSurfaceInfo();
|
||||
|
||||
/**
|
||||
* Informs the video sink that a new input stream will be queued.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user