[vlc-devel] [PATCH 4/4] es_out: rename: s/es_master/es_parent, s/es_slaves/es_children

Thomas Guillem thomas at gllm.fr
Thu Mar 11 12:38:06 UTC 2021


In order to use more descriptive and inclusive terms.
The es_parent term was already used in this files.

No functional changes.
---
 src/input/es_out.c | 114 ++++++++++++++++++++++-----------------------
 1 file changed, 57 insertions(+), 57 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 10ce2cbab65..c646defb6c2 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -146,8 +146,8 @@ struct es_out_id_t
         es_out_id_t  *pp_es[64]; /* a max of 64 chans for CEA708 */
     } cc;
 
-    /* Field for CC track from a master video */
-    es_out_id_t *p_master;
+    /* Field for CC track from a parent video ES */
+    es_out_id_t *p_parent;
 
     struct vlc_list node;
 
@@ -187,7 +187,7 @@ typedef struct
     /* all es */
     int         i_id;
     struct vlc_list es;
-    struct vlc_list es_slaves; /* Dynamically created es on regular es selection */
+    struct vlc_list es_children; /* Dynamically created es on regular es selection */
 
     /* mode gestion */
     bool  b_active;
@@ -276,9 +276,9 @@ static inline int EsOutGetClosedCaptionsChannel( const es_format_t *p_fmt )
     return i_channel;
 }
 
-#define foreach_es_then_es_slaves( pos ) \
+#define foreach_es_then_es_children( pos ) \
     for( int fetes_i=0; fetes_i<2; fetes_i++ ) \
-        vlc_list_foreach( pos, (!fetes_i ? &p_sys->es : &p_sys->es_slaves), node )
+        vlc_list_foreach( pos, (!fetes_i ? &p_sys->es : &p_sys->es_children), node )
 
 static void
 decoder_on_vout_started(vlc_input_decoder_t *decoder, vout_thread_t *vout,
@@ -504,7 +504,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, input_source_t *main_source,
 
     vlc_list_init(&p_sys->programs);
     vlc_list_init(&p_sys->es);
-    vlc_list_init(&p_sys->es_slaves);
+    vlc_list_init(&p_sys->es_children);
 
     /* */
     EsOutPropsInit( &p_sys->video, true, p_input, ES_OUT_ES_POLICY_AUTO,
@@ -609,7 +609,7 @@ static void EsOutDelete( es_out_t *out )
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
 
     assert(vlc_list_is_empty(&p_sys->es));
-    assert(vlc_list_is_empty(&p_sys->es_slaves));
+    assert(vlc_list_is_empty(&p_sys->es_children));
     assert(vlc_list_is_empty(&p_sys->programs));
     assert(p_sys->p_pgrm == NULL);
     EsOutPropsCleanup( &p_sys->video );
@@ -638,7 +638,7 @@ static void EsOutTerminate( es_out_t *out )
     if( p_sys->p_sout_record )
         EsOutSetRecord( out, false );
 
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
     {
         if (es->p_dec != NULL)
             vlc_input_decoder_Delete(es->p_dec);
@@ -690,7 +690,7 @@ static es_out_id_t *EsOutGetSelectedCat( es_out_t *out,
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     es_out_id_t *es;
 
-    foreach_es_then_es_slaves( es )
+    foreach_es_then_es_children( es )
         if( es->fmt.i_cat == cat && EsIsSelected( es ) )
             return es;
     return NULL;
@@ -708,7 +708,7 @@ static bool EsOutDecodersIsEmpty( es_out_t *out )
             return true;
     }
 
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
     {
         if( es->p_dec && !vlc_input_decoder_IsEmpty( es->p_dec ) )
             return false;
@@ -743,7 +743,7 @@ static void EsOutSetDelay( es_out_t *out, int i_cat, vlc_tick_t i_delay )
     else if( i_cat == SPU_ES )
         p_sys->i_spu_delay = i_delay;
 
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
         EsOutDecoderChangeDelay(out, es);
 
     /* Update the clock pts delay only if the extra tracks delay changed */
@@ -804,7 +804,7 @@ static int EsOutSetRecord(  es_out_t *out, bool b_record )
         if( !p_sys->p_sout_record )
             return VLC_EGENERIC;
 
-        vlc_list_foreach( p_es, &p_sys->es, node ) /* Only master es */
+        vlc_list_foreach( p_es, &p_sys->es, node ) /* Only parent es */
         {
             if( !p_es->p_dec )
                 continue;
@@ -821,7 +821,7 @@ static int EsOutSetRecord(  es_out_t *out, bool b_record )
     }
     else
     {
-        vlc_list_foreach( p_es, &p_sys->es, node ) /* Only master es */
+        vlc_list_foreach( p_es, &p_sys->es, node ) /* Only parent es */
         {
             if( !p_es->p_dec_record )
                 continue;
@@ -886,7 +886,7 @@ static void EsOutChangeRate( es_out_t *out, float rate )
     p_sys->rate = rate;
     EsOutProgramsChangeRate( out );
 
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
         if( es->p_dec != NULL )
             vlc_input_decoder_ChangeRate( es->p_dec, rate );
 }
@@ -898,7 +898,7 @@ static void EsOutChangePosition( es_out_t *out, bool b_flush )
 
     input_SendEventCache( p_sys->p_input, 0.0 );
 
-    foreach_es_then_es_slaves(p_es)
+    foreach_es_then_es_children(p_es)
     {
         if( p_es->p_dec != NULL )
         {
@@ -996,7 +996,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
     }
 
     const vlc_tick_t i_decoder_buffering_start = vlc_tick_now();
-    foreach_es_then_es_slaves(p_es)
+    foreach_es_then_es_children(p_es)
     {
         if( !p_es->p_dec || p_es->fmt.i_cat == SPU_ES )
             continue;
@@ -1024,7 +1024,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
 
     input_clock_ChangeSystemOrigin( p_sys->p_pgrm->p_input_clock, true, update );
 
-    foreach_es_then_es_slaves(p_es)
+    foreach_es_then_es_children(p_es)
     {
         if( !p_es->p_dec )
             continue;
@@ -1040,7 +1040,7 @@ static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, vlc_tick_t i
     es_out_id_t *es;
 
     /* Pause decoders first */
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
         if( es->p_dec )
         {
             vlc_input_decoder_ChangePause( es->p_dec, b_paused, i_date );
@@ -1056,7 +1056,7 @@ static bool EsOutIsExtraBufferingAllowed( es_out_t *out )
     es_out_id_t *p_es;
 
     size_t i_size = 0;
-    foreach_es_then_es_slaves(p_es)
+    foreach_es_then_es_children(p_es)
     {
         if( p_es->p_dec )
             i_size += vlc_input_decoder_GetFifoSize( p_es->p_dec );
@@ -1127,7 +1127,7 @@ static void EsOutFrameNext( es_out_t *out )
 
     assert( p_sys->b_paused );
 
-    foreach_es_then_es_slaves(p_es)
+    foreach_es_then_es_children(p_es)
         if( p_es->fmt.i_cat == VIDEO_ES && p_es->p_dec && !p_es_video /* nested loop */ )
         {
             p_es_video = p_es;
@@ -1249,7 +1249,7 @@ static void EsOutSendEsEvent(es_out_t *out, es_out_id_t *es, int action,
  * default groups (i_group == 0) sent by slave sources.
  */
 static inline bool EsOutIsGroupSticky( es_out_t *p_out, input_source_t *source,
-                                         int i_group )
+                                       int i_group )
 {
     es_out_sys_t *p_sys = container_of(p_out, es_out_sys_t, out);
     return source != input_priv(p_sys->p_input)->master && i_group == 0;
@@ -1281,7 +1281,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
 
         msg_Dbg( p_input, "unselecting program id=%d", old->i_id );
 
-        foreach_es_then_es_slaves(es)
+        foreach_es_then_es_children(es)
         {
             if (es->p_pgrm != old)
                 continue;
@@ -1311,7 +1311,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
     /* Mark it selected */
     p_pgrm->b_selected = true;
 
-    /* Switch master stream */
+    /* Switch main stream */
     p_sys->p_pgrm = p_pgrm;
 
     /* Update "program" */
@@ -1320,7 +1320,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
     /* Update "es-*" */
     input_SendEventProgramScrambled( p_input, p_pgrm->i_id, p_pgrm->b_scrambled );
 
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
     {
 
         if (es->p_pgrm == NULL)
@@ -1461,7 +1461,7 @@ static int EsOutProgramDel( es_out_t *out, input_source_t *source, int i_group )
 
     /* Unselect sticky ES tracks */
     es_out_id_t *es;
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
     {
         if (es->p_pgrm != p_pgrm)
             continue;
@@ -1777,7 +1777,7 @@ static void EsOutProgramUpdateScrambled( es_out_t *p_out, es_out_pgrm_t *p_pgrm
     es_out_id_t *es;
     bool b_scrambled = false;
 
-    vlc_list_foreach( es, &p_sys->es, node ) /* Only master es */
+    vlc_list_foreach( es, &p_sys->es, node ) /* Only parent es */
         if (es->p_pgrm == p_pgrm && es->b_scrambled)
         {
             b_scrambled = true;
@@ -1927,16 +1927,16 @@ static void EsOutFillEsFmt(es_out_t *out, es_format_t *fmt)
 }
 
 static char *EsOutCreateStrId( es_out_id_t *es, bool stable, const char *id,
-                               es_out_id_t *p_master )
+                               es_out_id_t *p_parent )
 {
     struct vlc_memstream ms;
     int ret = vlc_memstream_open( &ms );
     if( ret != 0 )
         return NULL;
 
-    if( p_master )
+    if( p_parent )
     {
-        vlc_memstream_puts( &ms, p_master->id.str_id );
+        vlc_memstream_puts( &ms, p_parent->id.str_id );
         vlc_memstream_puts( &ms, "/cc/" );
     }
     else if ( id )
@@ -1968,7 +1968,7 @@ static char *EsOutCreateStrId( es_out_id_t *es, bool stable, const char *id,
 
 static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
                                     const es_format_t *fmt,
-                                    es_out_id_t *p_master )
+                                    es_out_id_t *p_parent )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     input_thread_t    *p_input = p_sys->p_input;
@@ -2008,7 +2008,7 @@ static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
         es->fmt.i_original_fourcc = es->fmt.i_codec;
 
     char *str_id =
-        EsOutCreateStrId( es, stable, input_source_GetStrId(source), p_master );
+        EsOutCreateStrId( es, stable, input_source_GetStrId(source), p_parent );
     if( !str_id )
     {
         es_format_Clean( &es->fmt );
@@ -2042,7 +2042,7 @@ static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
     /* Get the number of ES already added in order to get the position of the es */
     es->i_pos = 0;
     es_out_id_t *it;
-    foreach_es_then_es_slaves(it)
+    foreach_es_then_es_children(it)
         if( it->fmt.i_cat == fmt->i_cat && it->fmt.i_group == fmt->i_group )
             es->i_pos++;
 
@@ -2087,13 +2087,13 @@ static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
     es->is_driver = false;
     es->cc.type = 0;
     es->cc.i_bitmap = 0;
-    es->p_master = p_master;
+    es->p_parent = p_parent;
     es->mouse_event_cb = NULL;
     es->mouse_event_userdata = NULL;
     es->i_pts_level = VLC_TICK_INVALID;
     es->delay = INT64_MAX;
 
-    vlc_list_append(&es->node, es->p_master ? &p_sys->es_slaves : &p_sys->es);
+    vlc_list_append(&es->node, es->p_parent ? &p_sys->es_children : &p_sys->es);
 
     vlc_atomic_rc_init(&es->rc);
 
@@ -2124,13 +2124,13 @@ static es_out_id_t *EsOutAdd( es_out_t *out, input_source_t *source, const es_fo
 
 static bool EsIsSelected( es_out_id_t *es )
 {
-    if( es->p_master )
+    if( es->p_parent )
     {
         bool b_decode = false;
-        if( es->p_master->p_dec )
+        if( es->p_parent->p_dec )
         {
             int i_channel = EsOutGetClosedCaptionsChannel( &es->fmt );
-            vlc_input_decoder_GetCcState( es->p_master->p_dec, es->fmt.i_codec,
+            vlc_input_decoder_GetCcState( es->p_parent->p_dec, es->fmt.i_codec,
                                           i_channel, &b_decode );
         }
         return b_decode;
@@ -2198,7 +2198,7 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
         if( p_sys->b_buffering )
             vlc_input_decoder_StartWait( dec );
 
-        if( !p_es->p_master && p_sys->p_sout_record )
+        if( !p_es->p_parent && p_sys->p_sout_record )
         {
             p_es->p_dec_record =
                 vlc_input_decoder_New( VLC_OBJECT(p_input), &p_es->fmt, NULL,
@@ -2261,16 +2261,16 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es, bool b_force )
     if( !es->p_pgrm )
         return;
 
-    if( es->p_master )
+    if( es->p_parent )
     {
         int i_channel;
-        if( !es->p_master->p_dec )
+        if( !es->p_parent->p_dec )
             return;
 
         i_channel = EsOutGetClosedCaptionsChannel( &es->fmt );
 
         if( i_channel == -1 ||
-            vlc_input_decoder_SetCcState( es->p_master->p_dec, es->fmt.i_codec,
+            vlc_input_decoder_SetCcState( es->p_parent->p_dec, es->fmt.i_codec,
                                           i_channel, true ) )
             return;
     }
@@ -2323,7 +2323,7 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es, bool b_force )
 
     /* Special case of the zvbi decoder for teletext: send the initial selected
      * page and transparency */
-    if( !es->p_master )
+    if( !es->p_parent )
     {
         bool vbi_opaque;
         int vbi_page = vlc_input_decoder_GetVbiPage( es->p_dec, &vbi_opaque );
@@ -2386,13 +2386,13 @@ static void EsOutUnselectEs( es_out_t *out, es_out_id_t *es, bool b_update )
         return;
     }
 
-    if( es->p_master )
+    if( es->p_parent )
     {
-        if( es->p_master->p_dec )
+        if( es->p_parent->p_dec )
         {
             int i_channel = EsOutGetClosedCaptionsChannel( &es->fmt );
             if( i_channel != -1 )
-                vlc_input_decoder_SetCcState( es->p_master->p_dec, es->fmt.i_codec,
+                vlc_input_decoder_SetCcState( es->p_parent->p_dec, es->fmt.i_codec,
                                               i_channel, false );
         }
     }
@@ -2610,7 +2610,7 @@ static void EsOutSelectListFromProps( es_out_t *out, enum es_format_category_e c
 
     bool unselect_others = false;
     es_out_id_t *other;
-    foreach_es_then_es_slaves( other )
+    foreach_es_then_es_children( other )
     {
         if( other->fmt.i_cat != cat )
             continue;
@@ -2658,7 +2658,7 @@ static void EsOutSelectList( es_out_t *out, enum es_format_category_e cat,
     es_out_es_props_t *p_esprops = GetPropsByCat( p_sys, cat );
 
     bool unselect_others = false;
-    foreach_es_then_es_slaves(other)
+    foreach_es_then_es_children(other)
     {
         if( other->fmt.i_cat != cat )
             continue;
@@ -2927,7 +2927,7 @@ static void EsOutDelLocked( es_out_t *out, es_out_id_t *es )
     {
         es_out_id_t *other;
 
-        foreach_es_then_es_slaves(other)
+        foreach_es_then_es_children(other)
             if( es->fmt.i_cat == other->fmt.i_cat )
             {
                 if (EsIsSelected(other))
@@ -2974,7 +2974,7 @@ static vlc_tick_t EsOutGetTracksDelay(es_out_t *out)
     /* Get the smaller (and negative) delay between category delays and tracks
      * delays */
     es_out_id_t *es;
-    foreach_es_then_es_slaves(es)
+    foreach_es_then_es_children(es)
     {
         if (es->p_dec)
         {
@@ -3068,7 +3068,7 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
             i_cat = IGNORE_ES;
         }
 
-        foreach_es_then_es_slaves(other)
+        foreach_es_then_es_children(other)
         {
             if( i_cat == IGNORE_ES )
             {
@@ -3112,7 +3112,7 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
         es_out_id_t *es = va_arg( args, es_out_id_t * ), *other;
         if (es->b_terminated)
             return VLC_EGENERIC;
-        foreach_es_then_es_slaves(other)
+        foreach_es_then_es_children(other)
         {
             if (es == other)
             {
@@ -3513,7 +3513,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
             es_out_id_t *p_es;
             bool found = false;
 
-            foreach_es_then_es_slaves(p_es)
+            foreach_es_then_es_children(p_es)
                 if( p_es->fmt.i_cat == VIDEO_ES && !found /* nested loop */ )
                 {
                     found = true;
@@ -3529,12 +3529,12 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
         /* Reapply policy mode */
         es_out_id_t *es;
 
-        foreach_es_then_es_slaves(es)
+        foreach_es_then_es_children(es)
         {
             if (EsIsSelected(es))
                 EsOutUnselectEs(out, es, es->p_pgrm == p_sys->p_pgrm);
         }
-        foreach_es_then_es_slaves(es)
+        foreach_es_then_es_children(es)
         {
             EsOutSelect(out, es, false);
         }
@@ -3593,7 +3593,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
         es_out_id_t *es;
         int count = 0;
 
-        foreach_es_then_es_slaves(es)
+        foreach_es_then_es_children(es)
             count++;
 
         vlc_es_id_t **selected_es = vlc_alloc(count + 1, sizeof(vlc_es_id_t *));
@@ -3602,7 +3602,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
 
         *va_arg(args, vlc_es_id_t ***) = selected_es;
 
-        foreach_es_then_es_slaves(es)
+        foreach_es_then_es_children(es)
         {
             if (EsIsSelected(es))
             {
@@ -3759,7 +3759,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
     case ES_OUT_PRIV_SET_EOS:
     {
         es_out_id_t *id;
-        foreach_es_then_es_slaves(id)
+        foreach_es_then_es_children(id)
             if (id->p_dec != NULL)
                 vlc_input_decoder_Drain(id->p_dec);
         return VLC_SUCCESS;
-- 
2.30.0



More information about the vlc-devel mailing list