drishya दृश्य

Accepted ADR 0002 · 2026-10-24

#2. libmpv draws into the window

#Context

A video player can either drive a separate player window (mpv over its IPC socket) or draw the video inside its own window. Two windows are simpler to build but feel like two programs: the list in one, the video in another, focus and fullscreen handled by each. GTK 4 on Wayland can't embed another program's window.

#Decision

drishya uses libmpv's render API: mpv decodes (with hardware decoding) and draws with OpenGL into a GTK GLArea in drishya's window. The binding is drishya's own, with ctypes (drishya/mpv.py), so the only dependency is libmpv, which ships with mpv. One area holds the renderer at a time; the mini player takes it over and gives it back.

#Consequences

← All decisions · source