Documentation
¶
Overview ¶
Package privacy follows what records the user: the applications capturing a microphone, from the audio server's record streams, and the processes holding a camera open, from inotify on the video devices and one /proc scan per open or close.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CameraUser ¶
CameraUser is one process holding a camera open.
func ScanCameras ¶
func ScanCameras(procRoot string, uid int, devices []string) ([]CameraUser, error)
ScanCameras lists the processes of uid under procRoot (/proc) with one of devices open, by reading their file descriptor links; the processes it may not read are someone else's and are skipped.
type Cameras ¶
type Cameras struct {
// contains filtered or unexported fields
}
Cameras follows which processes hold a camera open. Nothing runs between events: inotify reports opens and closes of the video nodes and nodes appearing in the device directory, and each report rescans /proc once.
func WatchCameras ¶
WatchCameras starts following the cameras of devDir (/dev) held by uid's processes under procRoot (/proc).
func (*Cameras) Subscribe ¶
func (c *Cameras) Subscribe() (<-chan struct{}, func())
Subscribe ticks when Users changes.
func (*Cameras) Users ¶
func (c *Cameras) Users() []CameraUser
Users are the processes holding a camera now.
type MicUser ¶
type MicUser struct {
Stream pulse.StreamKey
// Name is the application's name, else its binary, else the stream's.
Name string
Icon string
Muted bool
Source string
}
MicUser is one application recording a microphone.
func MicUsers ¶
func MicUsers(streams []pulse.AudioStream, sources []pulse.InputDevice, self uint32) []MicUser
MicUsers are the record streams that capture a microphone: running, attached to a source that is not a sink's monitor, not a level meter's peak stream, and not opened by the process self (lys-shell's own recorder and visualizer).