[vlc-devel] [PATCH] codec: hxxx_helper: don't parse hevc streams with h264 parser

Thomas Guillem thomas at gllm.fr
Mon Mar 22 08:15:16 UTC 2021


LGTM

On Fri, Mar 19, 2021, at 19:03, Pierre Lamot wrote:
> ---
>  modules/codec/hxxx_helper.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/codec/hxxx_helper.c b/modules/codec/hxxx_helper.c
> index 33df5f6bce..dae1838a4e 100644
> --- a/modules/codec/hxxx_helper.c
> +++ b/modules/codec/hxxx_helper.c
> @@ -556,7 +556,7 @@ helper_process_block_hevc_annexb(struct hxxx_helper 
> *hh, block_t *p_block,
>  }
>  
>  static block_t *
> -helper_process_block_xvcc2annexb(struct hxxx_helper *hh, block_t 
> *p_block,
> +helper_process_block_h264_xvcc2annexb(struct hxxx_helper *hh, block_t 
> *p_block,
>                                   bool *p_config_changed)
>  {
>      assert(helper_nal_length_valid(hh));
> @@ -565,6 +565,16 @@ helper_process_block_xvcc2annexb(struct 
> hxxx_helper *hh, block_t *p_block,
>      return helper_process_block_h264_annexb(hh, p_block, 
> p_config_changed);
>  }
>  
> +static block_t *
> +helper_process_block_hevc_xvcc2annexb(struct hxxx_helper *hh, block_t 
> *p_block,
> +                                 bool *p_config_changed)
> +{
> +    assert(helper_nal_length_valid(hh));
> +    h264_AVC_to_AnnexB(p_block->p_buffer, p_block->i_buffer,
> +                       hh->i_nal_length_size);
> +    return helper_process_block_hevc_annexb(hh, p_block, 
> p_config_changed);
> +}
> +
>  static block_t *
>  helper_process_block_h264_annexb2avcc(struct hxxx_helper *hh, block_t 
> *p_block,
>                                        bool *p_config_changed)
> @@ -646,7 +656,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const 
> void *p_extra,
>                  if (hh->b_need_xvcC)
>                      hh->pf_process_block = 
> helper_process_block_h264_avcc;
>                  else
> -                    hh->pf_process_block = 
> helper_process_block_xvcc2annexb;
> +                    hh->pf_process_block = 
> helper_process_block_h264_xvcc2annexb;
>              }
>              else /* AnnexB */
>              {
> @@ -662,7 +672,7 @@ hxxx_helper_set_extra(struct hxxx_helper *hh, const 
> void *p_extra,
>                  if (hh->b_need_xvcC)
>                      hh->pf_process_block = 
> helper_process_block_hevc_hvcc;
>                  else
> -                    hh->pf_process_block = 
> helper_process_block_xvcc2annexb;
> +                    hh->pf_process_block = 
> helper_process_block_hevc_xvcc2annexb;
>              }
>              else /* AnnexB */
>              {
> -- 
> GitLab
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list