new camera handling concept
This commit is contained in:
49
core/camera/base_camera.py
Normal file
49
core/camera/base_camera.py
Normal 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
|
||||
Reference in New Issue
Block a user