feat: 更新scrcpy-server 2.1.1

This commit is contained in:
barry 2024-02-25 16:32:11 +08:00
parent 4e4be93a32
commit e67ae04132
5 changed files with 18 additions and 4 deletions

@ -1 +1 @@
Subproject commit 9b81a312ad2e8157c48dc042e973a81702357509
Subproject commit 0ed6236e0a43cf27baef51dab7a64cb36fd068c0

View file

@ -2,6 +2,7 @@
#include <QFile>
#include <QFileDialog>
#include <QKeyEvent>
#include <QRandomGenerator>
#include <QTime>
#include <QTimer>
@ -320,6 +321,7 @@ void Dialog::on_startServerBtn_clicked()
params.logLevel = Config::getInstance().getLogLevel();
params.codecOptions = Config::getInstance().getCodecOptions();
params.codecName = Config::getInstance().getCodecName();
params.scid = QRandomGenerator::global()->bounded(1, 10000) & 0x7FFFFFFF;
qsc::IDeviceManage::getInstance().connectDevice(params);
}
@ -457,8 +459,10 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin
videoForm->staysOnTop();
}
#ifndef Q_OS_WIN32
// must be show before updateShowSize
videoForm->show();
#endif
QString name = Config::getInstance().getNickName(serial);
if (name.isEmpty()) {
name = Config::getInstance().getTitle();
@ -476,6 +480,11 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin
videoForm->setGeometry(rc);
}
#ifdef Q_OS_WIN32
// windows是show太早可以看到resize的过程
QTimer::singleShot(200, videoForm, [videoForm](){videoForm->show();});
#endif
GroupController::instance().addDevice(serial);
}

View file

@ -513,6 +513,9 @@ void VideoForm::switchFullScreen()
bool VideoForm::isHost()
{
if (!m_toolForm) {
return false;
}
return m_toolForm->isHost();
}
@ -719,7 +722,9 @@ void VideoForm::showEvent(QShowEvent *event)
{
Q_UNUSED(event)
if (!isFullScreen()) {
showToolForm();
QTimer::singleShot(500, this, [this](){
showToolForm();
});
}
}

View file

@ -18,7 +18,7 @@
#define COMMON_PUSHFILE_DEF "/sdcard/"
#define COMMON_SERVER_VERSION_KEY "ServerVersion"
#define COMMON_SERVER_VERSION_DEF "1.24"
#define COMMON_SERVER_VERSION_DEF "2.1.1"
#define COMMON_SERVER_PATH_KEY "ServerPath"
#define COMMON_SERVER_PATH_DEF "/data/local/tmp/scrcpy-server.jar"

View file

@ -10,7 +10,7 @@ RenderExpiredFrames=0
# 视频解码方式:-1 自动0 软解1 dx硬解2 opengl硬解
UseDesktopOpenGL=-1
# scrcpy-server的版本号不要修改
ServerVersion=1.24
ServerVersion=2.1.1
# scrcpy-server推送到安卓设备的路径
ServerPath=/data/local/tmp/scrcpy-server.jar
# 自定义adb路径例如D:/android/tools/adb.exe