chore: remove obsolete TODO(#19) and dead _fps binding
Cleanup pass after the latency investigation concluded: - state_portal.rs: remove TODO(#19) comment block (17 lines). The Option A upgrade path was tentatively documented during the #19 fix, but the user decided to accept current latency behavior. The TODO is now noise. - state.rs:605: remove 'let _fps = self.args.fps as i64;' dead binding left over from #25 time_base change. The variable became unused when PTS formula switched from fps-multiplier to literal 90_000, and was renamed to _fps to silence the warning. Removing it entirely is cleaner. No behavior change. Build clean (0 new warnings). All 96+96+3 tests pass.
This commit is contained in:
@@ -602,7 +602,6 @@ impl<S: CaptureSource> State<S> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let _fps = self.args.fps as i64;
|
|
||||||
// PTS in 90kHz media-clock ticks (WebRTC encoder time_base = 1/90000).
|
// PTS in 90kHz media-clock ticks (WebRTC encoder time_base = 1/90000).
|
||||||
// Must match Portal path's compute_capture_pts unit. See issue #25.
|
// Must match Portal path's compute_capture_pts unit. See issue #25.
|
||||||
let pts = (tv_sec as i64) * 90_000 + (tv_usec as i64) * 90_000 / 1_000_000;
|
let pts = (tv_sec as i64) * 90_000 + (tv_usec as i64) * 90_000 / 1_000_000;
|
||||||
|
|||||||
@@ -176,23 +176,6 @@ impl StatePortal {
|
|||||||
|
|
||||||
match self.stage {
|
match self.stage {
|
||||||
PortalStage::WaitingForFormat => {
|
PortalStage::WaitingForFormat => {
|
||||||
// TODO(#19): Currently the encoder initializes on first PipeWire frame,
|
|
||||||
// even in WebRTC mode before any client connects. The recurring 60fps
|
|
||||||
// idle waste (DMA-BUF import + VAAPI scale + clone + channel send) is
|
|
||||||
// eliminated by the paused gate in handle_pw_frame (see #19 fix).
|
|
||||||
// However, the one-time SwEncEncode::new_webrtc cost (~50ms, swscale
|
|
||||||
// context + x264 setup + YUV frame allocation) still occurs at startup.
|
|
||||||
//
|
|
||||||
// If this startup cost becomes user-perceptible, upgrade to "Option A":
|
|
||||||
// 1. Add PortalStage::AwaitingClient
|
|
||||||
// 2. Keep WebRtcState on main thread during AwaitingClient, pump
|
|
||||||
// handle_signaling/poll_and_feed from main loop
|
|
||||||
// 3. On is_connected() == true, initialize encoder and move WebRtcState
|
|
||||||
// into the WebRTC thread
|
|
||||||
// 4. Use resolution-aware conservative default bitrate (see #21)
|
|
||||||
//
|
|
||||||
// Trigger condition: user reports perceivable latency or CPU spike at
|
|
||||||
// startup. Until then, Option B is sufficient.
|
|
||||||
tracing::info!(
|
tracing::info!(
|
||||||
"First DMA-BUF frame: {}x{} format=0x{:08X} stride={} modifier=0x{:X}",
|
"First DMA-BUF frame: {}x{} format=0x{:08X} stride={} modifier=0x{:X}",
|
||||||
frame.width,
|
frame.width,
|
||||||
|
|||||||
Reference in New Issue
Block a user