[vlc-commits] [Git][videolan/vlc][master] 2 commits: VCLOpenGLES2VideoView : consider other application states to allow ios display initialization

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Jan 10 18:41:38 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
012b57cd by Maxime Chapelet at 2022-01-10T17:50:06+00:00
VCLOpenGLES2VideoView : consider other application states to allow ios display initialization

the display can be created when the application state is active or inactive
inactive state actually happens when the application comes back from background and becomes active just after a very short amount of time
hence we should allow vout initialization only when application state is not background

- - - - -
f702e742 by Maxime Chapelet at 2022-01-10T17:50:06+00:00
videotoolbox : reload module if vout initialisation fails

- - - - -


2 changed files:

- modules/codec/videotoolbox.c
- modules/video_output/apple/VLCOpenGLES2VideoView.m


Changes:

=====================================
modules/codec/videotoolbox.c
=====================================
@@ -59,6 +59,7 @@ enum vtsession_status
     VTSESSION_STATUS_RESTART,
     VTSESSION_STATUS_RESTART_CHROMA,
     VTSESSION_STATUS_ABORT,
+    VTSESSION_STATUS_VOUT_FAILURE,
 };
 
 static int ConfigureVout(decoder_t *);
@@ -1896,6 +1897,12 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
         var_Create(p_dec, "videotoolbox-failed", VLC_VAR_VOID);
         return VLCDEC_RELOAD;
     }
+    else if (p_sys->vtsession_status == VTSESSION_STATUS_VOUT_FAILURE)
+    {
+        vlc_mutex_unlock(&p_sys->lock);
+        return VLCDEC_RELOAD;
+    }
+
     vlc_mutex_unlock(&p_sys->lock);
 
     if (unlikely(p_block->i_flags&(BLOCK_FLAG_CORRUPTED)))
@@ -2069,7 +2076,7 @@ static int UpdateVideoFormat(decoder_t *p_dec, CVPixelBufferRef imageBuffer)
 
     if (decoder_UpdateVideoOutput(p_dec, p_sys->vctx) != 0)
     {
-        p_sys->vtsession_status = VTSESSION_STATUS_ABORT;
+        p_sys->vtsession_status = VTSESSION_STATUS_VOUT_FAILURE;
         return -1;
     }
     return 0;


=====================================
modules/video_output/apple/VLCOpenGLES2VideoView.m
=====================================
@@ -168,7 +168,7 @@ static void Close(vlc_gl_t *gl)
 {
     _gl = gl;
 
-    _appActive = ([UIApplication sharedApplication].applicationState == UIApplicationStateActive);
+    _appActive = ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground);
     if (unlikely(!_appActive))
         return nil;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6517d72d1349c974b61217e81b5f1e17e5a93430...f702e7423d89fa7110e51157fd73107a730c23f1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6517d72d1349c974b61217e81b5f1e17e5a93430...f702e7423d89fa7110e51157fd73107a730c23f1
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list