Skip to content

Commit 7f5cc08

Browse files
authored
Merge pull request #7 from ruscher/main
New version full fix
2 parents 8f56464 + 60ec7a0 commit 7f5cc08

15 files changed

Lines changed: 1433 additions & 92 deletions

pkgbuild/PKGBUILD

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ depends=(
1313
'gst-plugin-gtk4'
1414
'ffmpeg'
1515
'v4l-utils'
16+
'gphoto2'
17+
'v4l2loopback-dkms'
18+
'x264'
19+
'pipewire'
1620
)
1721
optdepends=(
18-
'gphoto2: DSLR/mirrorless camera support'
19-
'libcamera: CSI/ISP camera support'
20-
'pipewire: PipeWire virtual camera support'
21-
'v4l2loopback-dkms: Virtual camera output'
22-
'x264: Video recording (H.264)'
22+
'libcamera: CSI/ISP camera support (Raspberry Pi, Intel IPU6)'
23+
'python-aiohttp: phone camera via WebSocket'
24+
'python-qrcode: QR code generation for phone camera'
2325
)
2426
pkgver=$(date +%y.%m.%d)
2527
pkgrel=$(date +%H%M)

usr/share/biglinux/bigcam/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class BackendType(enum.Enum):
2020
LIBCAMERA = "libcamera"
2121
PIPEWIRE = "pipewire"
2222
IP = "ip"
23+
PHONE = "phone"
2324

2425

2526
class ControlCategory(enum.Enum):

usr/share/biglinux/bigcam/core/camera_manager.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ def _worker() -> None:
101101
threading.Thread(target=_worker, daemon=True).start()
102102

103103
def _on_detection_done(self, cameras: list[CameraInfo]) -> bool:
104+
# Preserve manually-added cameras (IP, phone) across hotplug scans
105+
manual_backends = {BackendType.IP, BackendType.PHONE}
106+
manual_cameras = [c for c in self._cameras if c.backend in manual_backends]
107+
seen_ids = {c.id for c in cameras}
108+
for mc in manual_cameras:
109+
if mc.id not in seen_ids:
110+
cameras.append(mc)
111+
104112
old_ids = {c.id for c in self._cameras}
105113
new_ids = {c.id for c in cameras}
106114
self._cameras = cameras
@@ -120,6 +128,19 @@ def add_ip_cameras(self, entries: list[dict[str, str]]) -> None:
120128
self._cameras.extend(ip_cams)
121129
self.emit("cameras-changed")
122130

131+
def add_phone_camera(self, camera: CameraInfo) -> None:
132+
"""Register a phone camera source (WebRTC)."""
133+
self._cameras = [c for c in self._cameras if c.backend != BackendType.PHONE]
134+
self._cameras.append(camera)
135+
self.emit("cameras-changed")
136+
137+
def remove_phone_camera(self) -> None:
138+
"""Remove phone camera from the list."""
139+
had = any(c.backend == BackendType.PHONE for c in self._cameras)
140+
self._cameras = [c for c in self._cameras if c.backend != BackendType.PHONE]
141+
if had:
142+
self.emit("cameras-changed")
143+
123144
# -- controls proxy ------------------------------------------------------
124145

125146
def get_controls(self, camera: CameraInfo) -> list[CameraControl]:

0 commit comments

Comments
 (0)