49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
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 |