[vlc-devel] [PATCH v3 05/10] video_output: window: forward rendering suspending/resuming callbacks

Alexandre Janniaux ajanni at videolabs.io
Tue Feb 16 15:25:45 UTC 2021


Actually signal the vout_thread_t that the rendering must be suspended
or resumed.
---
 src/video_output/window.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/video_output/window.c b/src/video_output/window.c
index 9c2df5c1e6..2c25e6fe55 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -336,6 +336,26 @@ static void vout_display_window_OutputEvent(vout_window_t *window,
         msg_Dbg(window, "fullscreen output %s removed", name);
 }
 
+static void vout_display_window_VisibilityChanged(
+        vout_window_t *window, enum vout_window_visibility visibility)
+{
+    vout_display_window_t *state = window->owner.sys;
+    vout_thread_t *vout = state->vout;
+
+    switch (visibility)
+    {
+        case VOUT_WINDOW_VISIBLE:
+            msg_Dbg(window, "enable rendering");
+            vout_ChangeDisplayRenderingEnabled(vout, true);
+            break;
+
+        case VOUT_WINDOW_NOT_VISIBLE:
+            msg_Dbg(window, "disabling rendering");
+            vout_ChangeDisplayRenderingEnabled(vout, false);
+            break;
+    }
+}
+
 static const struct vout_window_callbacks vout_display_window_cbs = {
     .resized = vout_display_window_ResizeNotify,
     .closed = vout_display_window_CloseNotify,
@@ -345,6 +365,7 @@ static const struct vout_window_callbacks vout_display_window_cbs = {
     .mouse_event = vout_display_window_MouseEvent,
     .keyboard_event = vout_display_window_KeyboardEvent,
     .output_event = vout_display_window_OutputEvent,
+    .visibility_changed = vout_display_window_VisibilityChanged,
 };
 
 /**
-- 
2.30.1



More information about the vlc-devel mailing list