fix(egfx): use exclusive AVC region bounds - #1788
fix(egfx): use exclusive AVC region bounds#1788Marynych Oleksandr (maryny4) wants to merge 3 commits into
Conversation
|
Thank you for taking the time to validate these changes and submit them upstream. Sorry I missed your earlier messages. I’m happy for these changes to be upstreamed through this PR. |
|
Thanks for filing this, and glad to see MuNeNiCK confirm he's happy for it to go through this PR. Good fix. |
|
Context that does not belong in the commit message. Authorship. These three commits are MuNeNiCK (@MuNeNiCK)'s, cherry-picked onto master with his authorship intact; I am the committer only. I asked him twice whether he would rather send them himself before opening this, and he has since confirmed here that he is happy for them to go upstream through this PR. That is the reason for the rebase-merge request in the body: a squash would put my name on his work. Provenance of the analysis. The exclusive/inclusive mismatch was diagnosed by Greg Lamberson (@glamberson) in #1712. I checked each step of it against master before sending this rather than taking it on trust. What I ran locally. |
MS-RDPEGFX 2.2.1.2 defines
RDPGFX_RECT16with exclusiverightandbottom, and 2.2.4.4.1 givesregionRectsinRFX_AVC420_METABLOCKthat same type.Avc420Regiondocumented its edges as inclusive,full_frame()builtwidth - 1/height - 1, andto_rectangle()handed those to anInclusiveRectanglethat encoded them unchanged, so everyregionRectsentry went out a pixel short on the right and bottom edge.GraphicsPipelineServer::compute_dest_rect(), used for theWireToSurface1destination, does add that pixel back: the two call sites disagreed about whether the conversion had already happened.Avc420Regionis exclusive throughout now andto_rectangleproduces anExclusiveRectangle, so the asymmetric adjustment disappears.fix(egfx): bound both AVC444 streamsthen computes the destination rectangle from both streams rather than from the luma one, so a chroma region larger than luma is no longer cut short.feat(egfx): add explicit AVC444v2 frame senderseparates the AVC444v2 path from AVC444; both fixes build on it.What the defect costs: with
ironrdp-serveron master, Windows App on macOS drops the connection right after the encoder starts, the server reportingpeer closed connection without sending TLS close_notify. Pinning the session resolution, so that no deactivation-reactivation happens at all, changes nothing. With these three commits the same server build and the same client run normally. FreeRDP-based clients accept the frames either way, which is why this shows only against the Microsoft client. That is not proof this field is the trigger - 2.2.4.4.1 also calls the metablock informational - only that the field is wrong on the wire and that these commits make that client work.avc.rslost its inline test module to #1736 while these sat in a fork, so thefull_frameexpectation is updated intestsuite-core/tests/egfx/avc.rsinstead.Please rebase-merge rather than squash. The three commits are MuNeNiCK (@MuNeNiCK)'s with his authorship intact, and the breaking change is confined to the middle one; squashing would collapse both.
BREAKING CHANGE:
Avc420BitmapStream::rectanglesis nowVec<ExclusiveRectangle>, andAvc420Region::to_rectanglereturnsExclusiveRectangle. Callers that build or matchInclusiveRectanglethere have to switch, and a region built withAvc420Region::full_frameno longer subtracts one from the width and height.Issue: #1712