Skip to content

feat(egfx): add MS-RDPEGFX Graphics Pipeline Extension#1057

Merged
Benoît Cortier (CBenoit) merged 7 commits intoDevolutions:masterfrom
glamberson:egfx-server-complete
Feb 12, 2026
Merged

feat(egfx): add MS-RDPEGFX Graphics Pipeline Extension#1057
Benoît Cortier (CBenoit) merged 7 commits intoDevolutions:masterfrom
glamberson:egfx-server-complete

Conversation

@glamberson
Copy link
Contributor

@glamberson glamberson commented Dec 16, 2025

Complete MS-RDPEGFX implementation with PDU types and server logic. Supercedes #648.

Summary

  • PDU layer: All 23 RDPGFX PDUs, capability sets V8-V10.7, AVC420/AVC444 codecs
  • Server: Multi-surface management, frame tracking, capability negotiation, AVC420/AVC444 frame sending, QoE metrics, cache import, resize, backpressure
  • Client: Basic DVC processor scaffolding

Credits

PDU definitions and protocol research from Marc-Andre Lureau (@elmarco) in #648.

Test plan

  • All 17 unit tests pass
  • Clippy clean
  • Formatted

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

glamberson pushed a commit to glamberson/IronRDP that referenced this pull request Dec 17, 2025
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>
glamberson pushed a commit to glamberson/IronRDP that referenced this pull request Dec 17, 2025
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.
Copy link
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@glamberson
Copy link
Contributor Author

glamberson commented Dec 17, 2025

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.

@glamberson
Copy link
Contributor Author

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?

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.

@glamberson
Copy link
Contributor Author

I think this is pretty decent now, so please go ahead and review it at your leisure. Thanks.

@glamberson
Copy link
Contributor Author

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.
Thanks!

@CBenoit
Copy link
Member

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. Thanks!

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.

@glamberson
Copy link
Contributor Author

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!

glamberson pushed a commit to lamco-admin/IronRDP that referenced this pull request Jan 14, 2026
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.
@glamberson
Copy link
Contributor Author

glamberson commented Feb 4, 2026

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.
@glamberson glamberson force-pushed the egfx-server-complete branch from 7e269d0 to 5429bbe Compare February 9, 2026 20:04
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: We need to update that before publishing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benoît Cortier (@CBenoit) ok thanks. I'm working now to address all the copilot-discovered issues as well as this one.
-Greg

Copy link
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👀

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@glamberson
Copy link
Contributor Author

OK I addressed all those. Thanks.

@CBenoit
Copy link
Member

Swift job! Thank you!

@CBenoit Benoît Cortier (CBenoit) merged commit 300f9a3 into Devolutions:master Feb 12, 2026
10 checks passed
@glamberson glamberson deleted the egfx-server-complete branch February 12, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments