From f5c50744297f1ea59d83ee2ff765a2f19c5fd6de Mon Sep 17 00:00:00 2001 From: mingzhixian Date: Sun, 9 Jul 2023 10:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0V12.1.1=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=E6=97=B6=E5=B4=A9=E6=BA=83?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scrcpy_android/app/build.gradle | 4 +-- .../saymzx/scrcpy/android/entity/Scrcpy.kt | 26 +++++++++---------- .../com/genymobile/scrcpy/ScreenEncoder.java | 1 - 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/scrcpy_android/app/build.gradle b/scrcpy_android/app/build.gradle index 88870dbe..72cfa356 100644 --- a/scrcpy_android/app/build.gradle +++ b/scrcpy_android/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "top.saymzx.scrcpy.android" minSdk 23 targetSdk 33 - versionCode 121 - versionName "12.1" + versionCode 1211 + versionName "12.1.1" resConfigs "zh" resConfigs "xhdpi" ndk { diff --git a/scrcpy_android/app/src/main/java/top/saymzx/scrcpy/android/entity/Scrcpy.kt b/scrcpy_android/app/src/main/java/top/saymzx/scrcpy/android/entity/Scrcpy.kt index 4cdbb82b..29a2409c 100644 --- a/scrcpy_android/app/src/main/java/top/saymzx/scrcpy/android/entity/Scrcpy.kt +++ b/scrcpy_android/app/src/main/java/top/saymzx/scrcpy/android/entity/Scrcpy.kt @@ -81,19 +81,19 @@ class Scrcpy(private val device: Device) { } catch (e: Exception) { stop("连接错误", e) } -// try { - alert.cancel() - // 配置视频解码 - setVideoDecodec() - // 配置音频解码 - setAudioDecodec() - // 配置音频播放 - if (canAudio) setAudioTrack() - // 设置被控端熄屏(默认投屏后熄屏) - setPowerOff() -// } catch (e: Exception) { -// stop("启动错误", e) -// } + try { + alert.cancel() + // 配置视频解码 + setVideoDecodec() + // 配置音频解码 + setAudioDecodec() + // 配置音频播放 + if (canAudio) setAudioTrack() + // 设置被控端熄屏(默认投屏后熄屏) + setPowerOff() + } catch (e: Exception) { + stop("启动错误", e) + } // 投屏中 device.status = 1 // 视频解码 diff --git a/scrcpy_android/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/scrcpy_android/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index 9b5b22d9..7c56a178 100644 --- a/scrcpy_android/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/scrcpy_android/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -94,7 +94,6 @@ private void streamScreen() throws IOException, ConfigurationException { if (codeInfo.getCapabilitiesForType(codec.getMimeType()).getEncoderCapabilities().isBitrateModeSupported(MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR)) { format.setInteger(MediaFormat.KEY_BITRATE_MODE, MediaCodecInfo.EncoderCapabilities.BITRATE_MODE_CBR); } -// format.setInteger(MediaFormat.KEY_COLOR_FORMAT, COLOR_FormatYUV420Flexible); Surface surface = null; try {