Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions dlclivegui/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ def _connect_signals(self) -> None:

# Multi-camera controller signals (used for both single and multi-camera modes)
self.multi_camera_controller.frame_ready.connect(self._on_multi_frame_processing_ready)
self.multi_camera_controller.display_ready.connect(self._on_multi_frame_display_ready)
self.multi_camera_controller.all_started.connect(self._on_multi_camera_started)
self.multi_camera_controller.all_stopped.connect(self._on_multi_camera_stopped)
self.multi_camera_controller.camera_error.connect(self._on_multi_camera_error)
Expand Down Expand Up @@ -1702,6 +1701,7 @@ def _on_multi_frame_processing_ready(self, frame_data: MultiFrameData) -> None:
"""
self._multi_camera_frames = frame_data.frames
self._multi_camera_display_ids = frame_data.display_ids or {}
self._display_dirty = True
self._try_start_pending_recording()
src_id = frame_data.source_camera_id
if src_id:
Expand Down Expand Up @@ -1755,15 +1755,6 @@ def _on_multi_frame_processing_ready(self, frame_data: MultiFrameData) -> None:
self._dlc_timing.note_frame()
self._dlc_timing.maybe_log()

def _on_multi_frame_display_ready(self, frame_data: MultiFrameData) -> None:
"""Throttled UI/display path.

Called at GUI_MAX_DISPLAY_FPS, not at camera capture FPS for performance reasons.
"""
self._multi_camera_frames = frame_data.frames
self._multi_camera_display_ids = frame_data.display_ids or {}
self._display_dirty = True

def _on_multi_camera_started(self) -> None:
"""Handle all cameras started event."""
self.preview_button.setEnabled(False)
Expand Down
22 changes: 0 additions & 22 deletions dlclivegui/services/multi_camera_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import copy
import logging
import time
from dataclasses import dataclass
from functools import partial
from threading import Lock
Expand Down Expand Up @@ -183,22 +182,6 @@ def set_recording_frame_is_enabled(self, enabled: bool) -> None:
for worker in list(self._workers.values()):
worker.set_recording_enabled(enabled)

def _should_emit_display_ready(self) -> bool:
"""
Return True if enough time has passed since the last display_ready emission, based on GUI_MAX_DISPLAY_FPS.
"""
if self._gui_display_max_fps <= 0:
return True

now = time.perf_counter()
min_interval = 1.0 / max(self._gui_display_max_fps, 1e-9)

if now - self._gui_display_last_emit < min_interval:
return False

self._gui_display_last_emit = now
return True

def start(self, camera_settings: list[CameraSettings]) -> None:
"""Start multiple cameras."""
if self._running or self._stopping:
Expand Down Expand Up @@ -496,11 +479,6 @@ def _on_frame_captured(
with timing.measure("Multi.emit.frame_ready"):
self.frame_ready.emit(frame_data)

# GUI-only path: throttled display updates
if self._should_emit_display_ready():
with timing.measure("Multi.emit.display_ready"):
self.display_ready.emit(frame_data)

timing.note_frame()
timing.maybe_log()

Expand Down
2 changes: 1 addition & 1 deletion dlclivegui/utils/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def create_tiled_frame(
resized,
label,
(10, 30),
cv2.FONT_HERSHEY_SIMPLEX,
cv2.FONT_HERSHEY_TRIPLEX,
0.7,
(0, 255, 0),
2,
Expand Down
Loading