Use CapturingRenderersFactory in FlacPlaybackTest

PiperOrigin-RevId: 348014322
This commit is contained in:
ibaker 2020-12-17 15:02:45 +00:00 committed by Oliver Woodman
parent 6b43f1566f
commit 3bf5e6b0e4
10 changed files with 17 additions and 14 deletions

View File

@ -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;
@ -61,11 +63,14 @@ public class FlacPlaybackTest {
@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/flac/" + inputFile));
player.prepare();
@ -74,8 +79,6 @@ public class FlacPlaybackTest {
player.release();
DumpFileAsserts.assertOutput(
ApplicationProvider.getApplicationContext(),
playbackOutput,
"playbackdumps/flac/" + inputFile + ".dump");
applicationContext, playbackOutput, "playbackdumps/flac/" + inputFile + ".dump");
}
}

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 28
buffers[0] = length 5415, hash 915DBC66
buffers[1] = length 5529, hash EFD564F7

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54

View File

@ -1,4 +1,4 @@
MediaCodec (audio/flac):
MediaCodecAdapter (exotest.audio.flac):
buffers.length = 34
buffers[0] = length 5030, hash D2B60530
buffers[1] = length 5066, hash 4C932A54