mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 11:35:56 +00:00
commit
6692ee15d4
8 changed files with 32 additions and 6 deletions
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
|
@ -68,7 +68,7 @@ jobs:
|
|||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: ${{ steps.package.outputs.package-name }}.zip
|
||||
path: ci/build/${{ steps.package.outputs.package-name }}.app
|
||||
path: ci/build/${{ steps.package.outputs.package-name }}.dmg
|
||||
# Upload to release
|
||||
- name: Upload Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
|
|
@ -163,6 +163,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|||
set(QC_UTIL_SOURCES ${QC_UTIL_SOURCES}
|
||||
util/mousetap/cocoamousetap.h
|
||||
util/mousetap/cocoamousetap.mm
|
||||
util/path.h
|
||||
util/path.mm
|
||||
)
|
||||
endif()
|
||||
source_group(util FILES ${QC_UTIL_SOURCES})
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f81d3696cb79964e073415798bc070415337877d
|
||||
Subproject commit 9b81a312ad2e8157c48dc042e973a81702357509
|
|
@ -292,7 +292,7 @@ void Dialog::on_startServerBtn_clicked()
|
|||
{
|
||||
outLog("start server...", false);
|
||||
|
||||
// this is ok that "native" toUshort is 0
|
||||
// this is ok that "original" toUshort is 0
|
||||
quint16 videoSize = ui->maxSizeBox->currentText().trimmed().toUShort();
|
||||
qsc::DeviceParams params;
|
||||
params.serial = ui->serialBox->currentText().trimmed();
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
#include <QDebug>
|
||||
|
||||
#include "config.h"
|
||||
#ifdef Q_OS_OSX
|
||||
#include "path.h"
|
||||
#endif
|
||||
|
||||
#define GROUP_COMMON "common"
|
||||
|
||||
|
@ -21,7 +24,7 @@
|
|||
#define COMMON_SERVER_PATH_DEF "/data/local/tmp/scrcpy-server.jar"
|
||||
|
||||
#define COMMON_MAX_FPS_KEY "MaxFps"
|
||||
#define COMMON_MAX_FPS_DEF 60
|
||||
#define COMMON_MAX_FPS_DEF 0
|
||||
|
||||
#define COMMON_DESKTOP_OPENGL_KEY "UseDesktopOpenGL"
|
||||
#define COMMON_DESKTOP_OPENGL_DEF -1
|
||||
|
@ -125,7 +128,15 @@ const QString &Config::getConfigPath()
|
|||
QFileInfo fileInfo(s_configPath);
|
||||
if (s_configPath.isEmpty() || !fileInfo.isDir()) {
|
||||
// default application dir
|
||||
// mac系统当从finder打开app时,默认工作目录不再是可执行程序的目录了,而是"/"
|
||||
// 而Qt的获取工作目录的api都依赖QCoreApplication的初始化,所以使用mac api获取当前目录
|
||||
#ifdef Q_OS_OSX
|
||||
// get */QtScrcpy.app path
|
||||
s_configPath = Path::GetCurrentPath();
|
||||
s_configPath += "/Contents/MacOS/config";
|
||||
#else
|
||||
s_configPath = "config";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return s_configPath;
|
||||
|
@ -227,7 +238,7 @@ QString Config::getServerVersion()
|
|||
|
||||
int Config::getMaxFps()
|
||||
{
|
||||
int fps = 60;
|
||||
int fps = 0;
|
||||
m_settings->beginGroup(GROUP_COMMON);
|
||||
fps = m_settings->value(COMMON_MAX_FPS_KEY, COMMON_MAX_FPS_DEF).toInt();
|
||||
m_settings->endGroup();
|
||||
|
|
6
QtScrcpy/util/path.h
Normal file
6
QtScrcpy/util/path.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
class Path {
|
||||
public:
|
||||
static const char* GetCurrentPath();
|
||||
};
|
7
QtScrcpy/util/path.mm
Normal file
7
QtScrcpy/util/path.mm
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include "path.h"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
const char* Path::GetCurrentPath() {
|
||||
return [[[NSBundle mainBundle] bundlePath] UTF8String];
|
||||
}
|
|
@ -4,7 +4,7 @@ WindowTitle=QtScrcpy
|
|||
# 推送到安卓设备的文件保存路径(必须以/结尾)
|
||||
PushFilePath=/sdcard/
|
||||
# 最大fps(仅支持Android 10以上)
|
||||
MaxFps=60
|
||||
MaxFps=0
|
||||
# 是否渲染过期视频帧(跳过过期视频帧意味着更低的延迟)
|
||||
RenderExpiredFrames=0
|
||||
# 视频解码方式:-1 自动,0 软解,1 dx硬解,2 opengl硬解
|
||||
|
|
Loading…
Add table
Reference in a new issue