mirror of
https://github.com/androidx/media.git
synced 2025-04-29 14:26:50 +08:00
Remove VideoSinkProvider
PiperOrigin-RevId: 752227606
This commit is contained in:
parent
170098b400
commit
8968d9fa45
@ -125,6 +125,10 @@
|
||||
`Player.seekToNextMediaItem()` instead.
|
||||
* Removed deprecated `BaseAudioProcessor` in `exoplayer` module. Use
|
||||
`BaseAudioProcessor` under `common` module.
|
||||
* Remove deprecated `MediaCodecVideoRenderer` constructor
|
||||
`MediaCodecVideoRenderer(Context, MediaCodecAdapter.Factor,
|
||||
MediaCodecSelector, long, boolean, @Nullable Handler, @Nullable
|
||||
VideoRendererEventListener, int, float, @Nullable VideoSinkProvider)`.
|
||||
|
||||
## 1.6
|
||||
|
||||
|
@ -537,35 +537,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
||||
.setAssumedMinimumCodecOperatingRate(assumedMinimumCodecOperatingRate));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public MediaCodecVideoRenderer(
|
||||
Context context,
|
||||
MediaCodecAdapter.Factory codecAdapterFactory,
|
||||
MediaCodecSelector mediaCodecSelector,
|
||||
long allowedJoiningTimeMs,
|
||||
boolean enableDecoderFallback,
|
||||
@Nullable Handler eventHandler,
|
||||
@Nullable VideoRendererEventListener eventListener,
|
||||
int maxDroppedFramesToNotify,
|
||||
float assumedMinimumCodecOperatingRate,
|
||||
@Nullable VideoSinkProvider videoSinkProvider) {
|
||||
this(
|
||||
new Builder(context)
|
||||
.setMediaCodecSelector(mediaCodecSelector)
|
||||
.setCodecAdapterFactory(codecAdapterFactory)
|
||||
.setAllowedJoiningTimeMs(allowedJoiningTimeMs)
|
||||
.setEnableDecoderFallback(enableDecoderFallback)
|
||||
.setEventHandler(eventHandler)
|
||||
.setEventListener(eventListener)
|
||||
.setMaxDroppedFramesToNotify(maxDroppedFramesToNotify)
|
||||
.setAssumedMinimumCodecOperatingRate(assumedMinimumCodecOperatingRate)
|
||||
.setVideoSink(
|
||||
videoSinkProvider == null ? null : videoSinkProvider.getSink(/* inputIndex= */ 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
*/
|
||||
@UnstableApi
|
||||
@RestrictTo({Scope.LIBRARY_GROUP})
|
||||
public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, VideoGraph.Listener {
|
||||
public final class PlaybackVideoGraphWrapper implements VideoGraph.Listener {
|
||||
|
||||
/** Listener for {@link PlaybackVideoGraphWrapper} events. */
|
||||
public interface Listener {
|
||||
@ -400,19 +400,12 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
||||
this.totalVideoInputCount = totalVideoInputCount;
|
||||
}
|
||||
|
||||
/** Starts rendering to the output surface. */
|
||||
public void startRendering() {
|
||||
defaultVideoSink.startRendering();
|
||||
}
|
||||
|
||||
/** Stops rendering to the output surface. */
|
||||
public void stopRendering() {
|
||||
defaultVideoSink.stopRendering();
|
||||
}
|
||||
|
||||
// VideoSinkProvider methods
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Returns the {@link VideoSink} to forward video frames for processing.
|
||||
*
|
||||
* @param inputIndex The index of the {@link VideoSink}.
|
||||
* @return The {@link VideoSink} at the given index.
|
||||
*/
|
||||
public VideoSink getSink(int inputIndex) {
|
||||
if (contains(inputVideoSinks, inputIndex)) {
|
||||
return inputVideoSinks.get(inputIndex);
|
||||
@ -425,7 +418,7 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
||||
return inputVideoSink;
|
||||
}
|
||||
|
||||
@Override
|
||||
/** Sets the output surface info. */
|
||||
public void setOutputSurfaceInfo(Surface outputSurface, Size outputResolution) {
|
||||
if (currentSurfaceAndSize != null
|
||||
&& currentSurfaceAndSize.first.equals(outputSurface)
|
||||
@ -437,7 +430,7 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
||||
outputSurface, outputResolution.getWidth(), outputResolution.getHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
/** Clears the set output surface info. */
|
||||
public void clearOutputSurfaceInfo() {
|
||||
maybeSetOutputSurfaceInfo(
|
||||
/* surface= */ null,
|
||||
@ -446,7 +439,17 @@ public final class PlaybackVideoGraphWrapper implements VideoSinkProvider, Video
|
||||
currentSurfaceAndSize = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
/** Starts rendering to the output surface. */
|
||||
public void startRendering() {
|
||||
defaultVideoSink.startRendering();
|
||||
}
|
||||
|
||||
/** Stops rendering to the output surface. */
|
||||
public void stopRendering() {
|
||||
defaultVideoSink.stopRendering();
|
||||
}
|
||||
|
||||
/** Releases the sink provider. */
|
||||
public void release() {
|
||||
if (state == STATE_RELEASED) {
|
||||
return;
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.media3.exoplayer.video;
|
||||
|
||||
import android.view.Surface;
|
||||
import androidx.media3.common.util.Size;
|
||||
|
||||
/** A provider of {@link VideoSink VideoSinks}. */
|
||||
/* package */ interface VideoSinkProvider {
|
||||
|
||||
/**
|
||||
* Returns the {@link VideoSink} to forward video frames for processing.
|
||||
*
|
||||
* @param inputIndex The index of the {@link VideoSink}.
|
||||
* @return The {@link VideoSink} at the given index.
|
||||
*/
|
||||
VideoSink getSink(int inputIndex);
|
||||
|
||||
/** Sets the output surface info. */
|
||||
void setOutputSurfaceInfo(Surface outputSurface, Size outputResolution);
|
||||
|
||||
/** Clears the set output surface info. */
|
||||
void clearOutputSurfaceInfo();
|
||||
|
||||
/** Releases the sink provider. */
|
||||
void release();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user