mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e94175414 | ||
|
|
cfe9601874 |
No files matched your search
Generated
+1
-1
@@ -2741,7 +2741,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uu-remote-linux"
|
name = "uu-remote-linux"
|
||||||
version = "0.2.32"
|
version = "0.2.33"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "uu-remote-linux"
|
name = "uu-remote-linux"
|
||||||
version = "0.2.32"
|
version = "0.2.33"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "uuremote-server"
|
default-run = "uuremote-server"
|
||||||
authors = ["uu-remote-linux contributors"]
|
authors = ["uu-remote-linux contributors"]
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
修复 Wayland 锁屏或熄屏后,由工具连接(端口映射)升级的桌面视频结束后无法再次打开。/ Fixes a promoted tool connection whose desktop video could not be reopened after the screen locked or blanked.
|
||||||
|
|
||||||
|
### 修复 / Fixed
|
||||||
|
- **锁屏/熄屏后桌面无法重新打开(#114,感谢 @sinoyster 的完整报告)**:通过 capture_desktop 升级为桌面的工具连接上,若 Wayland 采集因锁屏或 DPMS 关闭而结束,再次 capture_desktop 不会重建视频,查看器只剩黑屏。现在会重新请求桌面并在原连接上重启视频,保留原输入租约。
|
||||||
|
On a tool connection promoted with capture_desktop, a desktop stream that ended (e.g. Wayland capture failing on lock/DPMS) is now restarted on the next capture_desktop, keeping the original input lease.
|
||||||
|
|
||||||
|
### 验证范围 / Validation
|
||||||
|
单元测试与 CI;#114 的锁屏场景尚未实机复现,欢迎反馈。
|
||||||
|
|
||||||
|
### 下载 / Download
|
||||||
|
`uu-remote-linux_0.2.33_<amd64|arm64>.deb`,或 `uu-remote-linux-v0.2.33-<x86_64|aarch64>-linux.tar.gz`(解压后运行 `./install.sh`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.33`(x86_64)。
|
||||||
|
|
||||||
|
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
|
||||||
@@ -244,6 +244,15 @@ async fn capture_desktop_on_a_port_mapping_peer_promotes_it_once() {
|
|||||||
let lease = host.role.input().unwrap();
|
let lease = host.role.input().unwrap();
|
||||||
host.promote(None);
|
host.promote(None);
|
||||||
assert!(lease.is_current());
|
assert!(lease.is_current());
|
||||||
|
// Its video ended on its own (capture failed while locked, #114): capture_desktop restarts it
|
||||||
|
// on the same input lease.
|
||||||
|
let ended = tokio::spawn(async {});
|
||||||
|
*host.role.stream_task.lock().unwrap() = Some(ended.abort_handle());
|
||||||
|
ended.await.unwrap();
|
||||||
|
send(&viewer, "CONTROL_DATA_CHANNEL", crate::initialization::envelope(9, 0, 3, &[8, 4])).await;
|
||||||
|
tokio::time::timeout(Duration::from_secs(5), requested.recv()).await.unwrap().unwrap();
|
||||||
|
host.promote(None);
|
||||||
|
assert!(host.role.is_desktop() && !host.role.stream_ended() && lease.is_current());
|
||||||
// A newer desktop demotes it; the port mapping stays, and capture_desktop promotes it again.
|
// A newer desktop demotes it; the port mapping stays, and capture_desktop promotes it again.
|
||||||
host.demote();
|
host.demote();
|
||||||
assert!(!host.role.is_desktop() && host.role.input().is_none());
|
assert!(!host.role.is_desktop() && host.role.input().is_none());
|
||||||
|
|||||||
+21
-11
@@ -64,6 +64,9 @@ impl DesktopRole {
|
|||||||
stream: Default::default(), stream_task: Default::default(), screen: Default::default(), tracking: Default::default(), request: Default::default() }
|
stream: Default::default(), stream_task: Default::default(), screen: Default::default(), tracking: Default::default(), request: Default::default() }
|
||||||
}
|
}
|
||||||
pub fn is_desktop(&self) -> bool { *self.active.borrow() }
|
pub fn is_desktop(&self) -> bool { *self.active.borrow() }
|
||||||
|
/// A promoted peer whose video ended on its own (capture failed while locked or off, #114);
|
||||||
|
/// capture_desktop on it starts the video again.
|
||||||
|
fn stream_ended(&self) -> bool { self.stream_task.lock().unwrap().as_ref().is_some_and(|task| task.is_finished()) }
|
||||||
fn input(&self) -> Option<Arc<crate::input::DesktopInputSession>> { self.input.lock().unwrap().clone() }
|
fn input(&self) -> Option<Arc<crate::input::DesktopInputSession>> { self.input.lock().unwrap().clone() }
|
||||||
fn screen_or(&self, screen: &Arc<ScreenCapture>) -> Arc<ScreenCapture> {
|
fn screen_or(&self, screen: &Arc<ScreenCapture>) -> Arc<ScreenCapture> {
|
||||||
self.screen.lock().unwrap().clone().unwrap_or_else(|| screen.clone())
|
self.screen.lock().unwrap().clone().unwrap_or_else(|| screen.clone())
|
||||||
@@ -1316,10 +1319,14 @@ impl WebRtcSession {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if action == sa::CAPTURE_DESKTOP && channel_name == "CONTROL_DATA_CHANNEL" {
|
} else if action == sa::CAPTURE_DESKTOP && channel_name == "CONTROL_DATA_CHANNEL" {
|
||||||
if message_role.is_desktop() {
|
if message_role.is_desktop() && !message_role.stream_ended() {
|
||||||
log::info!("SimpleAction 4 (capture_desktop) received on a desktop connection");
|
log::info!("SimpleAction 4 (capture_desktop) received on a desktop connection");
|
||||||
} else if let Some(request) = message_role.request.get() {
|
} else if let Some(request) = message_role.request.get() {
|
||||||
log::info!("SimpleAction 4 (capture_desktop) received on a tool connection; starting the desktop");
|
if message_role.is_desktop() {
|
||||||
|
log::info!("SimpleAction 4 (capture_desktop) received on a tool connection whose desktop video ended; restarting it");
|
||||||
|
} else {
|
||||||
|
log::info!("SimpleAction 4 (capture_desktop) received on a tool connection; starting the desktop");
|
||||||
|
}
|
||||||
request();
|
request();
|
||||||
} else {
|
} else {
|
||||||
log::info!("SimpleAction 4 (capture_desktop) not handled: tool connection without a desktop route");
|
log::info!("SimpleAction 4 (capture_desktop) not handled: tool connection without a desktop route");
|
||||||
@@ -1461,18 +1468,21 @@ impl WebRtcSession {
|
|||||||
/// Makes this tool peer the desktop: it takes the input lease, starts the video it negotiated
|
/// Makes this tool peer the desktop: it takes the input lease, starts the video it negotiated
|
||||||
/// (H.264; audio was never negotiated) and repeats the desktop CONTROL initialization.
|
/// (H.264; audio was never negotiated) and repeats the desktop CONTROL initialization.
|
||||||
/// `screen` replaces a capture that was unavailable when the peer was offered.
|
/// `screen` replaces a capture that was unavailable when the peer was offered.
|
||||||
|
/// A promoted peer whose video ended keeps its input lease and only restarts the video.
|
||||||
pub fn promote(&self, screen: Option<Arc<ScreenCapture>>) {
|
pub fn promote(&self, screen: Option<Arc<ScreenCapture>>) {
|
||||||
if self.role.is_desktop() { return; }
|
let restart = self.role.is_desktop();
|
||||||
|
if restart && !self.role.stream_ended() { return; }
|
||||||
if let Some(screen) = screen { *self.role.screen.lock().unwrap() = Some(screen); }
|
if let Some(screen) = screen { *self.role.screen.lock().unwrap() = Some(screen); }
|
||||||
let session = self.input.desktop_session();
|
if !restart {
|
||||||
if self.pc.connection_state() == RTCPeerConnectionState::Connected { session.connected(); }
|
let session = self.input.desktop_session();
|
||||||
*self.role.input.lock().unwrap() = Some(session);
|
if self.pc.connection_state() == RTCPeerConnectionState::Connected { session.connected(); }
|
||||||
self.role.active.send_replace(true);
|
*self.role.input.lock().unwrap() = Some(session);
|
||||||
let stream = self.role.stream.lock().unwrap().clone();
|
self.role.active.send_replace(true);
|
||||||
if let Some(stream) = stream {
|
|
||||||
let task = stream.spawn(self.role.screen.lock().unwrap().clone(), self.role.active.subscribe());
|
|
||||||
if let Some(old) = std::mem::replace(&mut *self.role.stream_task.lock().unwrap(), task) { old.abort(); }
|
|
||||||
}
|
}
|
||||||
|
let stream = self.role.stream.lock().unwrap().clone();
|
||||||
|
let task = stream.and_then(|stream| stream.spawn(self.role.screen.lock().unwrap().clone(), self.role.active.subscribe()));
|
||||||
|
if let Some(old) = std::mem::replace(&mut *self.role.stream_task.lock().unwrap(), task) { old.abort(); }
|
||||||
|
if restart { log::info!("Desktop video restarted on a tool connection after its stream ended"); return; }
|
||||||
if !cfg!(test) { track_session(self.pc.clone(), self.actions.clone(), &self.role); }
|
if !cfg!(test) { track_session(self.pc.clone(), self.actions.clone(), &self.role); }
|
||||||
log::info!("Desktop started on an existing tool connection");
|
log::info!("Desktop started on an existing tool connection");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user