Commit 5bfa8185 by ibaker Committed by Oliver Woodman

Use CapturingRenderersFactory in FlvPlaybackTest

PiperOrigin-RevId: 348014814
parent 3bf5e6b0
...@@ -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;
...@@ -52,12 +54,15 @@ public final class FlvPlaybackTest { ...@@ -52,12 +54,15 @@ public final class FlvPlaybackTest {
@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/flv/" + inputFile)); player.setMediaItem(MediaItem.fromUri("asset:///media/flv/" + inputFile));
player.prepare(); player.prepare();
...@@ -66,8 +71,6 @@ public final class FlvPlaybackTest { ...@@ -66,8 +71,6 @@ public final class FlvPlaybackTest {
player.release(); player.release();
DumpFileAsserts.assertOutput( DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(), applicationContext, playbackOutput, "playbackdumps/flv/" + inputFile + ".dump");
playbackOutput,
"playbackdumps/flv/" + inputFile + ".dump");
} }
} }
MediaCodec (video/avc): MediaCodecAdapter (exotest.video.avc):
buffers.length = 72 buffers.length = 72
buffers[0] = length 747, hash 59AEB08 buffers[0] = length 747, hash 59AEB08
buffers[1] = length 117, hash 57A315CB buffers[1] = length 117, hash 57A315CB
......
MediaCodec (audio/mp4a-latm): MediaCodecAdapter (exotest.audio.aac):
buffers.length = 46 buffers.length = 46
buffers[0] = length 23, hash 47DE9131 buffers[0] = length 23, hash 47DE9131
buffers[1] = length 6, hash 31EC5206 buffers[1] = length 6, hash 31EC5206
...@@ -46,7 +46,7 @@ MediaCodec (audio/mp4a-latm): ...@@ -46,7 +46,7 @@ MediaCodec (audio/mp4a-latm):
buffers[43] = length 229, hash FFF98DF0 buffers[43] = length 229, hash FFF98DF0
buffers[44] = length 6, hash 31B22286 buffers[44] = length 6, hash 31B22286
buffers[45] = length 0, hash 1 buffers[45] = length 0, hash 1
MediaCodec (video/avc): MediaCodecAdapter (exotest.video.avc):
buffers.length = 31 buffers.length = 31
buffers[0] = length 36477, hash F0F36CFE buffers[0] = length 36477, hash F0F36CFE
buffers[1] = length 5341, hash 40B85E2 buffers[1] = length 5341, hash 40B85E2
......
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