mirror of
https://github.com/androidx/media.git
synced 2025-05-09 08:30:43 +08:00
Use CapturingRenderersFactory in OggPlaybackTest
PiperOrigin-RevId: 348016819
This commit is contained in:
parent
6a89027f56
commit
fe5176c009
@ -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;
|
||||
@ -55,11 +57,14 @@ public final class OggPlaybackTest {
|
||||
|
||||
@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/ogg/" + inputFile));
|
||||
player.prepare();
|
||||
@ -68,8 +73,6 @@ public final class OggPlaybackTest {
|
||||
player.release();
|
||||
|
||||
DumpFileAsserts.assertOutput(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
playbackOutput,
|
||||
"playbackdumps/ogg/" + inputFile + ".dump");
|
||||
applicationContext, playbackOutput, "playbackdumps/ogg/" + inputFile + ".dump");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
MediaCodec (audio/opus):
|
||||
MediaCodecAdapter (exotest.audio.opus):
|
||||
buffers.length = 276
|
||||
buffers[0] = length 234, hash B77BFFDA
|
||||
buffers[1] = length 165, hash F7B07C35
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
MediaCodec (audio/vorbis):
|
||||
MediaCodecAdapter (exotest.audio.vorbis):
|
||||
buffers.length = 181
|
||||
buffers[0] = length 49, hash 2FFF94F0
|
||||
buffers[1] = length 44, hash 3946418A
|
||||
|
@ -1,4 +1,4 @@
|
||||
MediaCodec (audio/vorbis):
|
||||
MediaCodecAdapter (exotest.audio.vorbis):
|
||||
buffers.length = 181
|
||||
buffers[0] = length 49, hash 2FFF94F0
|
||||
buffers[1] = length 44, hash 3946418A
|
||||
|
@ -1,4 +1,4 @@
|
||||
MediaCodec (audio/vorbis):
|
||||
MediaCodecAdapter (exotest.audio.vorbis):
|
||||
buffers.length = 181
|
||||
buffers[0] = length 49, hash 2FFF94F0
|
||||
buffers[1] = length 44, hash 3946418A
|
||||
|
Loading…
x
Reference in New Issue
Block a user