TASK 21 slice 2b: native-FPS pacing in MediaVideoSource (probe -> delay seam)
- MediaVideoSource takes optional IFrameRateProbe? + Func<TimeSpan,CancellationToken,Task>? delay seams (default Task.Delay); probes FPS once in RunAsync, delays by 1/fps after each emitted frame. No probe/unknown fps -> no pacing (ffmpeg pipe backpressure throttles). - Test: MediaVideoSource_PacesFramesByProbedFps (fake probe returns 1000fps + recording delay; one delay per frame ~= 1ms). Media tests 5/5, build 0 warnings. Derivative reference: per-frame delay pacing of decoded output, standard in media playback.
This commit is contained in:
+9
-6
@@ -56,11 +56,14 @@ subprocess text, null if ffprobe absent), and `FfmpegLocator.ProbeFileName`
|
||||
(`ffprobe.exe`) + conditional extraction alongside ffmpeg.exe. Tests:
|
||||
`ytLive.Tests/FfmpegFrameRateParserTests.cs` (6 pure units + 1 probe integration
|
||||
via fake locator/process); `FfmpegLocatorTests` still green — 15/15 pass, build
|
||||
0 warnings. **Next wiring step (slice 2b):** inject the probe + a pacing delay
|
||||
seam into `MediaVideoSource` and pace `FrameAvailable` by 1/fps.
|
||||
0 warnings. Slice 2b shipped too: `MediaVideoSource` now takes optional
|
||||
`IFrameRateProbe?` + `Func<TimeSpan,CancellationToken,Task>? delay` seams,
|
||||
probes FPS once in `RunAsync`, and paces each emitted frame by 1/fps (unknown/
|
||||
absent probe → no pacing). New test `MediaVideoSource_PacesFramesByProbedFps`
|
||||
(fake probe + recording delay, one delay per frame ≈1ms). Media tests 5/5,
|
||||
build 0 warnings.
|
||||
|
||||
Next (slice 2b): wire the probe into `MediaVideoSource` for native-FPS pacing.
|
||||
Slice 3: loop control (restart decode on `Completed` when `MediaIsLooping`).
|
||||
Next (slice 3): loop control (restart decode on `Completed` when `MediaIsLooping`).
|
||||
|
||||
**Landmine:** a stale `testhost` can lock `ytLive.Tests`'s `ytLive.dll` and break
|
||||
`dotnet build` of the test project — kill it first (`cmd.exe /c "taskkill /PID N /F"`)
|
||||
@@ -70,8 +73,8 @@ pure tests run in WSL; user verifies the GUI suites on native Windows PowerShell
|
||||
|
||||
## Next
|
||||
|
||||
1. Commit slice 2a (this unit): ffprobe extraction + parser + probe seam + tests + docs.
|
||||
2. Slice 2b: wire the probe into `MediaVideoSource` for native-FPS pacing (delay seam + tests).
|
||||
1. Commit slice 2b (this unit): native-FPS pacing in `MediaVideoSource` + pacing test + docs.
|
||||
2. Slice 3: loop control (restart decode on `Completed` when `MediaIsLooping`).
|
||||
3. Slice 3: loop control (restart decode on `Completed` when `MediaIsLooping`).
|
||||
4. UI picker slice: acquire/release media sessions on add/remove (the remaining slice-1-step-4 open end).
|
||||
5. Await user push checkpoint for the pending TASK 22/21 commits.
|
||||
|
||||
Reference in New Issue
Block a user