kimi修复画面延迟
This commit is contained in:
+3
-1
@@ -18,4 +18,6 @@ build/
|
|||||||
|
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|
||||||
nuitka_dist/
|
nuitka_dist/
|
||||||
|
|
||||||
|
test.py
|
||||||
@@ -736,7 +736,7 @@ class CameraWorker(QThread):
|
|||||||
|
|
||||||
while self._running:
|
while self._running:
|
||||||
try:
|
try:
|
||||||
frames = pipeline.wait_for_frames(100)
|
frames = pipeline.wait_for_frames(500)
|
||||||
if frames is None:
|
if frames is None:
|
||||||
now = time.monotonic()
|
now = time.monotonic()
|
||||||
if now - stream_started_at < _DISCONNECT_STARTUP_GRACE_SEC:
|
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)")
|
f"等待帧同步…RGB-D 差 {ts_diff}ms({self._sync_wait_count}/10)")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# 预览节流要前置,避免先做重计算再丢帧导致累积延迟
|
|
||||||
now = time.monotonic()
|
|
||||||
if now - self._last_emit_ts < 0.033:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# 预览
|
# 预览
|
||||||
# HDR merge:用 merged 帧集替换深度帧
|
# HDR merge:用 merged 帧集替换深度帧
|
||||||
display_frames = frames
|
display_frames = frames
|
||||||
@@ -877,8 +872,11 @@ class CameraWorker(QThread):
|
|||||||
depth_scale = df.get_depth_scale()
|
depth_scale = df.get_depth_scale()
|
||||||
|
|
||||||
depth_vis = depth_to_vis(depth_data, 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:
|
except Exception as exc:
|
||||||
if self._running:
|
if self._running:
|
||||||
|
|||||||
Reference in New Issue
Block a user