display

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package display lists the capturable displays of this machine and opens one with the platform's capture backend: DXGI Desktop Duplication on Windows, ScreenCaptureKit on macOS, and MIT-SHM or the desktop portal's PipeWire stream on Linux.

Index

Constants

View Source
const (
	BackendX11    = "x11"
	BackendPortal = "portal"
)

Capture backends on Linux.

Variables

This section is empty.

Functions

func Backend added in v0.2.0

func Backend() string

Backend is the capture backend for this session: PLANCK_CAPTURE_BACKEND when set ("x11" or "portal"), the desktop portal in a Wayland session, X11 where only $DISPLAY is set.

func List

func List() ([]capture.Display, error)

List returns the X screen's monitors under X11, and the portal's one display (the monitor the desktop's share dialog picks) under Wayland.

Types

type Options

type Options struct {
	// HDR captures 10-bit or FP16 surfaces when the display is in HDR
	// (Windows).
	HDR bool
	// Width, Height and FPS set the stream size and rate where the backend
	// scales (macOS); FPS is also the rate X11 capture polls at. Zero
	// takes the display's own.
	Width, Height, FPS int
	// NV12 asks for 4:2:0 frames where the backend converts (macOS); BGRA
	// otherwise.
	NV12 bool
}

Options configure Open.

type Source

type Source struct {
	capture.Source
	Display capture.Display
	// Device is the GPU device the frames live on; encoders open on it for
	// zero-copy.
	Device gpu.Device
}

Source is an open display.

func Open

func Open(id string, opts Options) (*Source, error)

Open captures the display with this ID; empty opens the primary one. Frames are capture.DMABuf surfaces on no GPU device: the encoder uploads or imports them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL