mirror of
https://github.com/samsonjs/media.git
synced 2026-06-28 05:29:33 +00:00
Use CapturingRenderersFactory in Vp9PlaybackTest
PiperOrigin-RevId: 348017841
This commit is contained in:
parent
27e290e701
commit
1327ecad24
5 changed files with 12 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
@ -56,12 +58,15 @@ public final class Vp9PlaybackTest {
|
|||
|
||||
@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/vp9/" + inputFile));
|
||||
player.prepare();
|
||||
|
|
@ -70,8 +75,6 @@ public final class Vp9PlaybackTest {
|
|||
player.release();
|
||||
|
||||
DumpFileAsserts.assertOutput(
|
||||
ApplicationProvider.getApplicationContext(),
|
||||
playbackOutput,
|
||||
"playbackdumps/vp9/" + inputFile + ".dump");
|
||||
applicationContext, playbackOutput, "playbackdumps/vp9/" + inputFile + ".dump");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (video/x-vnd.on2.vp9):
|
||||
MediaCodecAdapter (exotest.video.vp9):
|
||||
buffers.length = 31
|
||||
buffers[0] = length 10658, hash E48B4B1D
|
||||
buffers[1] = length 5866, hash 59922F8F
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (video/x-vnd.on2.vp9):
|
||||
MediaCodecAdapter (exotest.video.vp9):
|
||||
buffers.length = 83
|
||||
buffers[0] = length 3792, hash 70319132
|
||||
buffers[1] = length 64, hash 2661DD32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (video/x-vnd.on2.vp9):
|
||||
MediaCodecAdapter (exotest.video.vp9):
|
||||
buffers.length = 52
|
||||
buffers[0] = length 17828, hash 64E34D2F
|
||||
buffers[1] = length 51, hash 5A1B8385
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
MediaCodec (video/x-vnd.on2.vp9):
|
||||
MediaCodecAdapter (exotest.video.vp9):
|
||||
buffers.length = 81
|
||||
buffers[0] = length 2673, hash 35AEF916
|
||||
buffers[1] = length 5013, hash 3F74CFB8
|
||||
|
|
|
|||
Loading…
Reference in a new issue