mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix test failuer on real-device
In the previous CL, muxer timeout is set to the surface timeout, which is incorrect. PiperOrigin-RevId: 650203505
This commit is contained in:
parent
58ff8fa3c2
commit
d0a29400ea
@ -21,6 +21,7 @@ import static androidx.media3.transformer.AndroidTestUtil.FORCE_TRANSCODE_VIDEO_
|
|||||||
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET;
|
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET;
|
||||||
import static androidx.media3.transformer.AndroidTestUtil.assumeFormatsSupported;
|
import static androidx.media3.transformer.AndroidTestUtil.assumeFormatsSupported;
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static java.lang.Math.max;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.MediaCodec;
|
import android.media.MediaCodec;
|
||||||
@ -56,6 +57,8 @@ public class ForceEndOfStreamTest {
|
|||||||
|
|
||||||
// Referenced from ExternalTextureManager
|
// Referenced from ExternalTextureManager
|
||||||
private static final long SURFACE_TEXTURE_TIMEOUT_MS = isRunningOnEmulator() ? 20_000 : 500;
|
private static final long SURFACE_TEXTURE_TIMEOUT_MS = isRunningOnEmulator() ? 20_000 : 500;
|
||||||
|
private static final long MUXER_MAX_DELAYS_BETWEEN_SAMPLES_MS =
|
||||||
|
max(SURFACE_TEXTURE_TIMEOUT_MS, Transformer.DEFAULT_MAX_DELAY_BETWEEN_MUXER_SAMPLES_MS);
|
||||||
private final Context context = ApplicationProvider.getApplicationContext();
|
private final Context context = ApplicationProvider.getApplicationContext();
|
||||||
@Rule public final TestName testName = new TestName();
|
@Rule public final TestName testName = new TestName();
|
||||||
|
|
||||||
@ -128,7 +131,7 @@ public class ForceEndOfStreamTest {
|
|||||||
context,
|
context,
|
||||||
new FrameDroppingDecoderFactory(context, MP4_ASSET.videoFrameCount, framesToSkip),
|
new FrameDroppingDecoderFactory(context, MP4_ASSET.videoFrameCount, framesToSkip),
|
||||||
Clock.DEFAULT))
|
Clock.DEFAULT))
|
||||||
.setMaxDelayBetweenMuxerSamplesMs(SURFACE_TEXTURE_TIMEOUT_MS)
|
.setMaxDelayBetweenMuxerSamplesMs(MUXER_MAX_DELAYS_BETWEEN_SAMPLES_MS)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user