mirror of
https://github.com/samsonjs/media.git
synced 2026-04-08 11:45:51 +00:00
Use CapturingRenderersFactory in MkaPlaybackTest
PiperOrigin-RevId: 348015304
This commit is contained in:
parent
5bfa818533
commit
237766548c
5 changed files with 12 additions and 9 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (audio/flac):
|
||||
MediaCodecAdapter (exotest.audio.flac):
|
||||
buffers.length = 30
|
||||
buffers[0] = length 3608, hash EE7EFC6C
|
||||
buffers[1] = length 4278, hash 7BAF8A9
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (audio/flac):
|
||||
MediaCodecAdapter (exotest.audio.flac):
|
||||
buffers.length = 30
|
||||
buffers[0] = length 3610, hash C0423D1B
|
||||
buffers[1] = length 4280, hash 2E8BEA95
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (audio/opus):
|
||||
MediaCodecAdapter (exotest.audio.opus):
|
||||
buffers.length = 138
|
||||
buffers[0] = length 375, hash 147EA9B
|
||||
buffers[1] = length 187, hash C8ADD7C2
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (audio/opus):
|
||||
MediaCodecAdapter (exotest.audio.opus):
|
||||
buffers.length = 138
|
||||
buffers[0] = length 375, hash 147EA9B
|
||||
buffers[1] = length 187, hash C8ADD7C2
|
||||
|
|
|
|||
Loading…
Reference in a new issue