feat(egfx): add ClearCodec client-side decode dispatch#1175
feat(egfx): add ClearCodec client-side decode dispatch#1175Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces ClearCodec support across the stack (PDU parsing, graphics encode/decode, and EGFX client/server integration) and adds a comprehensive test suite to validate correctness and resilience.
Changes:
- Added ClearCodec PDU parsing modules (residual, bands, subcodec, RLEX) under
ironrdp-pdu. - Implemented
ClearCodecDecoder/ClearCodecEncoder(with glyph/V-bar caching) underironrdp-graphics. - Integrated ClearCodec handling into EGFX client decode path and EGFX server frame queuing; added new tests in testsuite-core.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-testsuite-core/tests/graphics/mod.rs | Registers the new ClearCodec graphics test module. |
| crates/ironrdp-testsuite-core/tests/graphics/clearcodec.rs | Adds extensive round-trip and adversarial ClearCodec tests. |
| crates/ironrdp-testsuite-core/tests/egfx/client.rs | Adds EGFX pipeline tests for ClearCodec processing/reset behavior. |
| crates/ironrdp-pdu/src/codecs/mod.rs | Exposes the new ClearCodec codec module in the PDU crate. |
| crates/ironrdp-pdu/src/codecs/clearcodec/mod.rs | Implements ClearCodec bitmap stream + composite payload decoding. |
| crates/ironrdp-pdu/src/codecs/clearcodec/residual.rs | Implements residual layer (BGR RLE) encode/decode helpers. |
| crates/ironrdp-pdu/src/codecs/clearcodec/bands.rs | Implements bands layer decoding (V-bar structures). |
| crates/ironrdp-pdu/src/codecs/clearcodec/subcodec.rs | Implements subcodec layer decoding for regions. |
| crates/ironrdp-pdu/src/codecs/clearcodec/rlex.rs | Implements RLEX subcodec decoding. |
| crates/ironrdp-graphics/src/lib.rs | Exposes ironrdp_graphics::clearcodec. |
| crates/ironrdp-graphics/src/clearcodec/mod.rs | Adds ClearCodec encoder/decoder and decode compositing pipeline. |
| crates/ironrdp-graphics/src/clearcodec/glyph_cache.rs | Implements glyph cache storage for ClearCodec. |
| crates/ironrdp-graphics/src/clearcodec/vbar_cache.rs | Implements V-bar cache storage and reconstruction for bands. |
| crates/ironrdp-egfx/src/server.rs | Adds a send_clearcodec_frame helper to enqueue ClearCodec frames. |
| crates/ironrdp-egfx/src/client.rs | Adds ClearCodec decode path and BGRA→RGBA conversion for bitmap updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
31e29a7 to
b164178
Compare
b164178 to
50dafcc
Compare
There was a problem hiding this comment.
Pull request overview
Adds client-side ClearCodec decode support to EGFX by wiring a persistent ClearCodec decoder into WireToSurface1 codec dispatch and normalizing output pixels to the existing RGBA BitmapUpdate format.
Changes:
- Add ClearCodec decode path in
GraphicsPipelineClient(including BGRA→RGBA conversion and reset behavior onResetGraphics). - Introduce/extend ClearCodec wire-format parsing in
ironrdp-pduand codec implementation (decoder/encoder + caches) inironrdp-graphics. - Add integration/unit tests covering decode dispatch, pixel format conversion, cache/reset behavior, and adversarial inputs.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-egfx/src/client.rs | Adds ClearCodec decoder to client dispatch, resets state on ResetGraphics, and converts BGRA output to RGBA BitmapUpdate. |
| crates/ironrdp-egfx/src/server.rs | Adds send_clearcodec_frame() helper for emitting ClearCodec WireToSurface1 frames. |
| crates/ironrdp-graphics/src/lib.rs | Exposes the new clearcodec module. |
| crates/ironrdp-graphics/src/clearcodec/mod.rs | Implements ClearCodec decoder/encoder and composite layer application (residual/bands/subcodecs). |
| crates/ironrdp-graphics/src/clearcodec/glyph_cache.rs | Introduces glyph cache storage for ClearCodec glyph hits. |
| crates/ironrdp-graphics/src/clearcodec/vbar_cache.rs | Adds V-bar and short V-bar ring-buffer cache implementation used by bands layer. |
| crates/ironrdp-pdu/src/codecs/mod.rs | Exports the ClearCodec wire-format module. |
| crates/ironrdp-pdu/src/codecs/clearcodec/mod.rs | Defines ClearCodec stream/container structures, flags, and composite payload parsing. |
| crates/ironrdp-pdu/src/codecs/clearcodec/residual.rs | Adds residual layer (BGR RLE) decode/encode helpers. |
| crates/ironrdp-pdu/src/codecs/clearcodec/bands.rs | Adds bands layer parsing (V-bar references and inline short V-bar misses). |
| crates/ironrdp-pdu/src/codecs/clearcodec/subcodec.rs | Adds subcodec layer region parsing (raw/NSCodec/RLEX). |
| crates/ironrdp-pdu/src/codecs/clearcodec/rlex.rs | Adds RLEX subcodec decoding (palette + packed run/suite segments). |
| crates/ironrdp-testsuite-core/tests/graphics/mod.rs | Registers the new ClearCodec graphics tests module. |
| crates/ironrdp-testsuite-core/tests/graphics/clearcodec.rs | Adds ClearCodec codec-level integration tests (round-trip, adversarial inputs, cache/session behavior). |
| crates/ironrdp-testsuite-core/tests/egfx/client.rs | Adds EGFX client integration tests for ClearCodec dispatch, RGBA output verification, and reset/re-decode cycle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dcf7f7d to
a1c0315
Compare
Add ClearCodec (MS-RDPEGFX 2.2.4.1) codec support across two crates: ironrdp-pdu: Wire-format decode/encode for all ClearCodec layers (residual BGR RLE, bands with V-bar caching, subcodec dispatch including RLEX palette-indexed RLE). Full round-trip test coverage. ironrdp-graphics: ClearCodecDecoder with persistent V-bar and glyph caches. ClearCodecEncoder with residual-only encoding and glyph deduplication for server-side bitmap compression.
Wire ClearCodec decoder into the EGFX client WireToSurface1 codec dispatch. Persistent decoder with V-bar and glyph caches is stored on GraphicsPipelineClient and reset on ResetGraphics. BGRA output is converted to RGBA for the uniform BitmapUpdate format. Includes RLEX stop_index bounds validation against palette count and client-side decode tests in ironrdp-testsuite-core.
a1c0315 to
9611e12
Compare
Follow-up to #1174.
Wires ClearCodec into the EGFX client's WireToSurface1 codec dispatch,
matching the existing AVC420 and Uncompressed decode patterns.
Changes:
pure Rust, no external codec dependency)
output to RGBA for the uniform BitmapUpdate pixel format
reset/re-decode cycle)
Unlike H.264 which requires an external decoder via the H264Decoder
trait, ClearCodec is pure Rust (ironrdp-graphics) and initialized
unconditionally.