Commit 23776654 by ibaker Committed by Oliver Woodman

Use CapturingRenderersFactory in MkaPlaybackTest

PiperOrigin-RevId: 348015304
parent 5bfa8185
......@@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.e2etest;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player;
......@@ -23,6 +24,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;
......@@ -54,11 +56,14 @@ public final class MkaPlaybackTest {
@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();
PlaybackOutput playbackOutput = PlaybackOutput.register(player, mediaCodecConfig);
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
player.setMediaItem(MediaItem.fromUri("asset:///media/mka/" + inputFile));
player.prepare();
......@@ -67,8 +72,6 @@ public final class MkaPlaybackTest {
player.release();
DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(),
playbackOutput,
"playbackdumps/mka/" + inputFile + ".dump");
applicationContext, playbackOutput, "playbackdumps/mka/" + inputFile + ".dump");
}
}
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 30
buffers[0] = length 3608, hash EE7EFC6C
buffers[1] = length 4278, hash 7BAF8A9
......
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 30
buffers[0] = length 3610, hash C0423D1B
buffers[1] = length 4280, hash 2E8BEA95
......
MediaCodec (audio/opus):
MediaCodecAdapter (exotest.audio.opus):
buffers.length = 138
buffers[0] = length 375, hash 147EA9B
buffers[1] = length 187, hash C8ADD7C2
......
MediaCodec (audio/opus):
MediaCodecAdapter (exotest.audio.opus):
buffers.length = 138
buffers[0] = length 375, hash 147EA9B
buffers[1] = length 187, hash C8ADD7C2
......
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