mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-05 15:08:39 +00:00
feat: add codec options
This commit is contained in:
parent
dbbf7cf3e1
commit
c7a5b8a403
4 changed files with 18 additions and 1 deletions
|
@ -161,7 +161,7 @@ bool Server::execute()
|
||||||
// code option
|
// code option
|
||||||
// https://github.com/Genymobile/scrcpy/commit/080a4ee3654a9b7e96c8ffe37474b5c21c02852a
|
// https://github.com/Genymobile/scrcpy/commit/080a4ee3654a9b7e96c8ffe37474b5c21c02852a
|
||||||
// <https://d.android.com/reference/android/media/MediaFormat>
|
// <https://d.android.com/reference/android/media/MediaFormat>
|
||||||
args << "-";
|
args << Config::getInstance().getCodecOptions();
|
||||||
|
|
||||||
#ifdef SERVER_DEBUGGER
|
#ifdef SERVER_DEBUGGER
|
||||||
qInfo("Server debugger waiting for a client on device port " SERVER_DEBUGGER_PORT "...");
|
qInfo("Server debugger waiting for a client on device port " SERVER_DEBUGGER_PORT "...");
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
#define COMMON_LOG_LEVEL_KEY "LogLevel"
|
#define COMMON_LOG_LEVEL_KEY "LogLevel"
|
||||||
#define COMMON_LOG_LEVEL_DEF "info"
|
#define COMMON_LOG_LEVEL_DEF "info"
|
||||||
|
|
||||||
|
#define COMMON_CODEC_OPTIONS_KEY "CodecOptions"
|
||||||
|
#define COMMON_CODEC_OPTIONS_DEF "-"
|
||||||
|
|
||||||
// user data
|
// user data
|
||||||
#define COMMON_RECORD_KEY "RecordPath"
|
#define COMMON_RECORD_KEY "RecordPath"
|
||||||
#define COMMON_RECORD_DEF ""
|
#define COMMON_RECORD_DEF ""
|
||||||
|
@ -277,6 +280,15 @@ QString Config::getLogLevel()
|
||||||
return logLevel;
|
return logLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Config::getCodecOptions()
|
||||||
|
{
|
||||||
|
QString codecOptions;
|
||||||
|
m_settings->beginGroup(GROUP_COMMON);
|
||||||
|
codecOptions = m_settings->value(COMMON_CODEC_OPTIONS_KEY, COMMON_CODEC_OPTIONS_DEF).toString();
|
||||||
|
m_settings->endGroup();
|
||||||
|
return codecOptions;
|
||||||
|
}
|
||||||
|
|
||||||
QString Config::getTitle()
|
QString Config::getTitle()
|
||||||
{
|
{
|
||||||
QString title;
|
QString title;
|
||||||
|
|
|
@ -22,6 +22,7 @@ public:
|
||||||
QString getServerPath();
|
QString getServerPath();
|
||||||
QString getAdbPath();
|
QString getAdbPath();
|
||||||
QString getLogLevel();
|
QString getLogLevel();
|
||||||
|
QString getCodecOptions();
|
||||||
|
|
||||||
// user data
|
// user data
|
||||||
QString getRecordPath();
|
QString getRecordPath();
|
||||||
|
|
|
@ -15,6 +15,10 @@ ServerVersion=1.14
|
||||||
ServerPath=/data/local/tmp/scrcpy-server.jar
|
ServerPath=/data/local/tmp/scrcpy-server.jar
|
||||||
# 自定义adb路径,例如D:/android/tools/adb.exe
|
# 自定义adb路径,例如D:/android/tools/adb.exe
|
||||||
AdbPath=
|
AdbPath=
|
||||||
|
# 编码选项 "-"表示默认
|
||||||
|
# 例如 CodecOptions="profile=1,level=2"
|
||||||
|
# 更多编码选项参考 https://d.android.com/reference/android/media/MediaFormat
|
||||||
|
CodecOptions="-"
|
||||||
|
|
||||||
# Set the log level (debug, info, warn, error)
|
# Set the log level (debug, info, warn, error)
|
||||||
LogLevel=info
|
LogLevel=info
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue