[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: videotoolbox : reload module if vout initialisation fails
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Jan 13 20:17:12 UTC 2022
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
423bb86a by Maxime Chapelet at 2022-01-13T20:04:53+00:00
videotoolbox : reload module if vout initialisation fails
(cherry picked from commit f702e7423d89fa7110e51157fd73107a730c23f1)
- - - - -
fe93f226 by Maxime Chapelet at 2022-01-13T20:04:53+00:00
ios : consider other application states to allow 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
(cherry picked from commit 012b57cd9b595d6ab8801ad57d8fd7334fa2d101)
- - - - -
2 changed files:
- modules/codec/videotoolbox.m
- modules/video_output/ios.m
Changes:
=====================================
modules/codec/videotoolbox.m
=====================================
@@ -105,6 +105,7 @@ enum vtsession_status
VTSESSION_STATUS_RESTART,
VTSESSION_STATUS_RESTART_CHROMA,
VTSESSION_STATUS_ABORT,
+ VTSESSION_STATUS_VOUT_FAILURE,
};
static int ConfigureVout(decoder_t *);
@@ -1938,6 +1939,11 @@ 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)))
@@ -2107,7 +2113,7 @@ static int UpdateVideoFormat(decoder_t *p_dec, CVPixelBufferRef imageBuffer)
p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
if (decoder_UpdateVideoFormat(p_dec) != 0)
{
- p_dec->p_sys->vtsession_status = VTSESSION_STATUS_ABORT;
+ p_dec->p_sys->vtsession_status = VTSESSION_STATUS_VOUT_FAILURE;
return -1;
}
return 0;
=====================================
modules/video_output/ios.m
=====================================
@@ -390,7 +390,7 @@ static void GLESSwap(vlc_gl_t *gl)
- (id)initWithFrame:(CGRect)frame andVD:(vout_display_t*)vd
{
- _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/0f21d3ec9492658370ef8e9788fc8a3720aea2da...fe93f2269c9840f14487c7df8cb9146da2d4e410
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0f21d3ec9492658370ef8e9788fc8a3720aea2da...fe93f2269c9840f14487c7df8cb9146da2d4e410
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list