Commit 0d1dac93 by ibaker Committed by Oliver Woodman

Use CapturingRenderersFactory in DashPlaybackTest

PiperOrigin-RevId: 348018409
parent 1327ecad
...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest; ...@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
...@@ -28,6 +29,7 @@ import com.google.android.exoplayer2.robolectric.PlaybackOutput; ...@@ -28,6 +29,7 @@ import com.google.android.exoplayer2.robolectric.PlaybackOutput;
import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig; import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig;
import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper; import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper;
import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock; import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock;
import com.google.android.exoplayer2.testutil.CapturingRenderersFactory;
import com.google.android.exoplayer2.testutil.DumpFileAsserts; import com.google.android.exoplayer2.testutil.DumpFileAsserts;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import org.junit.Rule; import org.junit.Rule;
...@@ -48,12 +50,15 @@ public final class DashPlaybackTest { ...@@ -48,12 +50,15 @@ public final class DashPlaybackTest {
// https://github.com/google/ExoPlayer/issues/7985 // https://github.com/google/ExoPlayer/issues/7985
@Test @Test
public void webvttInMp4() throws Exception { public void webvttInMp4() throws Exception {
Context applicationContext = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player = SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext()) new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new AutoAdvancingFakeClock()) .setClock(new AutoAdvancingFakeClock())
.build(); .build();
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1))); player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
PlaybackOutput playbackOutput = PlaybackOutput.register(player, mediaCodecConfig); PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
// Ensure the subtitle track is selected. // Ensure the subtitle track is selected.
DefaultTrackSelector trackSelector = DefaultTrackSelector trackSelector =
...@@ -66,8 +71,6 @@ public final class DashPlaybackTest { ...@@ -66,8 +71,6 @@ public final class DashPlaybackTest {
player.release(); player.release();
DumpFileAsserts.assertOutput( DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(), applicationContext, playbackOutput, "playbackdumps/dash/webvtt-in-mp4.dump");
playbackOutput,
"playbackdumps/dash/webvtt-in-mp4.dump");
} }
} }
MediaCodec (video/avc): MediaCodecAdapter (exotest.video.avc):
buffers.length = 31 buffers.length = 31
buffers[0] = length 36692, hash D216076E buffers[0] = length 36692, hash D216076E
buffers[1] = length 5312, hash D45D3CA0 buffers[1] = length 5312, hash D45D3CA0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment