[vlc-devel] [PATCH 1/9] video_format: add the number of fields per picture in the video format

Steve Lhomme robux4 at ycbcr.xyz
Mon Nov 16 13:44:12 CET 2020


In general it's 2 fields. If the number of fields changes in the source, the
(deinterlacing) filters should be updated.

By default the video format is progressive and the i_num_fields can be ignored.
It should be set to 2 for progressive to be consistent with how the value was
set so far.

This field is more stable than the picture i_nb_fields that also included
repeated fields and pictures. It only contains the information about the
number of fields in each actual picture.
---
 include/vlc_es.h                      | 3 +++
 modules/visualization/visual/visual.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 404a937d833..459d16b3c37 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -376,6 +376,8 @@ struct video_format_t
     video_multiview_mode_t multiview_mode;        /** Multiview mode, 2D, 3D */
     bool b_multiview_right_eye_first;   /** Multiview left or right eye first*/
 
+    unsigned int    i_num_fields;          /**< number of fields per picture */
+
     video_projection_mode_t projection_mode;            /**< projection mode */
     vlc_viewpoint_t pose;
     struct {
@@ -402,6 +404,7 @@ static inline void video_format_Init( video_format_t *p_src, vlc_fourcc_t i_chro
 {
     memset( p_src, 0, sizeof( video_format_t ) );
     p_src->i_chroma = i_chroma;
+    p_src->i_num_fields = 2;
     vlc_viewpoint_init( &p_src->pose );
 }
 
diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index 13343d0f045..8a35b0ddcc6 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -309,6 +309,7 @@ static int Open( vlc_object_t *p_this )
         .transfer = TRANSFER_FUNC_SRGB,
         .primaries = COLOR_PRIMARIES_SRGB,
         .space = COLOR_SPACE_SRGB,
+        .i_num_fields = 2,
     };
     p_sys->p_vout = aout_filter_GetVout( p_filter, &fmt );
     if( p_sys->p_vout == NULL )
-- 
2.26.2



More information about the vlc-devel mailing list