mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 08:50:40 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fcc674440 | ||
|
|
19d0563781 |
No files matched your search
Generated
+1
-1
@@ -2741,7 +2741,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "uu-remote-linux"
|
||||
version = "0.2.9"
|
||||
version = "0.2.10"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "uu-remote-linux"
|
||||
version = "0.2.9"
|
||||
version = "0.2.10"
|
||||
edition = "2021"
|
||||
default-run = "uuremote-server"
|
||||
authors = ["uu-remote-linux contributors"]
|
||||
|
||||
@@ -225,6 +225,7 @@ Optional launcher icon:
|
||||
```sh
|
||||
install -Dm644 contrib/desktop/uu-remote-linux.svg ~/.local/share/icons/hicolor/scalable/apps/uu-remote-linux.svg
|
||||
install -Dm644 contrib/desktop/uu-remote-linux.desktop ~/.local/share/applications/uu-remote-linux.desktop
|
||||
install -Dm644 contrib/desktop/uu-remote-linux-viewer.desktop ~/.local/share/applications/uu-remote-linux-viewer.desktop
|
||||
```
|
||||
|
||||
Verified with the official Mac viewer: guest connections, wrong-code rejection, code rotation, switching assistance off,
|
||||
|
||||
@@ -199,6 +199,7 @@ X11 默认继续用 XTest,因为它能正确处理网络延迟下按住不放
|
||||
```sh
|
||||
install -Dm644 contrib/desktop/uu-remote-linux.svg ~/.local/share/icons/hicolor/scalable/apps/uu-remote-linux.svg
|
||||
install -Dm644 contrib/desktop/uu-remote-linux.desktop ~/.local/share/applications/uu-remote-linux.desktop
|
||||
install -Dm644 contrib/desktop/uu-remote-linux-viewer.desktop ~/.local/share/applications/uu-remote-linux-viewer.desktop
|
||||
```
|
||||
|
||||
验证情况:访客身份下的连接、错误验证码拒绝、用完换码、关闭后不可连接、登录与退出登录的切换,已用官方 Mac 客户端实测通过。
|
||||
|
||||
@@ -474,6 +474,7 @@ static gboolean show_window(gpointer d) {
|
||||
static void *ui_thread(void *d) {
|
||||
(void)d;
|
||||
if (!gtk_init_check(NULL, NULL)) { pthread_mutex_lock(&init_lock); init_state = -1; pthread_cond_signal(&init_cond); pthread_mutex_unlock(&init_lock); return NULL; }
|
||||
gtk_window_set_default_icon_name("uu-remote-linux"); // same taskbar icon as the host (#13)
|
||||
// Light palette in CSS; keep a dark system theme from making unstyled text white on white (#43).
|
||||
g_object_set(gtk_settings_get_default(), "gtk-theme-name", "Adwaita", "gtk-application-prefer-dark-theme", FALSE, NULL);
|
||||
show_window(NULL); gtk_main(); return NULL;
|
||||
|
||||
@@ -590,6 +590,7 @@ static gboolean on_delete(GtkWidget *w, GdkEvent *e, gpointer d) { (void)w; (voi
|
||||
static void *run(void *arg) {
|
||||
(void)arg;
|
||||
int ok = gtk_init_check(NULL, NULL);
|
||||
if (ok) { gtk_window_set_default_icon_name("uu-remote-linux"); } // same taskbar icon as the host (#13)
|
||||
// The CSS hard-codes a light palette; a dark system theme would turn unstyled text white on white (#43).
|
||||
if (ok) g_object_set(gtk_settings_get_default(), "gtk-theme-name", "Adwaita", "gtk-application-prefer-dark-theme", FALSE, NULL);
|
||||
if (ok) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=UU 远程 Linux 控制端
|
||||
Name[en]=UU Remote Linux Viewer
|
||||
GenericName=Remote desktop viewer
|
||||
Comment=非官方 UU 远程控制端(实验性):远控你的 Windows / Mac / Linux 设备
|
||||
Comment[en]=Unofficial NetEase UU Remote viewer (experimental)
|
||||
Exec=uuremote-viewer ui
|
||||
Icon=uu-remote-linux
|
||||
Terminal=false
|
||||
Categories=Network;RemoteAccess;
|
||||
Keywords=remote;desktop;viewer;UU;远程;控制;
|
||||
StartupNotify=false
|
||||
StartupWMClass=uuremote-viewer
|
||||
@@ -11,3 +11,5 @@ Terminal=false
|
||||
Categories=Network;RemoteAccess;
|
||||
Keywords=remote;assist;UU;远程;协助;
|
||||
StartupNotify=false
|
||||
# Matches the GTK window class so docks/taskbars show this icon for the host window (#13).
|
||||
StartupWMClass=uu-remote-linux
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# Unofficial UU Remote Linux host in a container, for NAS boxes (Synology DSM, etc.) without a desktop.
|
||||
# Headless mode: file transfer, terminal and port mapping; no remote desktop. Uses the published release binary.
|
||||
FROM ubuntu:24.04
|
||||
ARG VERSION=v0.2.9
|
||||
ARG VERSION=v0.2.10
|
||||
LABEL org.opencontainers.image.source="https://github.com/VallierDev/uu-remote-linux" \
|
||||
org.opencontainers.image.description="Unofficial UU Remote Linux host, headless (file transfer, terminal, port mapping)" \
|
||||
org.opencontainers.image.licenses="GPL-3.0"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
修复 iPhone 上「超清 / 原画」「常规 / 真彩」点不动。/ Fix iPhone quality and chroma choices being locked.
|
||||
|
||||
### 修复 / Fixed
|
||||
- **iPhone 无法切换画质与真彩**(#49,感谢 @RiverOnVenus 的细致排查):连接本项目主机时,iPhone 的「超清」「原画」
|
||||
以及「常规 / 真彩」按钮点了没反应,只有帧率能改。原因是主机发出的设备能力消息(`forward_setting` 的 `device_capability`)
|
||||
格式与官方 Windows 被控端不一致,iPhone 无法识别,于是锁定在默认值。现在按官方格式发送设备能力(含 4:4:4 等真实支持的格式),
|
||||
并补发发送参数 `sender_para_info`。
|
||||
已实测:iPhone(UU 远程 4.42.0)连接修复后的主机,可以切换画质(主机收到新的画质请求)。Mac 客户端不依赖这条消息,此前即正常。
|
||||
- Device capability is now sent in the official nested shape (and `sender_para_info` is added), so the iPhone client unlocks
|
||||
quality and chroma choices. Verified with the UU iPhone app 4.42.0.
|
||||
|
||||
### 其他 / Other
|
||||
- 控制端窗口与主机使用同一图标,并新增控制端启动项 `contrib/desktop/uu-remote-linux-viewer.desktop`(#13)。
|
||||
|
||||
### 下载 / Download
|
||||
`uu-remote-linux-v0.2.10-x86_64-linux.tar.gz`(主机 `uuremote-server` + 控制端 `uuremote-viewer`,附带 `contrib/`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.10`。
|
||||
|
||||
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
|
||||
+58
-22
@@ -27,21 +27,49 @@ pub fn h264_device_capability(
|
||||
fps: i32,
|
||||
codec_impl: i32,
|
||||
) -> Value {
|
||||
device_capability(client_id, ice_id, display_id, fps, codec_impl, false)
|
||||
device_capability(client_id, ice_id, display_id, fps, codec_impl, false, false)
|
||||
}
|
||||
|
||||
pub fn device_capability(client_id: &str, ice_id: &str, display_id: i32, fps: i32, codec_impl: i32, hevc: bool) -> Value {
|
||||
let mut codecs = vec![json!({"video_codec": VIDEO_CODEC_H264, "chroma_sampling": 1,
|
||||
"codec_impl": codec_impl, "bit_depth": 8})];
|
||||
// Official VideoCodecCapability::SerializeJson uses the same fields for CodecType H265=2.
|
||||
if hevc { codecs.push(json!({"video_codec": 2, "chroma_sampling": 1, "codec_impl": codec_impl, "bit_depth": 8})); }
|
||||
/// Shape of the official Windows host's `forward_setting` (observed from a live 4.37 host):
|
||||
/// `{client_id, data: {device_capability: {display_info, ice_id, video_codec_capability}, type}}`.
|
||||
/// The payload sits under `data.device_capability` with `type` beside it. The earlier flat shape
|
||||
/// (`type` at the top, fields directly in `data`) was not recognised by the iPhone client, which
|
||||
/// then kept quality and chroma locked at their defaults (#49). Only 8-bit and the chroma formats
|
||||
/// the encoder really produces are listed; the first entry carries the maximum size as officially.
|
||||
pub fn device_capability(client_id: &str, ice_id: &str, display_id: i32, fps: i32, codec_impl: i32, hevc: bool, full_chroma: bool) -> Value {
|
||||
let mut codecs = Vec::new();
|
||||
for codec in [VIDEO_CODEC_H264].into_iter().chain(hevc.then_some(2)) {
|
||||
for chroma in [1].into_iter().chain(full_chroma.then_some(3)) {
|
||||
let (width, height) = if codecs.is_empty() { (3840, 2160) } else { (0, 0) };
|
||||
codecs.push(json!({"video_codec": codec, "chroma_sampling": chroma, "codec_impl": codec_impl,
|
||||
"bit_depth": 8, "width": width, "height": height}));
|
||||
}
|
||||
}
|
||||
json!({
|
||||
"client_id": client_id,
|
||||
"type": "device_capability",
|
||||
"data": {
|
||||
"display_info": [{"id": display_id, "fps": fps, "type": 0, "hdr": 0}],
|
||||
"video_codec_capability": codecs,
|
||||
"ice_id": ice_id
|
||||
"device_capability": {
|
||||
"display_info": [{"id": display_id, "fps": fps, "type": 0, "hdr": -1}],
|
||||
"video_codec_capability": codecs,
|
||||
"ice_id": ice_id
|
||||
},
|
||||
"type": "device_capability"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Official `sender_para_info` (capture and encoder names; the Windows host sends "DXGI" /
|
||||
/// "NVIDIA NVENC") for the single video track.
|
||||
pub fn sender_para_info(client_id: &str, ice_id: &str, capture_impl: &str, encoder_impl: &str) -> Value {
|
||||
json!({
|
||||
"client_id": client_id,
|
||||
"data": {
|
||||
"sender_para_info": {
|
||||
"capture_impl": capture_impl, "encoder_impl": encoder_impl, "ice_id": ice_id,
|
||||
"sender_media_infos": [{"capture_impl": capture_impl, "encoder_impl": encoder_impl, "video_track_index": 0}],
|
||||
"video_track_index": 0
|
||||
},
|
||||
"type": "sender_para_info"
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -51,12 +79,20 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn hevc_capability_uses_official_codec_enum_and_420_only() {
|
||||
let payload = device_capability("client-example", "ice-example", 0, 60, 5, true);
|
||||
assert_eq!(payload["data"]["video_codec_capability"], json!([
|
||||
{"video_codec":1,"chroma_sampling":1,"codec_impl":5,"bit_depth":8},
|
||||
{"video_codec":2,"chroma_sampling":1,"codec_impl":5,"bit_depth":8}]));
|
||||
assert_eq!(device_capability("c", "i", 0, 60, 5, false)["data"]["video_codec_capability"].as_array().unwrap().len(), 1);
|
||||
fn capability_uses_the_official_nested_shape_and_real_formats() {
|
||||
let payload = device_capability("client-example", "ice-example", 0, 60, 5, true, true);
|
||||
assert_eq!(payload["data"]["type"], "device_capability");
|
||||
assert!(payload.get("type").is_none());
|
||||
let caps = &payload["data"]["device_capability"]["video_codec_capability"];
|
||||
assert_eq!(caps.as_array().unwrap().len(), 4);
|
||||
assert_eq!(caps[0], json!({"video_codec":1,"chroma_sampling":1,"codec_impl":5,"bit_depth":8,"width":3840,"height":2160}));
|
||||
assert_eq!(caps[3], json!({"video_codec":2,"chroma_sampling":3,"codec_impl":5,"bit_depth":8,"width":0,"height":0}));
|
||||
assert_eq!(payload["data"]["device_capability"]["display_info"][0]["hdr"], -1);
|
||||
let h264_420 = device_capability("c", "i", 0, 60, 5, false, false);
|
||||
assert_eq!(h264_420["data"]["device_capability"]["video_codec_capability"].as_array().unwrap().len(), 1);
|
||||
let sender = sender_para_info("c", "i", "X11", "NVIDIA NVENC");
|
||||
assert_eq!(sender["data"]["type"], "sender_para_info");
|
||||
assert_eq!(sender["data"]["sender_para_info"]["sender_media_infos"][0]["encoder_impl"], "NVIDIA NVENC");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -71,15 +107,15 @@ mod tests {
|
||||
#[test]
|
||||
fn device_capability_uses_object_data_and_string_ice_id() {
|
||||
let payload = h264_device_capability("client-example", "ice-example", 11, 60, 0);
|
||||
assert_eq!(payload["type"], "device_capability");
|
||||
assert!(payload["data"].is_object());
|
||||
assert_eq!(payload["data"]["ice_id"], "ice-example");
|
||||
let display = &payload["data"]["display_info"][0];
|
||||
let capability = &payload["data"]["device_capability"];
|
||||
assert!(capability.is_object());
|
||||
assert_eq!(capability["ice_id"], "ice-example");
|
||||
let display = &capability["display_info"][0];
|
||||
assert_eq!(display.as_object().unwrap().len(), 4);
|
||||
assert_eq!(display["id"], 11);
|
||||
assert_eq!(display["fps"], 60);
|
||||
let codec = &payload["data"]["video_codec_capability"][0];
|
||||
assert_eq!(codec.as_object().unwrap().len(), 4);
|
||||
let codec = &capability["video_codec_capability"][0];
|
||||
assert_eq!(codec.as_object().unwrap().len(), 6);
|
||||
assert_eq!(codec["video_codec"], 1);
|
||||
assert_eq!(codec["codec_impl"], 0);
|
||||
assert_eq!(codec["bit_depth"], 8);
|
||||
|
||||
+18
-1
@@ -177,10 +177,27 @@ impl WebRtcSession {
|
||||
tokio::spawn(async move {
|
||||
let ctx = ctx.lock().await.clone();
|
||||
if let (Some(client), Some(ice)) = (&ctx.client_id, ctx.ice_id.as_ref().and_then(|v| v.as_str())) {
|
||||
let payload = crate::capability::device_capability(client, ice, 0, crate::video::display_fps() as i32, 5, hevc);
|
||||
let encoder = crate::video::Encoder::requested();
|
||||
let codec_impl = if encoder == crate::video::Encoder::Nvenc { crate::capability::CODEC_IMPL_NVENC } else { 5 };
|
||||
let payload = crate::capability::device_capability(client, ice, 0, crate::video::display_fps() as i32, codec_impl,
|
||||
hevc, crate::video::full_chroma_available());
|
||||
if let Err(e) = sig.emit_event(crate::capability::FORWARD_SETTING_EVENT, payload).await {
|
||||
log::error!("Device capability notification failed: {}", e);
|
||||
}
|
||||
let capture_impl = match crate::desktop_backend::detect() {
|
||||
Ok(crate::desktop_backend::DesktopBackend::Portal) => "PipeWire",
|
||||
Ok(crate::desktop_backend::DesktopBackend::Wayland) => "Wayland",
|
||||
_ => "X11",
|
||||
};
|
||||
let encoder_impl = match encoder {
|
||||
crate::video::Encoder::Nvenc => "NVIDIA NVENC",
|
||||
crate::video::Encoder::Vaapi => "VAAPI",
|
||||
crate::video::Encoder::Cpu => "Software",
|
||||
};
|
||||
if let Err(e) = sig.emit_event(crate::capability::FORWARD_SETTING_EVENT,
|
||||
crate::capability::sender_para_info(client, ice, capture_impl, encoder_impl)).await {
|
||||
log::error!("Sender parameter notification failed: {}", e);
|
||||
}
|
||||
if let Some(control) = ctx.app_control_id.as_ref().and_then(|v| v.as_str()) {
|
||||
if let Err(e) = sig.emit_event(crate::capability::ICE_FINISHED_EVENT,
|
||||
crate::capability::ice_finished(ice, control)).await {
|
||||
|
||||
Reference in new issue
Block a user