Rename FfmpegVideoRenderer to ExperimentalFfmpegVideoRenderer

This makes it clearer that this class can't be used yet.

PiperOrigin-RevId: 571267898
This commit is contained in:
tonihei 2023-10-06 01:47:40 -07:00 committed by Copybara-Service
parent 002ee0555d
commit f8d2e362a5
5 changed files with 13 additions and 11 deletions

View File

@ -36,16 +36,16 @@ import androidx.media3.exoplayer.RendererCapabilities;
import androidx.media3.exoplayer.video.DecoderVideoRenderer;
import androidx.media3.exoplayer.video.VideoRendererEventListener;
// TODO: Remove the NOTE below.
// TODO: Merge actual implementation in https://github.com/google/ExoPlayer/pull/7132.
/**
* <b>NOTE: This class if under development and is not yet functional.</b>
*
* <p>Decodes and renders video using FFmpeg.
*/
@UnstableApi
public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
public final class ExperimentalFfmpegVideoRenderer extends DecoderVideoRenderer {
private static final String TAG = "FfmpegVideoRenderer";
private static final String TAG = "ExperimentalFfmpegVideoRenderer";
/**
* Creates a new instance.
@ -58,7 +58,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
* @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
* invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
*/
public FfmpegVideoRenderer(
public ExperimentalFfmpegVideoRenderer(
long allowedJoiningTimeMs,
@Nullable Handler eventHandler,
@Nullable VideoRendererEventListener eventListener,
@ -75,7 +75,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
@Override
public final @RendererCapabilities.Capabilities int supportsFormat(Format format) {
// TODO: Remove this line and uncomment the implementation below.
return C.FORMAT_UNSUPPORTED_TYPE;
return RendererCapabilities.create(C.FORMAT_UNSUPPORTED_TYPE);
/*
String mimeType = Assertions.checkNotNull(format.sampleMimeType);
if (!FfmpegLibrary.isAvailable() || !MimeTypes.isVideo(mimeType)) {

View File

@ -50,7 +50,8 @@ public final class FfmpegLibrary {
/**
* Override the names of the FFmpeg native libraries. If an application wishes to call this
* method, it must do so before calling any other method defined by this class, and before
* instantiating a {@link FfmpegAudioRenderer} or {@link FfmpegVideoRenderer} instance.
* instantiating a {@link FfmpegAudioRenderer} or {@link ExperimentalFfmpegVideoRenderer}
* instance.
*
* @param libraries The names of the FFmpeg native libraries.
*/

View File

@ -23,7 +23,7 @@ import org.junit.runner.RunWith;
/**
* Unit test for {@link DefaultRenderersFactoryTest} with {@link FfmpegAudioRenderer} and {@link
* FfmpegVideoRenderer}.
* ExperimentalFfmpegVideoRenderer}.
*/
@RunWith(AndroidJUnit4.class)
public final class DefaultRenderersFactoryTest {
@ -37,6 +37,6 @@ public final class DefaultRenderersFactoryTest {
@Test
public void createRenderers_instantiatesFfmpegVideoRenderer() {
DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
FfmpegVideoRenderer.class, C.TRACK_TYPE_VIDEO);
ExperimentalFfmpegVideoRenderer.class, C.TRACK_TYPE_VIDEO);
}
}

View File

@ -9,8 +9,8 @@
-keepclassmembers class androidx.media3.decoder.av1.Libgav1VideoRenderer {
<init>(long, android.os.Handler, androidx.media3.exoplayer.video.VideoRendererEventListener, int);
}
-dontnote androidx.media3.decoder.ffmpeg.FfmpegVideoRenderer
-keepclassmembers class androidx.media3.decoder.ffmpeg.FfmpegVideoRenderer {
-dontnote androidx.media3.decoder.ffmpeg.ExperimentalFfmpegVideoRenderer
-keepclassmembers class androidx.media3.decoder.ffmpeg.ExperimentalFfmpegVideoRenderer {
<init>(long, android.os.Handler, androidx.media3.exoplayer.video.VideoRendererEventListener, int);
}
-dontnote androidx.media3.decoder.opus.LibopusAudioRenderer

View File

@ -407,7 +407,8 @@ public class DefaultRenderersFactory implements RenderersFactory {
try {
// Full class names used for constructor args so the LINT rule triggers if any of them move.
Class<?> clazz = Class.forName("androidx.media3.decoder.ffmpeg.FfmpegVideoRenderer");
Class<?> clazz =
Class.forName("androidx.media3.decoder.ffmpeg.ExperimentalFfmpegVideoRenderer");
Constructor<?> constructor =
clazz.getConstructor(
long.class,