Files
mediaproc/core/schema/models/source.py
2026-03-30 07:22:14 -03:00

40 lines
1.1 KiB
Python

"""
Media source models.
Describes what types of sources the detection pipeline can process.
Only chunk_job (blobs in MinIO) is implemented now — the rest are
extension points with defined shapes.
"""
from dataclasses import dataclass, field
from enum import Enum
class SourceType(str, Enum):
CHUNK_JOB = "chunk_job" # pre-chunked video segments in blob storage
UPLOAD = "upload" # future: user-uploaded file → MinIO → pipeline
DEVICE = "device" # future: local camera/capture card via ffmpeg (no MinIO)
STREAM = "stream" # future: RTMP/HLS URL via ffmpeg (no MinIO)
@dataclass
class ChunkInfo:
"""A single chunk (video segment) stored in blob storage."""
filename: str
key: str # storage key (MinIO object key)
size_bytes: int
@dataclass
class SourceJob:
"""
A group of chunks that belong together (same source video/session).
Listed by the source selector so the user can pick a job,
then drill into its chunks.
"""
job_id: str
source_type: str # SourceType value
chunk_count: int
total_bytes: int = 0