Skip to content

rustdesk: decode video on the gpu and drop the cpu path - #15

Open
ElCruncharino wants to merge 3 commits into
pgaskin:masterfrom
ElCruncharino:gpu-video-rustdesk
Open

ElCruncharino wants to merge 3 commits into
pgaskin:masterfrom
ElCruncharino:gpu-video-rustdesk

Conversation

@ElCruncharino

Copy link
Copy Markdown

Every RustDesk frame is a whole desktop, so each one goes to the GPU as a
single region. The RGB conversion, the changed-row diff, and the
framebuffer that held the converted pixels are gone.

Region reads and thumbnails now report no picture, since the video layer
covers them. The session paints video over whatever the mirror reads.

Builds and installs as the RustDesk plugin. Not tested against a live
RustDesk host since the cleanup, so treat it as unverified.

Stacked on #12.

Nick Haghiri added 3 commits October 23, 2026 15:49
backends that get h264 from their protocol can hand the frames to mediacodec and get nv12 planes back. the decoder lives in common so every backend uses the same one. frames carry their colour matrix and range, and the jni callback is optional, so backends without video don't notice.
a gl layer behind the desktop view draws each video region from its nv12 planes, so the colour conversion happens on the gpu.

damage over a video region hands it back to the cpu. what the video had left of that region is repainted from its last frame, so the mirror doesn't flash the old picture.

screenshots and the session thumbnail paint video over the backend's picture, which is stale under video.
every rustdesk frame is a whole desktop, so each one goes to the gpu as a single region. the rgb conversion, the changed-row diff and the framebuffer are gone.

region reads and thumbnails report no picture now, since the video layer covers them.
@ElCruncharino
ElCruncharino marked this pull request as draft October 23, 2026 19:57
@ElCruncharino ElCruncharino changed the title Decode RustDesk's video on the GPU and drop the CPU path rustdesk: decode video on the gpu and drop the cpu path Oct 23, 2026
@ElCruncharino
ElCruncharino marked this pull request as ready for review October 23, 2026 20:07

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