Desktop encode + discovery hardening - #22
Merged
Merged
Conversation
OpenH264 was configured as CameraVideoRealTime while encoding desktop frames — ScreenContentRealTime tunes mode decisions for text and sharp edges. Adaptive quantization and background detection are unsupported for screen content and now set off explicitly (upstream disabled them with a warning anyway). BGRA→I420 now runs through the encoder crate's own strided-source converter (BGRA8Source over RawFrame), which dispatches to AVX2 at runtime on x86-64: ~1.7 ms vs ~5.9 ms per 1080p frame measured — about 4 ms off the capture→encode path — with box-averaged chroma and no new dependency. Padded strides are honored directly; non-pixel strides fall back to the scalar path. Regression tests cover SIMD vs scalar equivalence and stride padding. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Every accepted socket spawned a task with an 8 KiB read buffer and a 10 s timeout — cheap per connection, but unbounded in count, so a connection flood could exhaust FDs. A semaphore now caps held connections (Limits::max_conns, default 1024); excess sockets are accepted and dropped immediately. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
control_rtt_ms used 0 as the "not measured" sentinel, so a heartbeat echo that landed within the same millisecond — normal on loopback and fast runners — read back as `None` and flaked `input_acks_and_heartbeat_roundtrip` on macOS CI. `u64::MAX` is now the sentinel; 0 is a real RTT. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rds-desktop: OpenH264 switched toScreenContentRealTime(correct usage type for desktop content); adaptive-quantization/background-detection set off explicitly — upstream disables them with a warning under screen content anyway.rds-desktop: BGRA→I420 now uses the encoder crate's own strided-source converter (BGRA8SourceoverRawFrame) which dispatches to AVX2 at runtime — measured ~1.7 ms vs ~5.9 ms per 1080p frame (~3.5×), honoring arbitrary strides with no intermediate copy and no new dependency. Scalar fallback kept for non-pixel strides; regression tests cover SIMD-vs-scalar equivalence and padded-stride correctness.rds-discovery:Limits::max_conns(default 1024) caps concurrently held connections — a connection flood can no longer exhaust tasks/FDs; excess sockets close on accept.Test plan
cargo test -p rds-desktop --features x11— 4/4 codec tests incl. newsimd_conversion_matches_scalar+strided_input_ignores_paddingcargo test --workspace --all-targets --all-features— 0 failurescargo clippy --workspace --all-targets --all-features -D warnings— cleancargo fmt --check/cargo machete— cleanGenerated with Devin