normalize media pipeline at client boundary

- AudioParams.framing field: client declares "raw" or "adts"
- Client strips ADTS from audio before sending (strip_adts)
- Client does H.264 NAL inspection for keyframe detection (h264_is_keyframe)
- Server uses declared sample_rate/channels for ADTS synthesis instead of hardcoded 48kHz/stereo
- Server gates ADTS wrapping on framing field instead of per-packet sniffing

New backends only need to pipe output to demux_and_send() — server and Python unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 13:51:11 -03:00
parent e92ab933ce
commit e9e1d14e6b
5 changed files with 102 additions and 20 deletions

View File

@@ -98,9 +98,9 @@ async fn handle_client(
info!("control: {ctrl:?}");
match ctrl {
ControlMessage::SessionStart { id, video, .. } => {
ControlMessage::SessionStart { id, video, audio } => {
let s = tokio::task::block_in_place(|| {
Session::start(&id, &sessions_dir, video.fps)
Session::start(&id, &sessions_dir, video.fps, &audio)
})?;
session = Some(s);
}