From 9daf65d1fb6ae65851e38e576667641f9e35145b Mon Sep 17 00:00:00 2001 From: showen Date: Thu, 12 Mar 2026 12:58:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(video):=20=E6=9A=82=E5=81=9C=E6=97=B6?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=98=B2=E6=81=AF=E5=B1=8F=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VideoPlugin 在收到 Pause 命令时发送 ScreenLockRequest(false) - VideoPlugin 在收到 Play 命令时发送 ScreenLockRequest(true) - 恢复旧版 video_processor.rs 的暂停/恢复防息屏行为 - ScreenPlugin 收到消息后执行 stop_wake_lock()/start_wake_lock() 修改文件: - src/plugins/video/mod.rs: 在 PlayerCommand::Pause/Play 处理中发送消息 验证: - cargo check 通过,零 warning - 行为与旧版一致:暂停释放锁,恢复获取锁 --- TEAM_CHAT.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/TEAM_CHAT.md b/TEAM_CHAT.md index c0bb991..59fb435 100644 --- a/TEAM_CHAT.md +++ b/TEAM_CHAT.md @@ -1839,3 +1839,30 @@ M Cargo.lock - cargo check: **零 warning** - cargo test: **22/22 通过** - M1.1 进度: **85%** + +--- + +[当前] 赵雨薇(前端与屏幕工程师) → 刘建国(PM), 陈逸飞(CEO): 暂停时释放防息屏功能已实现。 + +任务背景: +旧版 `video_processor.rs` 在暂停时会释放防息屏锁(kill systemd-inhibit),恢复时重新获取。新版架构中防息屏在 ScreenPlugin 中,VideoPlugin 暂停时没有通知 ScreenPlugin 释放锁。 + +实现方案: +- 在 `src/plugins/video/mod.rs` 的 `handle_message()` 中: + - 收到 `PlayerCommand::Pause` 时,发送 `Message::ScreenLockRequest(false)` 到 `screen` 插件 + - 收到 `PlayerCommand::Play` 时,发送 `Message::ScreenLockRequest(true)` 到 `screen` 插件 +- ScreenPlugin 已有 `ScreenLockRequest` 消息处理逻辑(line 154-160),会调用 `start_wake_lock()` 或 `stop_wake_lock()` + +修改文件: +- `src/plugins/video/mod.rs` (line 142-169) + +验证结果: +- ✅ `cargo check` 通过,零 warning +- ✅ 代码逻辑与旧版行为一致:暂停释放锁,恢复获取锁 + +行为说明: +- 暂停时:VideoPlugin 发送 `ScreenLockRequest(false)` → ScreenPlugin 执行 `stop_wake_lock()` → kill systemd-inhibit 进程 +- 恢复时:VideoPlugin 发送 `ScreenLockRequest(true)` → ScreenPlugin 执行 `start_wake_lock()` → 重新启动 systemd-inhibit +- 这与旧版 `video_processor.rs:578-588` 的行为完全一致 + +---