[vlc-commits] [Git][videolan/vlc][master] 2 commits: packetizer: hevc: missing POC variable init

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 23 09:26:28 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
46cbd339 by François Cartegnie at 2023-11-23T08:59:50+00:00
packetizer: hevc: missing POC variable init

- - - - -
5c6e8236 by François Cartegnie at 2023-11-23T08:59:50+00:00
codec: videotoolbox: reset POC context on seek

- - - - -


2 changed files:

- modules/codec/videotoolbox/decoder.c
- modules/packetizer/hevc_nal.h


Changes:

=====================================
modules/codec/videotoolbox/decoder.c
=====================================
@@ -117,6 +117,7 @@ typedef struct decoder_sys_t
     bool                        (*pf_codec_init)(decoder_t *);
     void                        (*pf_codec_clean)(void *);
     bool                        (*pf_codec_supported)(decoder_t *);
+    void                        (*pf_codec_flush)(decoder_t *);
     bool                        (*pf_late_start)(decoder_t *);
     block_t*                    (*pf_process_block)(decoder_t *,
                                                     block_t *, bool *);
@@ -528,6 +529,13 @@ static bool CodecSupportedH264(decoder_t *p_dec)
     return true;
 }
 
+static void CodecFlushH264(decoder_t *p_dec)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    struct vt_h264_context *h264ctx = p_sys->p_codec_context;
+    h264_poc_context_init(&h264ctx->poc);
+}
+
 static bool LateStartH264(decoder_t *p_dec)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
@@ -853,6 +861,13 @@ static bool CodecSupportedHEVC(decoder_t *p_dec)
     return true;
 }
 
+static void CodecFlushHEVC(decoder_t *p_dec)
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    struct vt_hevc_context *hevcctx = p_sys->p_codec_context;
+    hevc_poc_cxt_init(&hevcctx->poc);
+}
+
 #define ConfigureVoutHEVC ConfigureVoutH264
 #define ProcessBlockHEVC ProcessBlockH264
 #define VideoToolboxNeedsToRestartHEVC VideoToolboxNeedsToRestartH264
@@ -1563,6 +1578,7 @@ static int OpenDecoder(vlc_object_t *p_this)
             p_sys->pf_codec_init = InitH264;
             p_sys->pf_codec_clean = CleanH264;
             p_sys->pf_codec_supported = CodecSupportedH264;
+            p_sys->pf_codec_flush = CodecFlushH264;
             p_sys->pf_late_start = LateStartH264;
             p_sys->pf_process_block = ProcessBlockH264;
             p_sys->pf_need_restart = VideoToolboxNeedsToRestartH264;
@@ -1578,6 +1594,7 @@ static int OpenDecoder(vlc_object_t *p_this)
             p_sys->pf_codec_init = InitHEVC;
             p_sys->pf_codec_clean = CleanHEVC;
             p_sys->pf_codec_supported = CodecSupportedHEVC;
+            p_sys->pf_codec_flush = CodecFlushHEVC;
             p_sys->pf_late_start = LateStartHEVC;
             p_sys->pf_process_block = ProcessBlockHEVC;
             p_sys->pf_need_restart = VideoToolboxNeedsToRestartHEVC;
@@ -1935,6 +1952,8 @@ static void RequestFlush(decoder_t *p_dec)
     decoder_sys_t *p_sys = p_dec->p_sys;
     Drain(p_dec, true);
     date_Set(&p_sys->pts, VLC_TICK_INVALID);
+    if(p_sys->pf_codec_flush)
+        p_sys->pf_codec_flush(p_dec);
 }
 
 static void Drain(decoder_t *p_dec, bool flush)


=====================================
modules/packetizer/hevc_nal.h
=====================================
@@ -369,6 +369,7 @@ static inline void hevc_poc_cxt_init( hevc_poc_ctx_t *p_ctx )
     p_ctx->prevTid0PicOrderCnt.lsb = 0;
     p_ctx->prevTid0PicOrderCnt.msb = 0;
     p_ctx->first_picture = true;
+    p_ctx->HandleCraAsBlaFlag = false;
 }
 
 int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/64c3fa645b39f97a992a3b01d5a8551300916653...5c6e8236ae830f3044c5bf1e42f625cc28756802

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/64c3fa645b39f97a992a3b01d5a8551300916653...5c6e8236ae830f3044c5bf1e42f625cc28756802
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list