new camera handling concept

This commit is contained in:
2025-09-18 20:14:12 +02:00
parent 2187536c7d
commit 6d616fd15e
7 changed files with 384 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
from abc import ABC, abstractmethod
class BaseCamera(ABC):
"""Interfejs wspólny dla wszystkich backendów kamer."""
@abstractmethod
def connect(self) -> bool:
"""Nawiązuje połączenie z urządzeniem."""
raise NotImplementedError
@abstractmethod
def disconnect(self):
"""Zamyka połączenie z urządzeniem."""
raise NotImplementedError
@abstractmethod
def start_stream(self):
"""Rozpocznij strumień wideo."""
raise NotImplementedError
@abstractmethod
def stop_stream(self):
"""Zatrzymaj strumień wideo."""
raise NotImplementedError
@abstractmethod
def get_frame(self):
"""Pobierz jedną klatkę liveview."""
raise NotImplementedError
@abstractmethod
def capture_photo(self):
"""Zrób zdjęcie."""
raise NotImplementedError
@abstractmethod
def record_video(self):
"""Nagraj film."""
raise NotImplementedError
@abstractmethod
def get_available_settings(self) -> dict:
"""Zwraca słownik dostępnych ustawień i ich możliwych wartości."""
raise NotImplementedError
@abstractmethod
def set_setting(self, name: str, value) -> bool:
"""Ustawia wybraną wartość dla danego ustawienia."""
raise NotImplementedError