"""
Abstract base class for video transport implementations.

Defines the interface that both Daily.co and LiveKit transports must implement.
"""

from abc import ABC, abstractmethod
from typing import Optional
from PIL import Image


class BaseTransport(ABC):
    """
    Abstract interface for video transport backends.

    All transport implementations (Daily.co, LiveKit) must implement these methods
    to provide consistent video streaming capabilities for the screenshare bot.
    """

    @abstractmethod
    async def join_room(self) -> None:
        """
        Connect to the video room.

        Raises:
            Exception: If connection fails
        """
        pass

    @abstractmethod
    async def send_image(self, image: Image.Image) -> None:
        """
        Send a video frame to the room.

        Args:
            image: PIL Image in RGB or RGBA format (1280x720)

        Raises:
            Exception: If frame send fails
        """
        pass

    @abstractmethod
    async def cleanup(self) -> None:
        """
        Disconnect from room and release resources.

        Should be safe to call multiple times.
        """
        pass
