"""Base class for OCR processors."""

from abc import ABC
from mini_videorag.core.processor import BaseVideoProcessor


class BaseOCRProcessor(BaseVideoProcessor, ABC):
    """
    Abstract base class for OCR processors.

    All OCR implementations should inherit from this class.
    This provides a common interface while allowing different providers
    (EasyOCR, Tesseract, Google Vision API, AWS Textract, etc.).

    Attributes:
        name: Should be "ocr" for all implementations
        is_frame_based: True (OCR analyzes per frame)
    """

    is_frame_based = True  # OCR produces one result per frame

    @property
    def name(self) -> str:
        """All OCR processors use the same identifier."""
        return "ocr"

    @property
    def requires_audio(self) -> bool:
        """OCR doesn't require audio."""
        return False

    @property
    def requires_video(self) -> bool:
        """OCR requires video frames."""
        return True
