]> git.sesse.net Git - vlc/commitdiff
vout: add vout_display_IsWindowed() helper
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 14 Oct 2014 19:29:56 +0000 (22:29 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 16 Oct 2014 17:23:38 +0000 (20:23 +0300)
include/vlc_vout_display.h

index f5f68177a4b543fcd986363dc2563dbce0f81298..bfe5a8cfd7d40a68ced95ec15a05f10a02a503d3 100644 (file)
@@ -405,6 +405,25 @@ static inline void vout_display_DeleteWindow(vout_display_t *vd,
     vd->owner.window_del(vd, window);
 }
 
+static inline bool vout_display_IsWindowed(vout_display_t *vd)
+{
+#ifndef __cplusplus
+    vout_window_cfg_t cfg = {
+        .width = vd->cfg->display.width,
+        .height = vd->cfg->display.height,
+    };
+#else
+    vout_window_cfg_t cfg;
+    memset(&cfg, 0, sizeof (cfg));
+    cfg.width = vd->cfg->display.width;
+    cfg.height = vd->cfg->display.height;
+#endif
+    vout_window_t *window = vout_display_NewWindow(vd, &cfg);
+    if (window != NULL)
+        vout_display_DeleteWindow(vd, window);
+    return window != NULL;
+}
+
 /**
  * Computes the default display size given the source and
  * the display configuration.