Commit 1327ecad by ibaker Committed by Oliver Woodman

Use CapturingRenderersFactory in Vp9PlaybackTest

PiperOrigin-RevId: 348017841
parent 27e290e7
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.e2etest; package com.google.android.exoplayer2.e2etest;
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;
...@@ -25,6 +26,7 @@ import com.google.android.exoplayer2.robolectric.PlaybackOutput; ...@@ -25,6 +26,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.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.junit.Rule; import org.junit.Rule;
...@@ -56,12 +58,15 @@ public final class Vp9PlaybackTest { ...@@ -56,12 +58,15 @@ public final class Vp9PlaybackTest {
@Test @Test
public void test() throws Exception { public void test() 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);
player.setMediaItem(MediaItem.fromUri("asset:///media/vp9/" + inputFile)); player.setMediaItem(MediaItem.fromUri("asset:///media/vp9/" + inputFile));
player.prepare(); player.prepare();
...@@ -70,8 +75,6 @@ public final class Vp9PlaybackTest { ...@@ -70,8 +75,6 @@ public final class Vp9PlaybackTest {
player.release(); player.release();
DumpFileAsserts.assertOutput( DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(), applicationContext, playbackOutput, "playbackdumps/vp9/" + inputFile + ".dump");
playbackOutput,
"playbackdumps/vp9/" + inputFile + ".dump");
} }
} }
MediaCodec (video/x-vnd.on2.vp9): MediaCodecAdapter (exotest.video.vp9):
buffers.length = 31 buffers.length = 31
buffers[0] = length 10658, hash E48B4B1D buffers[0] = length 10658, hash E48B4B1D
buffers[1] = length 5866, hash 59922F8F buffers[1] = length 5866, hash 59922F8F
......
MediaCodec (video/x-vnd.on2.vp9): MediaCodecAdapter (exotest.video.vp9):
buffers.length = 83 buffers.length = 83
buffers[0] = length 3792, hash 70319132 buffers[0] = length 3792, hash 70319132
buffers[1] = length 64, hash 2661DD32 buffers[1] = length 64, hash 2661DD32
......
MediaCodec (video/x-vnd.on2.vp9): MediaCodecAdapter (exotest.video.vp9):
buffers.length = 52 buffers.length = 52
buffers[0] = length 17828, hash 64E34D2F buffers[0] = length 17828, hash 64E34D2F
buffers[1] = length 51, hash 5A1B8385 buffers[1] = length 51, hash 5A1B8385
......
MediaCodec (video/x-vnd.on2.vp9): MediaCodecAdapter (exotest.video.vp9):
buffers.length = 81 buffers.length = 81
buffers[0] = length 2673, hash 35AEF916 buffers[0] = length 2673, hash 35AEF916
buffers[1] = length 5013, hash 3F74CFB8 buffers[1] = length 5013, hash 3F74CFB8
......
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