mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-19 19:15:07 +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
|
||||
// https://github.com/Genymobile/scrcpy/commit/080a4ee3654a9b7e96c8ffe37474b5c21c02852a
|
||||
// <https://d.android.com/reference/android/media/MediaFormat>
|
||||
args << "-";
|
||||
args << Config::getInstance().getCodecOptions();
|
||||
|
||||
#ifdef SERVER_DEBUGGER
|
||||
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_DEF "info"
|
||||
|
||||
#define COMMON_CODEC_OPTIONS_KEY "CodecOptions"
|
||||
#define COMMON_CODEC_OPTIONS_DEF "-"
|
||||
|
||||
// user data
|
||||
#define COMMON_RECORD_KEY "RecordPath"
|
||||
#define COMMON_RECORD_DEF ""
|
||||
|
@ -277,6 +280,15 @@ QString Config::getLogLevel()
|
|||
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 title;
|
||||
|
|
|
@ -22,6 +22,7 @@ public:
|
|||
QString getServerPath();
|
||||
QString getAdbPath();
|
||||
QString getLogLevel();
|
||||
QString getCodecOptions();
|
||||
|
||||
// user data
|
||||
QString getRecordPath();
|
||||
|
|
|
@ -15,6 +15,10 @@ ServerVersion=1.14
|
|||
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="-"
|
||||
|
||||
# Set the log level (debug, info, warn, error)
|
||||
LogLevel=info
|
||||
|
|
Loading…
Add table
Reference in a new issue