from dataclasses import dataclass
from typing import List

from app.data_structures.time_interval import VideoTimeInterval


@dataclass
class DetectedMotion:
    """
    Represents a detected motion in a video.
    frame_time_msec: time of the frame in milliseconds
    has_motion: flag which indicates whether the frame has motion or not
    """

    frame_time_msec: float
    has_motion: bool


@dataclass
class MotionDetectionResult:
    """
    Represents the result of motion detection.
    motions: list of detected motions
    interval: time interval of the motion
    """

    motions: List[DetectedMotion]
    interval: VideoTimeInterval
