[vlc-devel] [PATCH 0/6] Allow the vout_window implementation to suspend rendering

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


This patchset enables the vout_window implementation to suspend
the rendering with the vout_display. This is primarily designed
for iOS where the application can be moved to the background and
should not submit any draw commands from there, but it should
also match other cases where the application can stop doing the
rendering, for instance because the application is not visible
anymore, and thus should also be usable in cases like Wayland.

I've written the vout_window callbacks with the Enable/Disable
duo in mind, but having two callbacks might feel a little heavy
so let me know if you prefer a single rendering_<something>
callback with a boolean parameter instead.

The main goal of this patchset is to move the responsability of
the rendering suspension from the vlc_gl_t implementation in
VLCOpenGLES2VideoView.m to the vout_window implementation which
is usually the first receiver of such information. In addition,
the vlc_gl_t cannot really suspend the rendering other than
making the vlc_gl_MakeCurrent call fail, which is badly handled
by the client of vlc_gl_t and sometimes even impossible like
opengl/display.c:Close. As mentioned a while ago on this mailing
list, iirc by RĂ©mi, we should prevent this function from failing
especially since the reasons of failure are mostly bad
programming situations.

This patchset actually fixes two assertions in these cases,
happening when the iOS/tvOS application is starting/closing the
opengl display from the background. The first happens in the
VLCOpenGLES2VideoView module because vlc_gl_ReleaseCurrent is
called even if vlc_gl_MakeCurrent has failed. The second happens
in subsequent opengl rendering code in debug because the call to
[VLCOpenGLES2VideoView doResetBuffers] leads to incomplete
framebuffers, stacking the error in the OpenGL context, and
the error is then triggering GL_ASSERT_NO_ERROR in the OpenGL
rendering code.

Regards,
--
Alexandre Janniaux
Videolabs

Alexandre Janniaux (6):
  vout_window: add rendering suspension/resuming callbacks
  video_output: conditionnally enable display rendering
  video_output: window: forward rendering suspending/resuming callbacks
  video_output: conditionnally render on display
  VLCVideoUIView: handle application backgrounding
  VLCOpenGLES2VideoView: handle state change

 include/vlc_vout_window.h                     | 33 ++++++++++++++++++
 .../apple/VLCOpenGLES2VideoView.m             | 34 +++++++------------
 modules/video_output/apple/VLCVideoUIView.m   | 28 +++++++++++++++
 src/video_output/video_output.c               | 17 ++++++++--
 src/video_output/vout_internal.h              |  1 +
 src/video_output/window.c                     | 20 +++++++++++
 6 files changed, 109 insertions(+), 24 deletions(-)

--
2.28.0


More information about the vlc-devel mailing list