kimi修复画面延迟

This commit is contained in:
i
2026-04-22 17:09:57 +08:00
parent d102e1d51b
commit b8be62ec08
2 changed files with 9 additions and 9 deletions
+3 -1
View File
@@ -18,4 +18,6 @@ build/
__pycache__/
nuitka_dist/
nuitka_dist/
test.py
+6 -8
View File
@@ -736,7 +736,7 @@ class CameraWorker(QThread):
while self._running:
try:
frames = pipeline.wait_for_frames(100)
frames = pipeline.wait_for_frames(500)
if frames is None:
now = time.monotonic()
if now - stream_started_at < _DISCONNECT_STARTUP_GRACE_SEC:
@@ -827,11 +827,6 @@ class CameraWorker(QThread):
f"等待帧同步…RGB-D 差 {ts_diff}ms({self._sync_wait_count}/10)")
continue
# 预览节流要前置,避免先做重计算再丢帧导致累积延迟
now = time.monotonic()
if now - self._last_emit_ts < 0.033:
continue
# 预览
# HDR merge:用 merged 帧集替换深度帧
display_frames = frames
@@ -877,8 +872,11 @@ class CameraWorker(QThread):
depth_scale = df.get_depth_scale()
depth_vis = depth_to_vis(depth_data, depth_scale)
self._last_emit_ts = time.monotonic()
self.preview_ready.emit(color_bgr, depth_vis)
now = time.monotonic()
if now - self._last_emit_ts >= 0.033:
self._last_emit_ts = now
self.preview_ready.emit(color_bgr.copy(), depth_vis.copy())
except Exception as exc:
if self._running: