feat(treeland): Enhance screen recording support for TreeLand environ…#762
Merged
deepin-bot[bot] merged 1 commit intoNov 27, 2025
Merged
feat(treeland): Enhance screen recording support for TreeLand environ…#762deepin-bot[bot] merged 1 commit into
deepin-bot[bot] merged 1 commit into
Conversation
…ment - Implement the `treelandRecord` function to handle video recording using the ext-image-copy-capture protocol. - Update `RecordProcess` to manage recording lifecycle for TreeLand, including starting and stopping recordings. - Add checks for protocol availability and integrate event handling for recording status. - Modify utility functions to accommodate both Wayland and TreeLand modes, ensuring proper event handling and input passthrough. - Update UI components to reflect the new recording capabilities in TreeLand. - This enhancement expands the screen recording functionality to support the TreeLand environment, improving user experience and feature accessibility. 特性(treeland): 增强对 TreeLand 环境的屏幕录制支持 - 实现 `treelandRecord` 函数,使用 ext-image-copy-capture 协议来处理视频录制。 - 更新 `RecordProcess` 以管理 TreeLand 的录制生命周期,包括启动和停止录制。 - 添加协议可用性检查,并集成对录制状态的事件处理。 - 修改工具函数以适应 Wayland 和 TreeLand 两种模式,确保正确的事件处理和输入透传。 - 更新用户界面(UI)组件,以反映 TreeLand 中的新录制功能。 - 本次增强将屏幕录制功能扩展到 TreeLand 环境,从而改善用户体验和功能可访问性。
deepin pr auto review我来对这个代码变更进行详细审查:
优点:
需要改进的地方:
优点:
需要改进的地方:
// 1. 添加配置常量
namespace Config {
constexpr int PROTOCOL_WAIT_TIMEOUT = 1000; // ms
constexpr int MAX_RETRY_COUNT = 3;
}
// 2. 改进treelandRecord函数
void RecordProcess::treelandRecord()
{
qCDebug(dsrApp) << "Starting TreeLand recording...";
if (!validateSavePath(savePath)) {
qCCritical(dsrApp) << "Invalid save path";
return;
}
initProcess();
ExtCaptureRecorder *extRecorder = createExtRecorder();
if (!extRecorder) {
qCCritical(dsrApp) << "Failed to create recorder";
return;
}
if (!waitForProtocol(extRecorder)) {
delete extRecorder;
return;
}
setupRecorderConnections(extRecorder);
if (!startRecording(extRecorder)) {
delete extRecorder;
return;
}
storeRecorder(extRecorder);
}
// 3. 添加辅助函数
bool RecordProcess::validateSavePath(const QString& path)
{
// 实现路径验证逻辑
return true;
}
ExtCaptureRecorder* RecordProcess::createExtRecorder()
{
return new ExtCaptureRecorder(this);
}
bool RecordProcess::waitForProtocol(ExtCaptureRecorder* recorder)
{
if (recorder->isAvailable()) {
return true;
}
QEventLoop waitLoop;
QTimer timeoutTimer;
timeoutTimer.setSingleShot(true);
timeoutTimer.setInterval(Config::PROTOCOL_WAIT_TIMEOUT);
// 使用智能指针管理连接
QMetaObject::Connection conn = connect(recorder, &ExtCaptureRecorder::protocolAvailable,
[&waitLoop, &conn]() {
QObject::disconnect(conn);
waitLoop.quit();
});
timeoutTimer.start();
waitLoop.exec();
return recorder->isAvailable();
}
这些改进将使代码更加健壮、安全和易于维护。 |
lzwind
approved these changes
Nov 27, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
Member
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
3c8a917
into
linuxdeepin:develop/snipe
7 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ment
treelandRecordfunction to handle video recording using the ext-image-copy-capture protocol.RecordProcessto manage recording lifecycle for TreeLand, including starting and stopping recordings.特性(treeland): 增强对 TreeLand 环境的屏幕录制支持
treelandRecord函数,使用 ext-image-copy-capture 协议来处理视频录制。RecordProcess以管理 TreeLand 的录制生命周期,包括启动和停止录制。