NAME
capture_hook.h - Bark screen and window capture provider interface.
SYNOPSIS
Classes
Capture stream configuration passed to bark_capture_start().
Selectable monitor or window descriptor returned by bark_capture_list_sources().
Metadata produced by single-frame capture via bark_capture_grab_frame().
Custom screen-capture provider vtable passed to bark_capture_register().
Macros
Maximum UTF-8 byte length (including NUL) for a capture source title.
Provider uses asynchronous zero-copy media transport (e.g. browser MediaStream).
Provider presents a native OS or browser picker when starting with BARK_CAPTURE_TARGET_PROMPT.
Provider supports enumerating sources via bark_capture_list_sources().
Typedefs
Capture stream configuration passed to bark_capture_start().
Selectable monitor or window descriptor returned by bark_capture_list_sources().
Metadata produced by single-frame capture via bark_capture_grab_frame().
Worker-thread RGBA8 capture frame callback.
Main-thread capture lifecycle callback driven by bark_capture_poll().
Optional host permission gate returning BARK_OK to permit or BARK_ERR_UNAVAILABLE to deny.
Custom screen-capture provider vtable passed to bark_capture_register().
Enumerations
Capture target selection modes.
Active OS screen-capture backend identifier.
Functions
Grab a single RGBA8 screenshot frame into caller memory.
Return the built-in cross-platform capture provider vtable.
Install or clear (NULL) a host authorization gate for capture and source enumeration.
Register a capture provider implementation.
Unregister a previously registered capture provider.
Load and register the default (or BARK_CAPTURE_MODULE override) capture provider.
Release a reference acquired via bark_capture_autoload().
Return non-zero if a capture provider is installed and permitted.
Return the active capture provider's name, or NULL if none.
Return capability flags (BARK_CAPTURE_FLAG_*) of the active capture provider.
Enumerate selectable monitors and windows (respects host permission gate).
Start screen capture streaming RGBA8 frames to on_frame.
Start screen capture with both worker-thread frame and main-thread state callbacks.
Update live capture resolution or FPS.
Pump pending main-thread capture state callbacks.
Stop active screen capture.
Probe whether capture can start and deliver a valid RGBA8 frame.
Detailed Description
Bark screen and window capture provider interface.
Capability-gated screen capture primitive and custom provider hook.
Provides OS monitor/window enumeration and screen capture across Linux (Wayland portal/PipeWire + X11), macOS (ScreenCaptureKit/CoreGraphics), Windows (WGC/GDI), browser WASM (getDisplayMedia), and headless mode, with an optional host authorization gate.
Typedef Documentation
typedef void(* bark_capture_frame_fn) (const uint8_t *rgba, uint16_t w, uint16_t h, void *user)
Worker-thread RGBA8 capture frame callback. Called with tightly-packed RGBA8 pixels (w * h * 4 bytes), or with rgba=NULL, w=0, h=0 when the picker is canceled or target is lost.
Enumeration Type Documentation
enum bark_capture_backend
Active OS screen-capture backend identifier.
Enumerator
- BARK_CAPTURE_BACKEND_NONE
- No backend active.
- BARK_CAPTURE_BACKEND_HEADLESS
- Deterministic synthetic RGBA8 pattern.
- BARK_CAPTURE_BACKEND_X11
- Linux X11 MIT-SHM / XComposite capture.
- BARK_CAPTURE_BACKEND_GDI
- Windows GDI capture.
- BARK_CAPTURE_BACKEND_CG
- macOS CoreGraphics capture.
- BARK_CAPTURE_BACKEND_WAYLAND
- Linux Wayland xdg-desktop-portal + PipeWire.
- BARK_CAPTURE_BACKEND_WGC
- Windows Graphics Capture (D3D11).
- BARK_CAPTURE_BACKEND_SCK
- macOS ScreenCaptureKit.
enum bark_capture_target_kind
Capture target selection modes.
Enumerator
- BARK_CAPTURE_TARGET_PROMPT
- Show OS/browser picker if supported, else default display.
- BARK_CAPTURE_TARGET_MONITOR
- Capture a specific monitor by target_id or display_index.
- BARK_CAPTURE_TARGET_WINDOW
- Capture a specific application window by target_id.
Author
Generated automatically by Doxygen for Bark from the source code.