#Capturing Screen with x11rb and using XShm protocol.

37 messages · Page 1 of 1 (latest)

old flicker
woeful vale
old flicker
woeful vale
woeful vale
#

ohh libc has those functions

foggy token
#

Doesn't x11rb have a capture example?

woeful vale
#

right now I'm able to attach and everything, I used shm functions from libc and they work fine as well, but now I've no idea how I can proceed and get the image

#
X11Error { error_kind: Value, error_code: 2, sequence: 7, bad_value: 0, minor_opcode: 4, major_opcode: 130, extension_name: Some("MIT-SHM"), request_name: Some("GetImage") })

this is the error that I'm getting right now

foggy token
#

memmap2 crate can help with managing access to shm

#

I think nix provides some utilities for mmap also

woeful vale
woeful vale
#

the issue is that x11rb crate is very rustified in terms of syntax and doesn't correspond 1:1 with the xcb library it seems, the XShmGetImage function for example doesn't have the same parameters as the one provided in the x11rb library

#

and that makes it hard for me to understand exactly what I need to do, since I can't just copy paste C code structure into rust code and I'm not acquainted with x11 development

vernal axle
#

Curious cause I did something similar, what does x11rb do for you versus other methods?

woeful vale
#

the thing is right now it's working perfectly fine, it's just that the performance is very shitty (still good enough for most cases) and I wanna try doing it the fast way

#

by using shared memory

vernal axle
#

I'm sure you ran across the thing called scrap, and a few other similar, why did you make this one? What's different?

#

I do need to use this but I need it to be realtime

#

How does rustdesk do it?

woeful vale
woeful vale
#

the las time scrap was updated was in 2018

#

and I haven't seen any libraries use the XShm protocol on linux

#

they all use the standard protocol

#

I'll take a look at rustdesk after eating my 🍕 and update the post

woeful vale
#

@vernal axle it seems it has a fork of scrap

#

but I can't even compile it on my machine, the build file generates bindings it seems and shit gets messy

#

and they just use ffi bindings, I might just go for that as well if x11rb doesn't support what I'm trying to do

woeful vale