scrcpy/server
Romain Vimont c0a75ca746 Downscale and retry also on early MediaCodec error
The new retry mechanism with a lower definition only worked if the error
occurred during encode(). For example:

    java.lang.IllegalStateException
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452)
        at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:114)
        at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:95)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:61)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
        at com.genymobile.scrcpy.Server.main(Server.java:255)

However, MediaCodec may also fail before encoding, during configure() or
start(). For example:

    android.media.MediaCodec$CodecException: Error 0xfffffc0e
        at android.media.MediaCodec.native_configure(Native Method)
        at android.media.MediaCodec.configure(MediaCodec.java:1956)
        at android.media.MediaCodec.configure(MediaCodec.java:1885)
        at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:158)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:68)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:28)
        at com.genymobile.scrcpy.Server.main(Server.java:110)

Also downscale and retry in these cases.

Refs #2947 <https://github.com/Genymobile/scrcpy/pull/2947>
Refs #2988 <https://github.com/Genymobile/scrcpy/issues/2988>
PR #2990 <https://github.com/Genymobile/scrcpy/pull/2990>
2022-02-02 08:22:17 +01:00
..
scripts Use "/usr/bin/env bash" for build-wrapper.sh 2020-09-15 13:44:02 +02:00
src Downscale and retry also on early MediaCodec error 2022-02-02 08:22:17 +01:00
.gitignore Convert server to an Android project 2018-01-30 12:01:36 +01:00
build.gradle Bump version to 1.22 2022-01-29 15:44:52 +01:00
build_without_gradle.sh Bump version to 1.22 2022-01-29 15:44:52 +01:00
meson.build Require Meson 0.48 to get rid of warnings 2020-04-13 22:47:03 +02:00
proguard-rules.pro Convert server to an Android project 2018-01-30 12:01:36 +01:00