Skip to content

Commit a5d2e38

Browse files
sjmfclaude
andcommitted
Propagate actual camera dimensions from setCamera() to worker
After setCamera() opens the device, update the worker's camera_width and camera_height from the actual frame dimensions rather than relying on values from enumeration which may be incorrect on Windows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 615a664 commit a5d2e38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kvm_serial/kvm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ def _capture_frame(self):
136136
try:
137137
self.video_device.setCamera(self.video_device_idx)
138138
self.camera_initialised = True
139+
# Update dimensions from actual camera output
140+
if hasattr(self.video_device, "camera_width"):
141+
self.camera_width = self.video_device.camera_width
142+
self.camera_height = self.video_device.camera_height
143+
logging.info(
144+
f"Camera actual dimensions: {self.camera_width}x{self.camera_height}"
145+
)
139146
except Exception as e:
140147
error_msg = f"Failed to initialize camera {self.video_device_idx}: {e}"
141148
logging.error(error_msg)

0 commit comments

Comments
 (0)