Skip to main content

Module server

Module server 

Source
Expand description

Control socket for the Selkies V4L2 interposer.

Each application open() of the virtual device becomes one client connection. The server sends the ring configuration once, with the ring memfd attached as SCM_RIGHTS ancillary data, then only ever writes one-byte doorbells — one per published frame — so the interposer can block in poll()/VIDIOC_DQBUF on plain socket readability. Frame bytes never cross the socket. The interposer answers the handshake with a single byte; until that arrives a client gets no doorbells, and a closed connection is retired the moment its read end reports hangup.

The accept/hangup loop runs on its own thread, woken through an eventfd for shutdown, so a process that opens the device while no frames flow is still served immediately.

Structs§

Server