Skip to content

app: draw decoded video on the gpu in the session - #12

Open
ElCruncharino wants to merge 5 commits into
pgaskin:masterfrom
ElCruncharino:gpu-video-core
Open

ElCruncharino wants to merge 5 commits into
pgaskin:masterfrom
ElCruncharino:gpu-video-core

Conversation

@ElCruncharino

@ElCruncharino ElCruncharino commented Oct 23, 2026 •

Copy link
Copy Markdown

Video that a backend decodes to NV12 planes is drawn by a GL layer behind the desktop view, so the phone's GPU does the colour conversion instead of the CPU.

The layer handles one region at a time. Damage over a video region hands that region back to the CPU, and the desktop view repaints it.

The backend video callback is optional, so backends without video are unaffected. IronRDP's EGFX AVC420 is the first backend to use it. FreeRDP, RustDesk and SPICE still draw on the CPU.

Rust tests pass. Not built for Android yet and not run on a device.

@ElCruncharino
ElCruncharino marked this pull request as draft October 23, 2026 19:57
@ElCruncharino ElCruncharino changed the title Draw decoded video on the GPU in the session app: draw decoded video on the gpu in the session Oct 23, 2026
@ElCruncharino
ElCruncharino marked this pull request as ready for review October 23, 2026 20:07
Nick Haghiri added 5 commits October 25, 2026 18:35
A GL layer behind the desktop view draws each video region from its NV12 planes, so the colour conversion happens on the GPU. Backend.Listener gets videoFrame for the backends that hand it planes.

Damage over a video region hands it back to the CPU, and what the video had left of that region is repainted from its last frame so the mirror does not flash the old picture. Screenshots and the session thumbnail paint video over the backend's picture, which is stale under video.
A backend can now hand a decoded picture to the window as NV12 instead of composing it into the framebuffer. The mailbox queues it as an event in order with the damage around it, and replaces an unread picture for the same rectangle. It is off unless the window asks, so the Linux client is unchanged. The phone asks, and delivers each picture to the session as Listener.videoFrame.
The library converts every AVC420 picture to RGBA and composites it. The patch lets a handler that draws video itself take the decoder's planes instead, for AVC420 only. Nothing uses it yet.
On the phone the graphics pipeline's AVC420 pictures are cut out as NV12 and passed to the window, instead of being converted to RGBA on the CPU and composited. Only for surfaces mapped 1:1 to the output, so a scaled surface still goes through the compositor. AVC444 is unchanged. Needs patches/ironrdp/0002.
A picture alone ends no frame, so nothing redrew the view to cut its tiles out of the new region.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant