-
Notifications
You must be signed in to change notification settings - Fork 80
pick v20 to v25 #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pick v20 to v25 #783
Conversation
fit the screen window layer in 1070, 1060 and 1050 pick from:c07f9d7066a1e320896bd13709b00e71ebdf126d Log: fit the screen window layer in 1070, 1060 and 1050 Bug: https://pms.uniontech.com/bug-view-275661.html
The screenshot defaults to launching in 'shot' mode, changing from the previous default 'record' mode. The 'shot' mode utilizes OpenGL rendering, which offers higher performance compared to image rendering. Log: reduce stuttering during corner marker movement. Bug: https://pms.uniontech.com//bug-view-323453.html
Fixed an issue with Wayland window screenshots capturing the active window. Previously, it rigidly used the second-to-last layer method (which could capture input methods, notifications, or remote assistance windows). Now it references dde-dock's layer level and captures the window one layer above dde-dock. pick from: 39e2146 Log: Fix active window detection in Wayland screenshots Bug: https://pms.uniontech.com/bug-view-322949.html
Added dynamic wait time calculation function that adjusts clipboard save timeout according to image resolution, improving performance for small images while ensuring sufficient time for large images pick from: 3596abf Log: Implement adaptive clipboard wait time based on image size Bug: https://pms.uniontech.com/bug-view-326039.html
Improved local image saving speed on LoongArch64 architecture by configuring pixmap quality settings. Testing shows quality=60 provides optimal balance between speed and image fidelity. pick from: 023cf20 Log: Enhance LoongArch64 image save performance Bug: https://pms.uniontech.com/bug-view-326039.html
Improved local image saving speed on LoongArch64 architecture by configuring pixmap quality settings. Testing shows quality=60 provides optimal balance between speed and image fidelity. pick from: 953d402 Log: Enhance LoongArch64 image save performance Bug: https://pms.uniontech.com/bug-view-326039.html
deepin pr auto review我来对这段代码变更进行审查:
改进建议:
int MainWindow::getWaitTimeByImageSize(const QPixmap &pix)
{
// 建议将常量值定义为宏或常量变量,便于维护
static const int DEFAULT_WAIT_TIME = 2;
static const int MAX_WAIT_TIME = 15;
static const qint64 BASE_PIXELS = 921600; // 720p基准像素数
if (pix.isNull()) {
qWarning() << __FUNCTION__ << "Empty pixmap, using default wait time";
return DEFAULT_WAIT_TIME;
}
qint64 totalPixels = static_cast<qint64>(pix.width()) * pix.height();
int waitTime = DEFAULT_WAIT_TIME;
// 建议使用switch-case结构,更清晰
if (totalPixels <= BASE_PIXELS) {
waitTime = 2;
} else if (totalPixels <= 2073600) {
waitTime = 4;
} else if (totalPixels <= 3686400) {
waitTime = 6;
} else if (totalPixels <= 8294400) {
waitTime = 8;
} else if (totalPixels <= 33177600) {
waitTime = 10;
} else {
double pixelRatio = static_cast<double>(totalPixels) / BASE_PIXELS;
waitTime = static_cast<int>(DEFAULT_WAIT_TIME + log2(pixelRatio) * 2);
waitTime = qMin(waitTime, MAX_WAIT_TIME);
}
return waitTime;
}
void MainWindow::save2Clipboard(const QPixmap &pix)
{
if (pix.isNull()) {
qWarning() << __FUNCTION__ << "Copy Null Pix To Clipboard!";
return;
}
// 建议将质量参数定义为常量
static const int DEFAULT_QUALITY = -1;
static const int LOONGARCH_QUALITY = 60;
int quality = QSysInfo::currentCpuArchitecture().startsWith("loongarch64")
? LOONGARCH_QUALITY
: DEFAULT_QUALITY;
// 其余代码保持不变...
}
/**
* @brief 启动编码器线程
* @param data 传递给编码器线程的数据指针
* @return 错误代码
*/
int start_encoder_thread(void *data);
/*
* FFmpeg profile definitions compatibility layer
* These macros provide backward compatibility with older FFmpeg versions
*/
#ifndef FF_PROFILE_UNKNOWN
#define FF_PROFILE_UNKNOWN AV_PROFILE_UNKNOWN
// ... 其他宏定义
#endif
// 定义功能类型枚举
enum FunctionType {
RECORD = 0,
SHOT = 1,
SCROLLSHOT = 2,
OCR = 3,
PINSCREENSHOTS = 4
};
// 使用枚举类型
FunctionType m_functionType = FunctionType::SHOT;这些改进建议主要针对代码的可维护性和可读性,不会影响代码的功能和性能。 |
lzwind
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要处理错误
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
* feat: Support ffmepg 7 Log: Fix build on ffmepg 7 * fix:(libcam_encoder) Add fallback definitions for FF_PROFILE_* macros Some older FFmpeg or libav versions do not define FF_PROFILE_* macros. Add conditional definitions to ensure compatibility with AV_PROFILE_* constants, fixing build errors on systems with outdated headers. Log: * fix: update function signature for GCC 15 compatibility The function 'v4l2core_check_device_list_events' signature was updated to accept 'v4l2_dev_t *' parameter instead of having no parameters. Log: This change addresses a breaking compatibility issue introduced in GCC 15, which enforces stricter type checking on function declarations and definitions. Previously, GCC allowed mismatched function declarations and definitions when parameter types differ but ultimately point to the same struct type, such as between 'struct _v4l2_dev_t *' and 'v4l2_dev_t *'. GCC 15's change (see GCC 15 release notes) now treats such mismatches as errors, requiring declarations and definitions to exactly match in parameter types. This patch aligns the declaration with the definition to fix the 'conflicting types' compilation error when building with GCC 15
2897b56 to
e80b253
Compare
|
/forcemerge |
|
This pr force merged! (status: unstable) |
2293663
into
linuxdeepin:develop/snipe
pick v20 to v25