Fix flaky test becasue ExtTexMgr is not using emulator settings

When running on emulators, ExternalTextureManager needs a longer timeout for
forcing EOS, but we didn't catch a device name running on blaze: `generic_x86`

PiperOrigin-RevId: 565513152
This commit is contained in:
claincly 2023-09-14 16:42:43 -07:00 committed by Copybara-Service
parent c77b8c8479
commit fef16b05d9

View File

@ -30,6 +30,7 @@ import androidx.media3.common.util.GlUtil;
import androidx.media3.common.util.Log; import androidx.media3.common.util.Log;
import androidx.media3.common.util.Util; import androidx.media3.common.util.Util;
import androidx.media3.effect.GlShaderProgram.InputListener; import androidx.media3.effect.GlShaderProgram.InputListener;
import com.google.common.base.Ascii;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Future; import java.util.concurrent.Future;
@ -55,7 +56,10 @@ import java.util.concurrent.atomic.AtomicInteger;
* pressured the decoder, and the decoder is not able to decode another frame. * pressured the decoder, and the decoder is not able to decode another frame.
*/ */
private static final long SURFACE_TEXTURE_TIMEOUT_MS = private static final long SURFACE_TEXTURE_TIMEOUT_MS =
Util.DEVICE.contains("emulator") ? 10_000 : 500; Ascii.toLowerCase(Util.DEVICE).contains("emulator")
|| Ascii.toLowerCase(Util.DEVICE).contains("generic")
? 10_000
: 500;
private final GlObjectsProvider glObjectsProvider; private final GlObjectsProvider glObjectsProvider;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor; private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;