mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Use CapturingRenderersFactory in DashPlaybackTest
PiperOrigin-RevId: 348018409
This commit is contained in:
parent
1327ecad24
commit
0d1dac93c4
2 changed files with 9 additions and 6 deletions
|
|
@ -17,6 +17,7 @@ package com.google.android.exoplayer2.e2etest;
|
||||||
|
|
||||||
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
|
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.graphics.SurfaceTexture;
|
import android.graphics.SurfaceTexture;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
|
|
@ -28,6 +29,7 @@ import com.google.android.exoplayer2.robolectric.PlaybackOutput;
|
||||||
import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig;
|
import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig;
|
||||||
import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper;
|
import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper;
|
||||||
import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock;
|
import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock;
|
||||||
|
import com.google.android.exoplayer2.testutil.CapturingRenderersFactory;
|
||||||
import com.google.android.exoplayer2.testutil.DumpFileAsserts;
|
import com.google.android.exoplayer2.testutil.DumpFileAsserts;
|
||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
|
|
@ -48,12 +50,15 @@ public final class DashPlaybackTest {
|
||||||
// https://github.com/google/ExoPlayer/issues/7985
|
// https://github.com/google/ExoPlayer/issues/7985
|
||||||
@Test
|
@Test
|
||||||
public void webvttInMp4() throws Exception {
|
public void webvttInMp4() throws Exception {
|
||||||
|
Context applicationContext = ApplicationProvider.getApplicationContext();
|
||||||
|
CapturingRenderersFactory capturingRenderersFactory =
|
||||||
|
new CapturingRenderersFactory(applicationContext);
|
||||||
SimpleExoPlayer player =
|
SimpleExoPlayer player =
|
||||||
new SimpleExoPlayer.Builder(ApplicationProvider.getApplicationContext())
|
new SimpleExoPlayer.Builder(applicationContext, capturingRenderersFactory)
|
||||||
.setClock(new AutoAdvancingFakeClock())
|
.setClock(new AutoAdvancingFakeClock())
|
||||||
.build();
|
.build();
|
||||||
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
|
player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */ 1)));
|
||||||
PlaybackOutput playbackOutput = PlaybackOutput.register(player, mediaCodecConfig);
|
PlaybackOutput playbackOutput = PlaybackOutput.register(player, capturingRenderersFactory);
|
||||||
|
|
||||||
// Ensure the subtitle track is selected.
|
// Ensure the subtitle track is selected.
|
||||||
DefaultTrackSelector trackSelector =
|
DefaultTrackSelector trackSelector =
|
||||||
|
|
@ -66,8 +71,6 @@ public final class DashPlaybackTest {
|
||||||
player.release();
|
player.release();
|
||||||
|
|
||||||
DumpFileAsserts.assertOutput(
|
DumpFileAsserts.assertOutput(
|
||||||
ApplicationProvider.getApplicationContext(),
|
applicationContext, playbackOutput, "playbackdumps/dash/webvtt-in-mp4.dump");
|
||||||
playbackOutput,
|
|
||||||
"playbackdumps/dash/webvtt-in-mp4.dump");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
MediaCodec (video/avc):
|
MediaCodecAdapter (exotest.video.avc):
|
||||||
buffers.length = 31
|
buffers.length = 31
|
||||||
buffers[0] = length 36692, hash D216076E
|
buffers[0] = length 36692, hash D216076E
|
||||||
buffers[1] = length 5312, hash D45D3CA0
|
buffers[1] = length 5312, hash D45D3CA0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue