From f9bcb5c42c9a3adb54179ef154300734911ea2b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 15 Apr 2018 12:31:07 +0200 Subject: client API: clarify that Display pointers etc. need to stay valid Normally, MPV_RENDER_PARAM* arguments are copied, unless documented otherwise. Of course we can't copy X11 Display or Wayland wl_display types, but for arguments that are "summarized" in a struct (like MPV_RENDER_PARAM_OPENGL_FBO), a copy is expected. Also add some unused infrastructure to make this explicit, and to make it easier to add parameter types that require a copy. Untested. --- libmpv/render.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libmpv') diff --git a/libmpv/render.h b/libmpv/render.h index cefe922b34..68a6b6bf52 100644 --- a/libmpv/render.h +++ b/libmpv/render.h @@ -154,13 +154,15 @@ typedef enum mpv_render_param_type { MPV_RENDER_PARAM_AMBIENT_LIGHT = 7, /** * X11 Display, sometimes used for hwdec. Valid for - * mpv_render_context_create(). + * mpv_render_context_create(). The Display must stay valid for the lifetime + * of the mpv_render_context. * Type: Display* */ MPV_RENDER_PARAM_X11_DISPLAY = 8, /** * Wayland display, sometimes used for hwdec. Valid for - * mpv_render_context_create(). + * mpv_render_context_create(). The wl_display must stay valid for the + * lifetime of the mpv_render_context. * Type: struct wl_display* */ MPV_RENDER_PARAM_WL_DISPLAY = 9, -- cgit v1.2.3