mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
a
This commit is contained in:
parent
d7c2c167ce
commit
22250b2468
3 changed files with 23 additions and 19 deletions
|
@ -142,18 +142,18 @@ bool Server::execute()
|
|||
args << "/"; // unused;
|
||||
args << "com.genymobile.scrcpy.Server";
|
||||
args << Config::getInstance().getServerVersion();
|
||||
args << QString("log_level=%1").arg(Config::getInstance().getLogLevel());
|
||||
|
||||
if (!Config::getInstance().getLogLevel().isEmpty()) {
|
||||
args << QString("log_level=%1").arg(Config::getInstance().getLogLevel());
|
||||
}
|
||||
args << QString("max_size=%1").arg(QString::number(m_params.maxSize));
|
||||
args << QString("bit_rate=%1").arg(QString::number(m_params.bitRate));
|
||||
args << QString("max_fps=%1").arg(QString::number(m_params.maxFps));
|
||||
args << QString("lock_video_orientation=%1").arg(QString::number(m_params.lockVideoOrientation));
|
||||
args << QString("tunnel_forward=%1").arg((m_tunnelForward ? "true" : "false"));
|
||||
if (m_params.crop.isEmpty()) {
|
||||
args << "crop=";
|
||||
} else {
|
||||
if (!m_params.crop.isEmpty()) {
|
||||
args << QString("crop=%1").arg(m_params.crop);
|
||||
}
|
||||
args << "send_frame_meta=true"; // always send frame meta (packet boundaries + timestamp)
|
||||
args << QString("control=%1").arg((m_params.control ? "true" : "false"));
|
||||
args << "display_id=0"; // display id
|
||||
args << "show_touches=false"; // show touch
|
||||
|
@ -161,8 +161,12 @@ bool Server::execute()
|
|||
// code option
|
||||
// https://github.com/Genymobile/scrcpy/commit/080a4ee3654a9b7e96c8ffe37474b5c21c02852a
|
||||
// <https://d.android.com/reference/android/media/MediaFormat>
|
||||
args << QString("codec_options=%1").arg(Config::getInstance().getCodecOptions());
|
||||
args << QString("encoder_name=%1").arg(Config::getInstance().getCodecName());
|
||||
if (Config::getInstance().getCodecOptions() != "") {
|
||||
args << QString("codec_options=%1").arg(Config::getInstance().getCodecOptions());
|
||||
}
|
||||
if (Config::getInstance().getCodecName() != "") {
|
||||
args << QString("encoder_name=%1").arg(Config::getInstance().getCodecName());
|
||||
}
|
||||
|
||||
#ifdef SERVER_DEBUGGER
|
||||
qInfo("Server debugger waiting for a client on device port " SERVER_DEBUGGER_PORT "...");
|
||||
|
|
|
@ -23,21 +23,21 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
// set env
|
||||
#ifdef Q_OS_WIN32
|
||||
qputenv("QTSCRCPY_ADB_PATH", "../../../../third_party/adb/win/adb.exe");
|
||||
qputenv("QTSCRCPY_SERVER_PATH", "../../../../third_party/scrcpy-server");
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../../keymap");
|
||||
qputenv("QTSCRCPY_CONFIG_PATH", "../../../../config");
|
||||
qputenv("QTSCRCPY_ADB_PATH", "../../../third_party/adb/win/adb.exe");
|
||||
qputenv("QTSCRCPY_SERVER_PATH", "../../../third_party/scrcpy-server");
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../keymap");
|
||||
qputenv("QTSCRCPY_CONFIG_PATH", "../../../config");
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_OSX
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../../../../keymap");
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../../../keymap");
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
qputenv("QTSCRCPY_ADB_PATH", "../../../third_party/adb/linux/adb");
|
||||
qputenv("QTSCRCPY_SERVER_PATH", "../../../third_party/scrcpy-server");
|
||||
qputenv("QTSCRCPY_CONFIG_PATH", "../../../config");
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../../keymap");
|
||||
qputenv("QTSCRCPY_ADB_PATH", "../../third_party/adb/linux/adb");
|
||||
qputenv("QTSCRCPY_SERVER_PATH", "../../third_party/scrcpy-server");
|
||||
qputenv("QTSCRCPY_CONFIG_PATH", "../../config");
|
||||
qputenv("QTSCRCPY_KEYMAP_PATH", "../../keymap");
|
||||
#endif
|
||||
|
||||
g_msgType = covertLogLevel(Config::getInstance().getLogLevel());
|
||||
|
|
|
@ -15,13 +15,13 @@ ServerVersion=1.21
|
|||
ServerPath=/data/local/tmp/scrcpy-server.jar
|
||||
# 自定义adb路径,例如D:/android/tools/adb.exe
|
||||
AdbPath=
|
||||
# 编码选项 "-"表示默认
|
||||
# 编码选项 ""表示默认
|
||||
# 例如 CodecOptions="profile=1,level=2"
|
||||
# 更多编码选项参考 https://d.android.com/reference/android/media/MediaFormat
|
||||
CodecOptions=""
|
||||
# 指定编码器名称,必须是H.264编码器
|
||||
# 指定编码器名称(必须是H.264编码器),""表示默认
|
||||
# 例如 CodecName="OMX.qcom.video.encoder.avc"
|
||||
CodecName="OMX.qcom.video.encoder.avc"
|
||||
CodecName=""
|
||||
|
||||
# Set the log level (debug, info, warn, error)
|
||||
LogLevel=info
|
||||
|
|
Loading…
Add table
Reference in a new issue