feat(egfx): add MS-RDPEGFX Graphics Pipeline Extension#1057
feat(egfx): add MS-RDPEGFX Graphics Pipeline Extension#1057Benoît Cortier (CBenoit) merged 7 commits intoDevolutions:masterfrom
Conversation
9b7cf29 to
b9fd104
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a complete MS-RDPEGFX (Graphics Pipeline Extension) implementation to IronRDP, enabling H.264 AVC420/AVC444 video streaming over RDP. The implementation includes:
- PDU layer: All 23 RDPGFX PDU types with encode/decode support, capability sets V8-V10.7, and AVC420/AVC444 codecs
- Server implementation: Multi-surface management, frame tracking with flow control, capability negotiation, AVC frame transmission, QoE metrics, cache import, resize handling, and backpressure management
- Client scaffolding: Basic DVC processor with capability advertisement and PDU handling hooks
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-egfx/src/server.rs | Complete server-side implementation with surface manager, frame tracker, capability negotiation, and AVC420/AVC444 frame sending |
| crates/ironrdp-egfx/src/pdu/cmd.rs | All 23 RDPGFX PDU definitions with encode/decode implementations |
| crates/ironrdp-egfx/src/pdu/avc.rs | AVC-specific utilities including Annex B to AVC conversion, region handling, and bitmap stream encoding |
| crates/ironrdp-egfx/src/pdu/common.rs | Common PDU types (Point, Color, PixelFormat) |
| crates/ironrdp-egfx/src/pdu/mod.rs | PDU module organization and exports |
| crates/ironrdp-egfx/src/client.rs | Client DVC processor with decompression and capability advertisement |
| crates/ironrdp-egfx/src/lib.rs | Crate root with module declarations |
| crates/ironrdp-egfx/Cargo.toml | Package configuration with dependencies |
| crates/ironrdp-egfx/CHANGELOG.md | Initial changelog for v0.1.0 |
| crates/ironrdp-egfx/README.md | Crate documentation |
| Cargo.lock | Workspace lock file update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Remove redundant code in annex_b_to_avc() function. The previous logic: - Set i = start + (end - start), which simplifies to i = end - Then conditionally set i = end again (always redundant) Now simply: i = end with a clarifying comment. Addresses Copilot review feedback on PR Devolutions#1057. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove redundant code in annex_b_to_avc() function. The previous logic: - Set i = start + (end - start), which simplifies to i = end - Then conditionally set i = end again (always redundant) Now simply: i = end with a clarifying comment. Addresses Copilot review feedback on PR Devolutions#1057.
e8db418 to
cc6eb7e
Compare
Benoît Cortier (CBenoit)
left a comment
There was a problem hiding this comment.
This is looking good overall, although I didn’t review everything yet. Do you think you could feed Claude with the STYLE.md file and see whether it updates the code in a sensible way?
|
OK sure I'll go ahead and work on it. Thanks. OK actually this isn't as bad as I worried it was. Working on these different code divisions has me regularly confused, but thsi is done mostly correctly. So I'll push my updates right away as they're small. I've got this work that (potentially like this PR) I want to submit here, and then I've got my own open source crates, then I've got 2 products, one of which is non-commercial use only glue as an RDP server, then I've got my compositor/VDI/headless product , so I have different API surfaces and rules whichI thought I messed up here on that font, but it looks ok. Thanks again. And regarding style, there are really no significant discrepancies in regard to what's published. I'm glad to hear any comments you have regardless. |
I actually have a new thing that I'm working on. I literally threw this all together to get it to you, but let me make it a little more sensible and understandable. I'll push another commit after finishing. Stay tuned. |
|
I think this is pretty decent now, so please go ahead and review it at your leisure. Thanks. |
|
Hi, Happy New Year! I hope you can get to this soon, but it may be easier to knock out my other little PRs first. |
Hi, thank you, Happy New Year! I’ll proceed exactly like that 👍 I’ve been busy with the usual post-vacation tasks, but I’m getting to it. |
|
Benoît Cortier (@CBenoit) Great, thanks. I've got some other fixes in my queue but I wanted to give you a chance to catch up! |
Remove redundant code in annex_b_to_avc() function. The previous logic: - Set i = start + (end - start), which simplifies to i = end - Then conditionally set i = end again (always redundant) Now simply: i = end with a clarifying comment. Addresses Copilot review feedback on PR Devolutions#1057.
|
Benoît Cortier (@CBenoit) I'm sure you're busy, but I really hope you can get to this and my other work soon. |
Add complete MS-RDPEGFX implementation with PDU types and server logic. PDU layer (based on work by @elmarco in Devolutions#648): - All 23 RDPGFX PDUs (WireToSurface, CreateSurface, ResetGraphics, etc.) - Capability sets V8 through V10.7 - AVC420/AVC444 bitmap stream codecs - Timestamp, QuantQuality, and supporting types Server implementation: - Multi-surface management (Offscreen Surfaces ADM element) - Frame tracking with flow control (Unacknowledged Frames ADM element) - V8/V8.1/V10/V10.1-V10.7 capability negotiation - AVC420 and AVC444 frame sending - QoE metrics processing - Cache import handling - Resize coordination - Backpressure via client queue depth Client-side DVC processor (from Devolutions#648): - Basic message processing scaffolding Credits: @elmarco for PDU definitions and protocol research in PR Devolutions#648.
Remove erroneous reserved field from FIXED_PART_SIZE. Per MS-RDPEGFX 2.2.2.23, this PDU has no reserved field (unlike MapSurfaceToScaledOutputPdu).
Remove redundant code in annex_b_to_avc() function. The previous logic: - Set i = start + (end - start), which simplifies to i = end - Then conditionally set i = end again (always redundant) Now simply: i = end with a clarifying comment. Addresses Copilot review feedback on PR Devolutions#1057.
- Use shrink_to pattern for decompressed buffer memory management - Change CHANNEL_NAME to pub(crate) visibility - Move tests to ironrdp-testsuite-core using only public API
server.rs: - Rename SurfaceManager to Surfaces for directness - Remove redundant comments that restate code - Add strategic comments explaining protocol requirements - Reduce excessive debug logging to critical points only - Rename variables for domain clarity (encoded_stream, target_rect) - Use idiomatic ? operator instead of verbose let...else pdu/cmd.rs, pdu/common.rs: - Fix 27 rustdoc warnings for bare URLs - Convert to proper markdown link references All tests pass, zero clippy warnings, zero rustdoc warnings.
7e269d0 to
5429bbe
Compare
ironrdp-dvc 0.4→0.5, ironrdp-graphics 0.6→0.7, ironrdp-pdu 0.6→0.7 to match the version bump in upstream release v0.14.0.
crates/ironrdp-egfx/CHANGELOG.md
Outdated
There was a problem hiding this comment.
note: We need to update that before publishing
There was a problem hiding this comment.
Benoît Cortier (@CBenoit) ok thanks. I'm working now to address all the copilot-discovered issues as well as this one.
-Greg
Benoît Cortier (CBenoit)
left a comment
There was a problem hiding this comment.
I’m really sorry for all the waiting. I went through the PR, and it looks good! Thank you! 🙏
Just waiting for Copilot to see if I missed something 👀
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 16 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…U encoding Correct error field name in ResetGraphicsPdu decode validation. Add ensure_size guards to MapSurfaceToWindow, MapSurfaceToScaledOutput, and MapSurfaceToScaledWindow encode impls for consistency with other PDUs. Intersect client and server flags during capability negotiation instead of returning server flags verbatim. Use client's highest-priority capability as fallback when no version overlaps with server preferences. Validate monitor count in resize_with_monitors. Add debug assertions for surface ID allocation and AVC420 rectangle/quant_qual_vals length invariant. Reject reserved encoding value in Avc444BitmapStream decode. Update CHANGELOG to use Unreleased heading.
25ad0ab to
867dfc9
Compare
|
OK I addressed all those. Thanks. |
|
Swift job! Thank you! |
300f9a3
into
Devolutions:master
Complete MS-RDPEGFX implementation with PDU types and server logic. Supercedes #648.
Summary
Credits
PDU definitions and protocol research from Marc-Andre Lureau (@elmarco) in #648.
Test plan