[vlc-devel] [PATCH 3/6] video_output: window: forward rendering suspending/resuming callbacks

Alexandre Janniaux ajanni at videolabs.io
Fri Feb 5 09:01:54 UTC 2021


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

diff --git a/src/video_output/window.c b/src/video_output/window.c
index 9c2df5c1e6..ffbf9b15dd 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -336,6 +336,24 @@ static void vout_display_window_OutputEvent(vout_window_t *window,
         msg_Dbg(window, "fullscreen output %s removed", name);
 }
 
+static void vout_display_window_RenderingSuspended(vout_window_t *window)
+{
+    vout_display_window_t *state = window->owner.sys;
+    vout_thread_t *vout = state->vout;
+
+    msg_Dbg(window, "disabling rendering");
+    vout_ChangeDisplayRenderingEnabled(vout, false);
+}
+
+static void vout_display_window_RenderingResumed(vout_window_t *window)
+{
+    vout_display_window_t *state = window->owner.sys;
+    vout_thread_t *vout = state->vout;
+
+    msg_Dbg(window, "resuming rendering");
+    vout_ChangeDisplayRenderingEnabled(vout, true);
+}
+
 static const struct vout_window_callbacks vout_display_window_cbs = {
     .resized = vout_display_window_ResizeNotify,
     .closed = vout_display_window_CloseNotify,
@@ -345,6 +363,8 @@ 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,
+    .rendering_suspended = vout_display_window_RenderingSuspended,
+    .rendering_resumed = vout_display_window_RenderingResumed,
 };
 
 /**
-- 
2.28.0



More information about the vlc-devel mailing list