Skip to main content

ace_player/decoder/
video.rs

1//! Video decode — stub for Phase 1. Full ffmpeg-next integration in Phase 2.
2use anyhow::Result;
3use tokio::sync::mpsc::Sender;
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct VideoFrame {
8    pub pts_ms: u64,
9    pub width: u32,
10    pub height: u32,
11    /// Raw RGBA pixel data
12    pub data: Vec<u8>,
13}
14
15/// Decode video stream and send frames to channel.
16/// Phase 1: stub implementation.
17/// Phase 2: integrate ffmpeg-next for H.264/H.265/AV1 decode.
18pub async fn decode_stream(source: String, tx: Sender<VideoFrame>) -> Result<()> {
19    tracing::info!("Video decode started for: {source}");
20
21    // Phase 1 stub — signals completion immediately
22    // Replace with ffmpeg-next demux + decode loop in Phase 2
23    tracing::warn!("Video decode not yet implemented — awaiting ffmpeg-next integration");
24
25    drop(tx); // Signal end of stream
26    Ok(())
27}