[vlc-commits] [Git][videolan/vlc][master] 14 commits: core: add video_format_IsSameChroma()

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 25 06:36:43 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
61c32377 by Steve Lhomme at 2023-08-25T06:10:33+00:00
core: add video_format_IsSameChroma()

It checks the chroma and the mask for formats with a mask.

- - - - -
336e6cf2 by Steve Lhomme at 2023-08-25T06:10:33+00:00
image: use video_format_IsSameChroma

- - - - -
d8902f97 by Steve Lhomme at 2023-08-25T06:10:33+00:00
filter_chain: also check the output mask matches

Otherwise we don't really have the same chroma (for example RGBX vs XBGR).

- - - - -
2efc1781 by Steve Lhomme at 2023-08-25T06:10:33+00:00
filter: check the mask matches for blender input changes

Otherwise we don't really have the same chroma (for example RGBX vs XBGR).

- - - - -
b6965c62 by Steve Lhomme at 2023-08-25T06:10:33+00:00
subpicture: check the mask matches for picture subregion

Otherwise we don't really have the same chroma (for example RGBX vs XBGR).

- - - - -
1caf1afa by Steve Lhomme at 2023-08-25T06:10:33+00:00
video_output: check the mask matches for blender output changes

Otherwise we don't really have the same chroma (for example RGBX vs XBGR).

- - - - -
953e8361 by Steve Lhomme at 2023-08-25T06:10:33+00:00
display: ensure the converter pool has a matching mask

- - - - -
8d34d045 by Steve Lhomme at 2023-08-25T06:10:33+00:00
video_filter: check the input/output RGB masks match

Otherwise it's not the same chroma and extra processing is needed to do
the filtering.

- - - - -
206fc4c3 by Steve Lhomme at 2023-08-25T06:10:33+00:00
hqdn3d: exit early on mismatching chroma and RGB mask

We don't need to do the costly check of plane count if the chroma doesn't match.

We also need to check the RGB mask matches as it may not be the same component
layout.

- - - - -
a57c91e6 by Steve Lhomme at 2023-08-25T06:10:33+00:00
orient: check the input/output RGB masks match

Otherwise it's not actually the same chroma, which is what is expected. And
extra processing is needed to do the conversion.

- - - - -
d2b13ee7 by Steve Lhomme at 2023-08-25T06:10:33+00:00
chroma/chain: check RGB mask to tell if chroma conversion is needed

If the mask is not the same, it's not really the same chroma and we need a
chroma converter.

- - - - -
5453a717 by Steve Lhomme at 2023-08-25T06:10:33+00:00
opengl: vout_helper: also check the RGB mask with the chroma

Otherwise it's not actually the same component layout.

- - - - -
6e7d7bd8 by Steve Lhomme at 2023-08-25T06:10:33+00:00
sdi: check the RGB mask to tell if a chroma conversion is needed

- - - - -
c5a68b44 by Steve Lhomme at 2023-08-25T06:10:33+00:00
dxa9: check the RGB mask to tell if a chroma conversion is needed

- - - - -


27 changed files:

- include/vlc_es.h
- modules/hw/d3d9/dxa9.c
- modules/stream_out/sdi/SDIStream.cpp
- modules/video_chroma/chain.c
- modules/video_chroma/orient.c
- modules/video_filter/adjust.c
- modules/video_filter/canvas.c
- modules/video_filter/colorthres.c
- modules/video_filter/croppadd.c
- modules/video_filter/deinterlace/deinterlace.c
- modules/video_filter/fps.c
- modules/video_filter/gaussianblur.c
- modules/video_filter/hqdn3d.c
- modules/video_filter/mirror.c
- modules/video_filter/posterize.c
- modules/video_filter/postproc.c
- modules/video_filter/rotate.c
- modules/video_filter/scale.c
- modules/video_output/opengl/vout_helper.c
- src/libvlccore.sym
- src/misc/es_format.c
- src/misc/filter.c
- src/misc/filter_chain.c
- src/misc/image.c
- src/misc/subpicture.c
- src/video_output/display.c
- src/video_output/video_output.c


Changes:

=====================================
include/vlc_es.h
=====================================
@@ -540,6 +540,9 @@ VLC_API video_transform_t video_format_GetTransform(video_orientation_t src, vid
  */
 VLC_API bool video_format_IsSimilar( const video_format_t *, const video_format_t * );
 
+/** Checks whether the video formats have the same chroma and mask */
+VLC_API bool video_format_IsSameChroma( const video_format_t *, const video_format_t * );
+
 /**
  * It prints details about the given video_format_t
  */


=====================================
modules/hw/d3d9/dxa9.c
=====================================
@@ -523,7 +523,7 @@ int D3D9OpenCPUConverter( filter_t *p_filter )
     d3d9_video_context_t *vctx_sys = GetD3D9ContextPrivate( p_filter->vctx_out );
     vctx_sys->format = p_dst->format.i_chroma;
 
-    if ( p_filter->fmt_in.video.i_chroma != p_dst->format.i_chroma )
+    if ( !video_format_IsSameChroma( &p_filter->fmt_in.video, &p_dst->format ) )
     {
         p_sys->filter = CreateFilter(p_filter, &p_filter->fmt_in, p_dst->format.i_chroma);
         if (!p_sys->filter)


=====================================
modules/stream_out/sdi/SDIStream.cpp
=====================================
@@ -537,7 +537,7 @@ filter_chain_t * VideoDecodedStream::VideoFilterCreate(const es_format_t *p_srcf
         return NULL;
     filter_chain_Reset(p_chain, p_srcfmt, vctx, &requestedoutput);
 
-    if(p_srcfmt->video.i_chroma != requestedoutput.video.i_chroma)
+    if(!video_format_IsSameChroma( &p_srcfmt->video, &requestedoutput.video))
     {
         if(filter_chain_AppendConverter(p_chain, &requestedoutput) != VLC_SUCCESS)
         {


=====================================
modules/video_chroma/chain.c
=====================================
@@ -244,7 +244,7 @@ static int Activate( filter_t *p_filter, int (*pf_build)(filter_t *) )
 
 static int ActivateConverter( filter_t *p_filter )
 {
-    const bool b_chroma = p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma;
+    const bool b_chroma = !video_format_IsSameChroma( &p_filter->fmt_in.video, &p_filter->fmt_out.video);
     const bool b_resize = p_filter->fmt_in.video.i_width  != p_filter->fmt_out.video.i_width ||
                           p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height;
 


=====================================
modules/video_chroma/orient.c
=====================================
@@ -276,14 +276,14 @@ static int Open(filter_t *filter)
     video_format_t src_trans = *src;
     video_format_TransformBy(&src_trans, transform);
 
-    if (dst->i_chroma         != src_trans.i_chroma ||
+    if (!video_format_IsSameChroma( dst, &src_trans ) ||
         dst->i_width          != src_trans.i_width ||
         dst->i_visible_width  != src_trans.i_visible_width ||
         dst->i_height         != src_trans.i_height ||
         dst->i_visible_height != src_trans.i_visible_height ||
         dst->i_x_offset       != src_trans.i_x_offset ||
         dst->i_y_offset       != src_trans.i_y_offset)
-        return VLC_ENOTSUP; /* This module cannot rescale */
+        return VLC_ENOTSUP; /* This module cannot rescale or change chroma */
 
     const vlc_chroma_description_t *chroma =
         vlc_fourcc_GetChromaDescription(src->i_chroma);


=====================================
modules/video_filter/adjust.c
=====================================
@@ -132,7 +132,8 @@ static const struct vlc_filter_operations packed_filter_ops =
  *****************************************************************************/
 static int Create( filter_t *p_filter )
 {
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/canvas.c
=====================================
@@ -170,7 +170,8 @@ static int Activate( filter_t *p_filter )
         return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/colorthres.c
=====================================
@@ -130,7 +130,8 @@ static int Create( filter_t *p_filter )
             return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/croppadd.c
=====================================
@@ -154,7 +154,8 @@ static int OpenFilter( filter_t *p_filter )
         return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         /* In fact we don't really care about this since we're allowed


=====================================
modules/video_filter/deinterlace/deinterlace.c
=====================================
@@ -620,7 +620,7 @@ notsupp:
     free( psz_mode );
 
     if( !p_filter->b_allow_fmt_out_change &&
-        ( fmt.i_chroma != p_filter->fmt_in.video.i_chroma ||
+        ( !video_format_IsSameChroma( &fmt, &p_filter->fmt_in.video ) ||
           fmt.i_height != p_filter->fmt_in.video.i_height ) )
     {
         Close( p_filter );


=====================================
modules/video_filter/fps.c
=====================================
@@ -165,7 +165,8 @@ static int Open( filter_t *p_filter )
     filter_sys_t *p_sys;
 
     /* This filter cannot change the format. */
-    if( p_filter->fmt_out.video.i_chroma != p_filter->fmt_in.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
         return VLC_EGENERIC;
 
     p_sys = p_filter->p_sys = vlc_obj_malloc( VLC_OBJECT(p_filter), sizeof( *p_sys ) );


=====================================
modules/video_filter/gaussianblur.c
=====================================
@@ -136,7 +136,8 @@ static int Create( filter_t *p_filter )
         return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/hqdn3d.c
=====================================
@@ -106,9 +106,13 @@ static int Open(filter_t *filter)
     const video_format_t *fmt_in  = &filter->fmt_in.video;
     const video_format_t *fmt_out = &filter->fmt_out.video;
     const vlc_fourcc_t fourcc_in  = fmt_in->i_chroma;
-    const vlc_fourcc_t fourcc_out = fmt_out->i_chroma;
     int wmax = 0;
 
+    if ( !video_format_IsSameChroma( fmt_in, fmt_out ) ) {
+        msg_Err(filter, "Input and output chromas don't match");
+        return VLC_EGENERIC;
+    }
+
     const vlc_chroma_description_t *chroma =
             vlc_fourcc_GetChromaDescription(fourcc_in);
     if (!chroma || chroma->plane_count != 3 || chroma->pixel_size != 1) {
@@ -116,11 +120,6 @@ static int Open(filter_t *filter)
         return VLC_EGENERIC;
     }
 
-    if (fourcc_in != fourcc_out) {
-        msg_Err(filter, "Input and output chromas don't match");
-        return VLC_EGENERIC;
-    }
-
     /* Allocate structure */
     sys = calloc(1, sizeof(filter_sys_t));
     if (!sys) {


=====================================
modules/video_filter/mirror.c
=====================================
@@ -130,7 +130,8 @@ static int Create( filter_t *p_filter )
             return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/posterize.c
=====================================
@@ -112,7 +112,8 @@ static int Create( filter_t *p_filter )
             return VLC_EGENERIC;
     }
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/postproc.c
=====================================
@@ -122,7 +122,8 @@ static int OpenPostproc( filter_t *p_filter )
     const char *desc;
     int i_flags = PP_CPU_CAPS_AUTO;
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma ||
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) ||
         p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ||
         p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width )
     {


=====================================
modules/video_filter/rotate.c
=====================================
@@ -117,7 +117,8 @@ static int Create( filter_t *p_filter )
 {
     filter_sys_t *p_sys;
 
-    if( p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+    if( !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         msg_Err( p_filter, "Input and output chromas don't match" );
         return VLC_EGENERIC;


=====================================
modules/video_filter/scale.c
=====================================
@@ -62,7 +62,8 @@ static int OpenFilter( filter_t *p_filter )
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_ARGB &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGRA &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_ABGR ) ||
-        p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma )
+        !video_format_IsSameChroma( &p_filter->fmt_in.video,
+                                    &p_filter->fmt_out.video ) )
     {
         return VLC_EGENERIC;
     }


=====================================
modules/video_output/opengl/vout_helper.c
=====================================
@@ -294,7 +294,7 @@ int vout_display_opengl_UpdateFormat(vout_display_opengl_t *vgl,
         return VLC_EGENERIC;
     }
 
-    if (in_fmt.i_chroma != fmt->i_chroma)
+    if ( !video_format_IsSameChroma( &in_fmt, fmt ) )
     {
         msg_Warn(gl, "Could not update format, the interop changed the "
                      "requested chroma from %4.4s to %4.4s\n",


=====================================
src/libvlccore.sym
=====================================
@@ -506,6 +506,7 @@ video_format_TransformBy
 video_format_TransformTo
 video_format_GetTransform
 video_format_IsSimilar
+video_format_IsSameChroma
 video_format_Setup
 video_format_Print
 vlc_actions_get_id


=====================================
src/misc/es_format.c
=====================================
@@ -342,27 +342,12 @@ void video_format_ApplyRotation( video_format_t *restrict out,
     video_format_TransformTo(out, ORIENT_NORMAL);
 }
 
-bool video_format_IsSimilar( const video_format_t *f1,
-                             const video_format_t *f2 )
+bool video_format_IsSameChroma( const video_format_t *f1,
+                                const video_format_t *f2 )
 {
     if( f1->i_chroma != f2->i_chroma )
         return false;
 
-    if( f1->i_width != f2->i_width || f1->i_height != f2->i_height ||
-        f1->i_visible_width != f2->i_visible_width ||
-        f1->i_visible_height != f2->i_visible_height ||
-        f1->i_x_offset != f2->i_x_offset || f1->i_y_offset != f2->i_y_offset )
-        return false;
-    if( (int64_t)f1->i_sar_num * f2->i_sar_den !=
-        (int64_t)f2->i_sar_num * f1->i_sar_den )
-        return false;
-
-    if( f1->orientation != f2->orientation)
-        return false;
-
-    if( f1->multiview_mode!= f2->multiview_mode )
-       return false;
-
     if( f1->i_chroma == VLC_CODEC_RGB15 ||
         f1->i_chroma == VLC_CODEC_RGB16 ||
         f1->i_chroma == VLC_CODEC_RGB24 ||
@@ -382,6 +367,30 @@ bool video_format_IsSimilar( const video_format_t *f1,
     return true;
 }
 
+bool video_format_IsSimilar( const video_format_t *f1,
+                             const video_format_t *f2 )
+{
+    if( !video_format_IsSameChroma( f1, f2 ) )
+        return false;
+
+    if( f1->i_width != f2->i_width || f1->i_height != f2->i_height ||
+        f1->i_visible_width != f2->i_visible_width ||
+        f1->i_visible_height != f2->i_visible_height ||
+        f1->i_x_offset != f2->i_x_offset || f1->i_y_offset != f2->i_y_offset )
+        return false;
+    if( (int64_t)f1->i_sar_num * f2->i_sar_den !=
+        (int64_t)f2->i_sar_num * f1->i_sar_den )
+        return false;
+
+    if( f1->orientation != f2->orientation)
+        return false;
+
+    if( f1->multiview_mode!= f2->multiview_mode )
+       return false;
+
+    return true;
+}
+
 static const char *orient_to_string[] =
 {
     [ORIENT_NORMAL]             = "normal",


=====================================
src/misc/filter.c
=====================================
@@ -132,7 +132,7 @@ int filter_ConfigureBlend( vlc_blender_t *p_blend,
 {
     /* */
     if( p_blend->p_module &&
-        p_blend->fmt_in.video.i_chroma != p_src->i_chroma )
+        !video_format_IsSameChroma( &p_blend->fmt_in.video, p_src ) )
     {
         /* The chroma is not the same, we need to reload the blend module */
         filter_Close( p_blend );


=====================================
src/misc/filter_chain.c
=====================================
@@ -413,7 +413,7 @@ vlc_video_context *filter_chain_GetVideoCtxOut(const filter_chain_t *p_chain)
         return p_chain->last->filter.vctx_out;
 
     /* No filter was added, the filter chain has no effect, make sure the chromas are compatible */
-    assert(p_chain->fmt_in.video.i_chroma == p_chain->fmt_out.video.i_chroma);
+    assert( video_format_IsSameChroma( &p_chain->fmt_in.video, &p_chain->fmt_out.video ) );
     return p_chain->vctx_in;
 }
 


=====================================
src/misc/image.c
=====================================
@@ -244,14 +244,14 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
         p_fmt_out->space = p_image->p_dec->fmt_out.video.space;
 
     /* Check if we need chroma conversion or resizing */
-    if( p_image->p_dec->fmt_out.video.i_chroma != p_fmt_out->i_chroma ||
+    if( !video_format_IsSameChroma( &p_image->p_dec->fmt_out.video, p_fmt_out ) ||
         p_image->p_dec->fmt_out.video.i_width != p_fmt_out->i_width ||
         p_image->p_dec->fmt_out.video.i_height != p_fmt_out->i_height )
     {
         if( p_image->p_converter &&
-            ( p_image->p_converter->fmt_in.video.i_chroma !=
-              p_image->p_dec->fmt_out.video.i_chroma ||
-              p_image->p_converter->fmt_out.video.i_chroma != p_fmt_out->i_chroma ) )
+            ( !video_format_IsSameChroma( &p_image->p_converter->fmt_in.video,
+                                          &p_image->p_dec->fmt_out.video ) ||
+              !video_format_IsSameChroma( &p_image->p_converter->fmt_out.video, p_fmt_out ) ) )
         {
             /* We need to restart a new filter */
             DeleteConverter( p_image->p_converter );
@@ -346,29 +346,6 @@ error:
     return NULL;
 }
 
-/* FIXME: refactor by splitting video_format_IsSimilar() API */
-static bool BitMapFormatIsSimilar( const video_format_t *f1,
-                                   const video_format_t *f2 )
-{
-    if( f1->i_chroma == VLC_CODEC_RGB15 ||
-        f1->i_chroma == VLC_CODEC_RGB16 ||
-        f1->i_chroma == VLC_CODEC_RGB24 ||
-        f1->i_chroma == VLC_CODEC_RGB32 )
-    {
-        video_format_t v1 = *f1;
-        video_format_t v2 = *f2;
-
-        video_format_FixRgb( &v1 );
-        video_format_FixRgb( &v2 );
-
-        if( v1.i_rmask != v2.i_rmask ||
-            v1.i_gmask != v2.i_gmask ||
-            v1.i_bmask != v2.i_bmask )
-            return false;
-    }
-    return true;
-}
-
 /**
  * Write an image
  *
@@ -400,17 +377,15 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
     picture_Hold(p_pic);
 
     /* Check if we need chroma conversion or resizing */
-    if( p_image->p_enc->fmt_in.video.i_chroma != p_fmt_in->i_chroma ||
+    if( !video_format_IsSameChroma(&p_image->p_enc->fmt_in.video, p_fmt_in) ||
         p_image->p_enc->fmt_in.video.i_width != p_fmt_in->i_width ||
-        p_image->p_enc->fmt_in.video.i_height != p_fmt_in->i_height ||
-       !BitMapFormatIsSimilar( &p_image->p_enc->fmt_in.video, p_fmt_in ) )
+        p_image->p_enc->fmt_in.video.i_height != p_fmt_in->i_height )
     {
 
         if( p_image->p_converter &&
-            ( p_image->p_converter->fmt_in.video.i_chroma != p_fmt_in->i_chroma ||
-              p_image->p_converter->fmt_out.video.i_chroma !=
-              p_image->p_enc->fmt_in.video.i_chroma ||
-             !BitMapFormatIsSimilar( &p_image->p_converter->fmt_in.video, p_fmt_in ) ) )
+            ( !video_format_IsSameChroma( &p_image->p_converter->fmt_in.video, p_fmt_in ) ||
+              !video_format_IsSameChroma( &p_image->p_converter->fmt_out.video,
+                                          &p_image->p_enc->fmt_in.video ) ) )
         {
             /* We need to restart a new filter */
             DeleteConverter( p_image->p_converter );
@@ -540,8 +515,8 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
     if( !p_fmt_out->i_sar_den ) p_fmt_out->i_sar_den = p_fmt_in->i_sar_den;
 
     if( p_image->p_converter &&
-        ( p_image->p_converter->fmt_in.video.i_chroma != p_fmt_in->i_chroma ||
-          p_image->p_converter->fmt_out.video.i_chroma != p_fmt_out->i_chroma ) )
+        ( !video_format_IsSameChroma( &p_image->p_converter->fmt_in.video, p_fmt_in ) ||
+          !video_format_IsSameChroma( &p_image->p_converter->fmt_out.video, p_fmt_out ) ) )
     {
         /* We need to restart a new filter */
         DeleteConverter( p_image->p_converter );


=====================================
src/misc/subpicture.c
=====================================
@@ -258,7 +258,7 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
 
 subpicture_region_t *subpicture_region_ForPicture( const video_format_t *p_fmt, picture_t *pic )
 {
-    if ( p_fmt->i_chroma != pic->format.i_chroma )
+    if ( !video_format_IsSameChroma( p_fmt, &pic->format ) )
         return NULL;
 
     subpicture_region_t *p_region = subpicture_region_NewInternal( p_fmt );


=====================================
src/video_output/display.c
=====================================
@@ -259,7 +259,7 @@ static picture_t *SourceConverterBuffer(filter_t *filter)
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
     const video_format_t *fmt = &filter->fmt_out.video;
 
-    assert(osys->display_fmt.i_chroma == fmt->i_chroma &&
+    assert( video_format_IsSameChroma( &osys->display_fmt, fmt) &&
            osys->display_fmt.i_width  == fmt->i_width  &&
            osys->display_fmt.i_height == fmt->i_height);
 


=====================================
src/video_output/video_output.c
=====================================
@@ -1179,7 +1179,7 @@ static int PrerenderPicture(vout_thread_sys_t *sys, picture_t *filtered,
         }
 
         if (sys->spu_blend &&
-            sys->spu_blend->fmt_out.video.i_chroma != fmt_spu.i_chroma) {
+            video_format_IsSameChroma(&sys->spu_blend->fmt_out.video, &fmt_spu)) {
             filter_DeleteBlend(sys->spu_blend);
             sys->spu_blend = NULL;
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6580f17e4dcfd5e486765e1b3b8a74faa6be9d2e...c5a68b441c3dd53e13d8f27adb4e63a9fe509afa

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6580f17e4dcfd5e486765e1b3b8a74faa6be9d2e...c5a68b441c3dd53e13d8f27adb4e63a9fe509afa
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