Use CapturingRenderersFactory in FlvPlaybackTest

PiperOrigin-RevId: 348014814
This commit is contained in:
ibaker 2020-12-17 15:06:19 +00:00 committed by Oliver Woodman
parent 3bf5e6b0e4
commit 5bfa818533
3 changed files with 11 additions and 8 deletions

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.e2etest;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.view.Surface;
import androidx.test.core.app.ApplicationProvider;
@ -25,6 +26,7 @@ import com.google.android.exoplayer2.robolectric.PlaybackOutput;
import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig;
import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper;
import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock;
import com.google.android.exoplayer2.testutil.CapturingRenderersFactory;
import com.google.android.exoplayer2.testutil.DumpFileAsserts;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
@ -52,12 +54,15 @@ public final class FlvPlaybackTest {
@Test
public void test() throws Exception {
Context applicationContext = ApplicationProvider.getApplicationContext();
CapturingRenderersFactory capturingRenderersFactory =
new CapturingRenderersFactory(applicationContext);
SimpleExoPlayer player =
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext())
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory)
.setClock(new AutoAdvancingFakeClock())
.build();
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.prepare();
@ -66,8 +71,6 @@ public final class FlvPlaybackTest {
player.release();
DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(),
playbackOutput,
"playbackdumps/flv/" + inputFile + ".dump");
applicationContext, playbackOutput, "playbackdumps/flv/" + inputFile + ".dump");
}
}

View file

@ -1,4 +1,4 @@
MediaCodec (video/avc):
MediaCodecAdapter (exotest.video.avc):
buffers.length = 72
buffers[0] = length 747, hash 59AEB08
buffers[1] = length 117, hash 57A315CB

View file

@ -1,4 +1,4 @@
MediaCodec (audio/mp4a-latm):
MediaCodecAdapter (exotest.audio.aac):
buffers.length = 46
buffers[0] = length 23, hash 47DE9131
buffers[1] = length 6, hash 31EC5206
@ -46,7 +46,7 @@ MediaCodec (audio/mp4a-latm):
buffers[43] = length 229, hash FFF98DF0
buffers[44] = length 6, hash 31B22286
buffers[45] = length 0, hash 1
MediaCodec (video/avc):
MediaCodecAdapter (exotest.video.avc):
buffers.length = 31
buffers[0] = length 36477, hash F0F36CFE
buffers[1] = length 5341, hash 40B85E2