[vlc-commits] [Git][videolan/vlc][master] 24 commits: adaptive: FakeESOut: switch to lambda initialization

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed May 1 06:50:38 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
dc58c823 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
adaptive: FakeESOut: switch to lambda initialization

Switching to a zero-initialized structure provides the same behaviour as
designated initializers in C code, ie. optional callbacks don't need to
be specified during initialization. This simplify a lot adding and
removing callbacks to the virtual tables since we don't need to modify
every files using the table at the same time as changing the table
itself.

- - - - -
ab6e2ec2 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
test: FakeESOut: switch to lambda initialization

Switching to a zero-initialized structure provides the same behaviour as
designated initializers in C code, ie. optional callbacks don't need to
be specified during initialization. This simplify a lot adding and
removing callbacks to the virtual tables since we don't need to modify
every files using the table at the same time as changing the table
itself.

- - - - -
797cf422 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
test: timestamps_filter: use designated initializers

Switching to a designated initializer structure means that optional
callbacks don't need to be specified during initialization. This
simplify a lot adding and removing callbacks to the virtual tables since
we don't need to modify every files using the table at the same time as
changing the table itself.

- - - - -
b90e31e7 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: add new vlc_input_es_out structure

The structure will replace the previous priv_control that was
implemented mostly by input-specific es_out, and will allow to implement
more controls through operations instead, when suited.

- - - - -
cf0b9634 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: inherit vlc_input_es_out

No functional changes for now, the ops are set to NULL. This will allow
to move the private control callback out of the es_out_t interface.

- - - - -
098a70a7 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: source: inherit vlc_input_es_out

No functional changes for now, the ops are set to NULL. This will allow
to move the private control callback out of the es_out_t interface.

- - - - -
29c65121 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: timeshift: inherit vlc_input_es_out

No functional changes for now, the ops are set to NULL. This will allow
to move the private control callback out of the es_out_t interface.

- - - - -
37271343 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out: return vlc_input_es_out

Now that every clients are inheriting vlc_input_es_out, we can output a
vlc_input_es_out object to the core input directly.

For now, the input still upcasts to es_out_t to avoid modifying the
whole file in this commit.

- - - - -
4033cbe4 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: handle both es_out_t and vlc_input_es_out

This commit provides temporary compatibility macros to be able to change
the type used for the first parameter in each of the clients of the
private control API.

They will be removed in later commits.

- - - - -
7b818ff4 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: store intermediate vlc_input_es_out

Now that the es_out is an instance of vlc_input_es_out, we want to use
the new interface as much as possible. The es_out private callbacks will
handle both types so the transition can be partial in this commit to
keep it minial aand mostly change the stored variables and the other calls.

- - - - -
b0d126b5 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: source: store vlc_input_es_out directly

Make input_source_t store a vlc_input_es_out directly instead of an
es_out_t. Indeed, an input_source_t is always linked to an es_out_t
which is able to execute private controls for the playback.

- - - - -
0902d6a6 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out_source: initialize with vlc_input_es_out

Now that every input es_out_t implementations are inheriting
vlc_input_es_out and every locations in the input are storing
vlc_input_es_out directly, we can forward the downclass to the
es_out_source vlc_input_es_out implementation so that it can forward the
private controls to the next vlc_input_es_out.

- - - - -
66a3078f by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out_source: directly store vlc_input_es_out

input_EsOutSourceNew() is now receiving a vlc_input_es_out instance to
initialize the next hop in the es_out_t chain, so we can use this
internally. This will allow calling the vlc_input_es_out private control
instead of the es_out_t one.

- - - - -
ad7bfa7d by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out_source: redirect to private operations when available

Setup compatibility path to redirect to vlc_input_es_out private control
instead of using the es_out_t private control when it's available.

- - - - -
37026079 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out_timeshift: redirect to private operations when available

Setup compatibility path to redirect to vlc_input_es_out private control
instead of using the es_out_t private control when it's available.

- - - - -
298dcb9d by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out: implement private controls via vlc_input_es_out

Thanks to the compability macros, we didn't need to modify the client
code, and now that every clients are using vlc_input_es_out, we can
downcast directly when needed.

- - - - -
a01acd50 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: timeshift: initialize with vlc_input_es_out

Now that every input es_out_t implementations are inheriting
vlc_input_es_out and every locations in the input are storing
vlc_input_es_out directly, we can forward the downclass to the
es_out_timeshift vlc_input_es_out implementation so that it can forward
the private controls to the next vlc_input_es_out.

- - - - -
3a5d4950 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: timeshift: switch to vlc_input_es_out client

input_EsOutTimeshiftNew() is now receiving a vlc_input_es_out instance
to initialize the next hop in the es_out_t chain, so we can use this
internally. This will allow calling the vlc_input_es_out private control
instead of the es_out_t one.

- - - - -
7deb75d0 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: remove compatibility macros

Now that every private es_out_t clients are using the struct vlc_input_es_out
type, we can remove those macros safely.

- - - - -
e01dd1f4 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out: timeshift: switch to vlc_input_es_out PrivControl

Every clients are now using either the vlc_input_es_out priv_control
callback or they fallback to the es_out_t implementation if not filled.
Moving the call to vlc_input_es_out will allow removing the private
control from the es_out_t callback interface.

- - - - -
7fb05a84 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
es_out.c: switch to vlc_input_es_out PrivControl

Every clients are now using either the vlc_input_es_out priv_control
callback or they fallback to the es_out_t implementation if not filled.
Moving the call to vlc_input_es_out will allow removing the private
control from the es_out_t callback interface.

- - - - -
580f2391 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out_source: move PrivControl

Every clients are now using either the vlc_input_es_out priv_control
callback or they fallback to the es_out_t implementation if not filled.
Moving the call to vlc_input_es_out will allow removing the private
control from the es_out_t callback interface.

- - - - -
115c9e7f by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
input: es_out: remove previous priv_control

Every clients have switched to using the private control callback from
the vlc_input_es_out interface.

- - - - -
132308a6 by Alexandre Janniaux at 2024-04-30T21:09:23+00:00
vlc_es_out: remove private control callback

The private control has been moved to struct vlc_input_es_out which is
an internal interface used by the input only, removing the need for the
modules using the vlc_es_out interface to know about this.

- - - - -


11 changed files:

- include/vlc_es_out.h
- modules/demux/adaptive/plumbing/FakeESOut.cpp
- modules/demux/adaptive/test/plumbing/FakeEsOut.cpp
- src/input/es_out.c
- src/input/es_out.h
- src/input/es_out_source.c
- src/input/es_out_timeshift.c
- src/input/input.c
- src/input/input_internal.h
- src/input/source.h
- test/modules/demux/timestamps_filter.c


Changes:

=====================================
include/vlc_es_out.h
=====================================
@@ -131,10 +131,6 @@ struct es_out_callbacks
     void         (*del)(es_out_t *, es_out_id_t *);
     int          (*control)(es_out_t *, input_source_t *in, int query, va_list);
     void         (*destroy)(es_out_t *);
-    /**
-     * Private control callback, must be NULL for es_out created from modules.
-     */
-    int          (*priv_control)(es_out_t *, input_source_t *in, int query, va_list);
 };
 
 struct es_out_t


=====================================
modules/demux/adaptive/plumbing/FakeESOut.cpp
=====================================
@@ -51,15 +51,16 @@ namespace adaptive
     };
 }
 
-const struct es_out_callbacks EsOutCallbacks::cbs =
-{
-    EsOutCallbacks::es_out_Add,
-    EsOutCallbacks::es_out_Send,
-    EsOutCallbacks::es_out_Del,
-    EsOutCallbacks::es_out_Control,
-    EsOutCallbacks::es_out_Destroy,
-    nullptr,
-};
+const struct es_out_callbacks EsOutCallbacks::cbs = []() constexpr
+{
+    struct es_out_callbacks cbs {};
+    cbs.add = EsOutCallbacks::es_out_Add;
+    cbs.send = EsOutCallbacks::es_out_Send;
+    cbs.del = EsOutCallbacks::es_out_Del;
+    cbs.control = EsOutCallbacks::es_out_Control;
+    cbs.destroy = EsOutCallbacks::es_out_Destroy;
+    return cbs;
+}();
 
 es_out_id_t * EsOutCallbacks::es_out_Add(es_out_t *fakees, input_source_t *, const es_format_t *p_fmt)
 {


=====================================
modules/demux/adaptive/test/plumbing/FakeEsOut.cpp
=====================================
@@ -185,15 +185,16 @@ void DummyEsOut::callback_destroy(es_out_t *)
 
 }
 
-const struct es_out_callbacks dummycbs =
+static const struct es_out_callbacks dummycbs = []() constexpr
 {
-    .add = DummyEsOut::callback_add,
-    .send = DummyEsOut::callback_send,
-    .del = DummyEsOut::callback_del,
-    .control = DummyEsOut::callback_control,
-    .destroy = DummyEsOut::callback_destroy,
-    .priv_control = nullptr,
-};
+    es_out_callbacks cbs = {};
+    cbs.add = DummyEsOut::callback_add;
+    cbs.send = DummyEsOut::callback_send;
+    cbs.del = DummyEsOut::callback_del;
+    cbs.control = DummyEsOut::callback_control;
+    cbs.destroy = DummyEsOut::callback_destroy;
+    return cbs;
+}();
 
 DummyEsOut::ES::ES(const es_format_t *src)
 {


=====================================
src/input/es_out.c
=====================================
@@ -116,7 +116,7 @@ struct es_out_id_t
     vlc_es_id_t id;
 
     /* weak reference, used by input_decoder_callbacks and vlc_clock_cbs */
-    es_out_t *out;
+    struct vlc_input_es_out *out;
 
     /* ES ID */
     es_out_pgrm_t *p_pgrm;
@@ -237,7 +237,7 @@ typedef struct
 
     unsigned    cc_decoder;
 
-    es_out_t out;
+    struct vlc_input_es_out out;
 } es_out_sys_t;
 
 static void         EsOutDelLocked(es_out_sys_t *, es_out_id_t *);
@@ -332,8 +332,8 @@ decoder_on_vout_started(vlc_input_decoder_t *decoder, vout_thread_t *vout,
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return;
@@ -354,8 +354,8 @@ decoder_on_vout_stopped(vlc_input_decoder_t *decoder, vout_thread_t *vout, void
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return;
@@ -376,8 +376,8 @@ decoder_on_thumbnail_ready(vlc_input_decoder_t *decoder, picture_t *pic, void *u
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return;
@@ -397,8 +397,8 @@ decoder_on_new_video_stats(vlc_input_decoder_t *decoder, unsigned decoded, unsig
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return;
@@ -424,8 +424,8 @@ decoder_on_new_audio_stats(vlc_input_decoder_t *decoder, unsigned decoded, unsig
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return;
@@ -450,8 +450,8 @@ decoder_get_attachments(vlc_input_decoder_t *decoder,
     (void) decoder;
 
     es_out_id_t *id = userdata;
-    es_out_t *out = id->out;
-    es_out_sys_t *p_sys = PRIV(out);
+    struct vlc_input_es_out *out = id->out;
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     if (!p_sys->p_input)
         return -1;
@@ -2226,7 +2226,7 @@ static void ClockUpdate(vlc_tick_t system_ts, vlc_tick_t ts, double rate,
                         void *data)
 {
     es_out_id_t *es = data;
-    es_out_sys_t *p_sys = PRIV(es->out);
+    es_out_sys_t *p_sys = PRIV(&es->out->out);
 
     input_SendEventOutputClock(p_sys->p_input, &es->id, es->master, system_ts,
                                ts, rate, frame_rate, frame_rate_base);
@@ -3976,10 +3976,12 @@ static int EsOutPrivControlLocked(es_out_sys_t *sys, input_source_t *source, int
     return ret;
 }
 
-static int EsOutPrivControl( es_out_t *out, input_source_t *source,
-                             int query, va_list args )
+static int EsOutPrivControl(struct vlc_input_es_out *out,
+                            input_source_t *source,
+                            int query,
+                            va_list args)
 {
-    es_out_sys_t *p_sys = PRIV(out);
+    es_out_sys_t *p_sys = PRIV(&out->out);
 
     vlc_mutex_lock( &p_sys->lock );
     int ret = EsOutVaPrivControlLocked(p_sys, source, query, args);
@@ -3995,20 +3997,24 @@ static const struct es_out_callbacks es_out_cbs =
     .del = EsOutDel,
     .control = EsOutControl,
     .destroy = EsOutDelete,
-    .priv_control = EsOutPrivControl,
 };
-
 /*****************************************************************************
  * input_EsOutNew:
  *****************************************************************************/
-es_out_t *input_EsOutNew( input_thread_t *p_input, input_source_t *main_source, float rate,
-                          enum input_type input_type )
+struct vlc_input_es_out *
+input_EsOutNew(input_thread_t *p_input, input_source_t *main_source, float rate,
+               enum input_type input_type)
 {
     es_out_sys_t *p_sys = calloc( 1, sizeof( *p_sys ) );
     if( !p_sys )
         return NULL;
 
-    p_sys->out.cbs = &es_out_cbs;
+    static const struct vlc_input_es_out_ops input_es_out_ops =
+    {
+        .priv_control = EsOutPrivControl,
+    };
+    p_sys->out.ops = &input_es_out_ops;
+    p_sys->out.out.cbs = &es_out_cbs;
 
     vlc_mutex_init( &p_sys->lock );
     p_sys->p_input = p_input;


=====================================
src/input/es_out.h
=====================================
@@ -104,13 +104,29 @@ enum es_out_query_private_e
     ES_OUT_PRIV_SET_VBI_TRANSPARENCY                /* arg1=bool res=can fail */
 };
 
-static inline int es_out_vaPrivControl( es_out_t *out, int query, va_list args )
+struct vlc_input_es_out;
+struct vlc_input_es_out_ops {
+    int (*priv_control)(
+        struct vlc_input_es_out *out,
+        input_source_t *source,
+        int query,
+        va_list args);
+};
+
+struct vlc_input_es_out {
+    es_out_t out;
+
+    const struct vlc_input_es_out_ops *ops;
+};
+
+static inline int
+es_out_vaPrivControl(struct vlc_input_es_out *out, int query, va_list args )
 {
-    vlc_assert( out->cbs->priv_control );
-    return out->cbs->priv_control( out, NULL, query, args );
+    return out->ops->priv_control(out, NULL, query, args);
 }
 
-static inline int es_out_PrivControl( es_out_t *out, int query, ... )
+static inline int
+es_out_PrivControl(struct vlc_input_es_out *out, int query, ...)
 {
     va_list args;
     va_start( args, query );
@@ -119,140 +135,207 @@ static inline int es_out_PrivControl( es_out_t *out, int query, ... )
     return result;
 }
 
-static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
+static inline void
+es_out_SetMode(struct vlc_input_es_out *out, int i_mode)
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_MODE, i_mode );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_MODE, i_mode);
     assert( !i_ret );
 }
-static inline int es_out_SetEs( es_out_t *p_out, vlc_es_id_t *id )
+
+static inline int
+es_out_SetEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES, id );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_ES, id);
 }
-static inline int es_out_UnsetEs( es_out_t *p_out, vlc_es_id_t *id )
+
+static inline int
+es_out_UnsetEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_UNSET_ES, id );
+    return es_out_PrivControl(out, ES_OUT_PRIV_UNSET_ES, id);
 }
-static inline int es_out_RestartEs( es_out_t *p_out, vlc_es_id_t *id )
+
+static inline int
+es_out_RestartEs(struct vlc_input_es_out *out, vlc_es_id_t *id)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_RESTART_ES, id );
+    return es_out_PrivControl(out, ES_OUT_PRIV_RESTART_ES, id);
 }
-static inline vlc_tick_t es_out_GetWakeup( es_out_t *p_out )
+
+static inline vlc_tick_t
+es_out_GetWakeup(struct vlc_input_es_out *out)
 {
     vlc_tick_t i_wu;
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_WAKE_UP, &i_wu );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_WAKE_UP, &i_wu);
 
     assert( !i_ret );
     return i_wu;
 }
-static inline int es_out_SetEsList( es_out_t *p_out,
-                                    enum es_format_category_e cat,
-                                    vlc_es_id_t **ids )
+
+static inline int
+es_out_SetEsList(struct vlc_input_es_out *out,
+                 enum es_format_category_e cat,
+                 vlc_es_id_t **ids)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_LIST, cat, ids );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_ES_LIST, cat, ids);
 }
-static inline void es_out_SetEsCatIds( es_out_t *p_out,
-                                       enum es_format_category_e cat,
-                                       const char *str_ids )
+
+static inline void
+es_out_SetEsCatIds(struct vlc_input_es_out *out,
+                   enum es_format_category_e cat,
+                   const char *str_ids)
 {
-    int ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_CAT_IDS,
-                                  cat, str_ids );
+    int ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_ES_CAT_IDS,
+                                 cat, str_ids);
     assert( ret == VLC_SUCCESS );
 }
-static inline int es_out_StopAllEs( es_out_t *p_out, vlc_es_id_t ***context )
+
+static inline int
+es_out_StopAllEs(struct vlc_input_es_out *out,
+                 vlc_es_id_t ***context)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_STOP_ALL_ES, context );
+    return es_out_PrivControl(out, ES_OUT_PRIV_STOP_ALL_ES, context);
 }
-static inline int es_out_StartAllEs( es_out_t *p_out, vlc_es_id_t **context )
+
+static inline int
+es_out_StartAllEs(struct vlc_input_es_out *out, vlc_es_id_t **context )
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_START_ALL_ES, context );
+    return es_out_PrivControl(out, ES_OUT_PRIV_START_ALL_ES, context);
 }
-static inline bool es_out_GetBuffering( es_out_t *p_out )
+
+static inline bool
+es_out_GetBuffering(struct vlc_input_es_out *out)
 {
     bool b;
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_BUFFERING, &b );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_BUFFERING, &b);
 
     assert( !i_ret );
     return b;
 }
-static inline bool es_out_GetEmpty( es_out_t *p_out )
+
+static inline bool
+es_out_GetEmpty(struct vlc_input_es_out *out)
 {
     bool b;
-    int i_ret = es_out_Control( p_out, ES_OUT_GET_EMPTY, &b );
+    int i_ret = es_out_Control(&out->out, ES_OUT_GET_EMPTY, &b);
 
     assert( !i_ret );
     return b;
 }
-static inline void es_out_SetEsDelay( es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay )
+
+static inline void
+es_out_SetEsDelay(struct vlc_input_es_out *out,
+                  vlc_es_id_t *es,
+                  vlc_tick_t i_delay)
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay);
     assert( !i_ret );
 }
-static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, vlc_tick_t i_delay )
+
+static inline void
+es_out_SetDelay(struct vlc_input_es_out *out,
+                int i_cat,
+                vlc_tick_t i_delay)
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_DELAY, i_cat, i_delay );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_DELAY, i_cat, i_delay);
     assert( !i_ret );
 }
-static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record, const char *dir_path )
+
+static inline int
+es_out_SetRecordState(struct vlc_input_es_out *out,
+                      bool b_record,
+                      const char *dir_path)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RECORD_STATE, b_record, dir_path );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_RECORD_STATE, b_record, dir_path);
 }
-static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
+
+static inline int
+es_out_SetPauseState(struct vlc_input_es_out *out,
+                     bool b_source_paused,
+                     bool b_paused,
+                     vlc_tick_t i_date)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_PAUSE_STATE, b_source_paused, b_paused, i_date);
 }
-static inline int es_out_SetRate( es_out_t *p_out, float source_rate, float rate )
+
+static inline int
+es_out_SetRate(struct vlc_input_es_out *out, float source_rate, float rate)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_RATE, source_rate, rate );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_RATE, source_rate, rate);
 }
-static inline int es_out_SetFrameNext( es_out_t *p_out )
+
+static inline int
+es_out_SetFrameNext(struct vlc_input_es_out *out )
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_FRAME_NEXT );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_FRAME_NEXT);
 }
-static inline void es_out_SetTimes( es_out_t *p_out, double f_position,
-                                    vlc_tick_t i_time, vlc_tick_t i_normal_time,
-                                    vlc_tick_t i_length )
+
+static inline void
+es_out_SetTimes(struct vlc_input_es_out *out, double f_position,
+                vlc_tick_t i_time, vlc_tick_t i_normal_time,
+                vlc_tick_t i_length )
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
-                                    i_normal_time, i_length );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_TIMES, f_position, i_time,
+                                   i_normal_time, i_length);
     assert( !i_ret );
 }
-static inline void es_out_SetJitter( es_out_t *p_out,
-                                     vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average )
+
+static inline void
+es_out_SetJitter(struct vlc_input_es_out *out,
+                 vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter,
+                 int i_cr_average)
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_JITTER,
-                                    i_pts_delay, i_pts_jitter, i_cr_average );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_JITTER,
+                                   i_pts_delay, i_pts_jitter, i_cr_average);
     assert( !i_ret );
 }
-static inline int es_out_GetGroupForced( es_out_t *p_out )
+
+static inline int
+es_out_GetGroupForced(struct vlc_input_es_out *out)
 {
     int i_group;
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_GET_GROUP_FORCED, &i_group );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_GET_GROUP_FORCED, &i_group);
     assert( !i_ret );
     return i_group;
 }
-static inline void es_out_Eos( es_out_t *p_out )
+
+static inline void
+es_out_Eos(struct vlc_input_es_out *out)
 {
-    int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_EOS );
+    int i_ret = es_out_PrivControl(out, ES_OUT_PRIV_SET_EOS);
     assert( !i_ret );
 }
-static inline int es_out_SetVbiPage( es_out_t *p_out, vlc_es_id_t *id,
-                                     unsigned page )
+
+static inline int
+es_out_SetVbiPage(struct vlc_input_es_out *out, vlc_es_id_t *id,
+                  unsigned page)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_VBI_PAGE, id, page );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_VBI_PAGE, id, page);
 }
-static inline int es_out_SetVbiTransparency( es_out_t *p_out, vlc_es_id_t *id,
-                                             bool enabled )
+
+static inline int
+es_out_SetVbiTransparency(struct vlc_input_es_out *out, vlc_es_id_t *id,
+                          bool enabled)
 {
-    return es_out_PrivControl( p_out, ES_OUT_PRIV_SET_VBI_TRANSPARENCY, id,
-                               enabled );
+    return es_out_PrivControl(out, ES_OUT_PRIV_SET_VBI_TRANSPARENCY, id,
+                              enabled);
 }
 
-es_out_t  *input_EsOutNew( input_thread_t *, input_source_t *main_source, float rate,
-                           enum input_type input_type );
-es_out_t  *input_EsOutTimeshiftNew( input_thread_t *, es_out_t *, float i_rate );
-es_out_t  *input_EsOutSourceNew(es_out_t *master_out, input_source_t *in);
+struct vlc_input_es_out *
+input_EsOutNew(input_thread_t *, input_source_t *main_source, float rate,
+               enum input_type input_type);
+
+struct vlc_input_es_out *
+input_EsOutTimeshiftNew(input_thread_t *, struct vlc_input_es_out *, float i_rate);
+
+struct vlc_input_es_out *
+input_EsOutSourceNew(struct vlc_input_es_out *master_out, input_source_t *in);
 
 es_out_id_t *vlc_es_id_get_out(vlc_es_id_t *id);
 const input_source_t *vlc_es_id_GetSource(vlc_es_id_t *id);
 
+static inline void
+vlc_input_es_out_Delete(struct vlc_input_es_out *out)
+{
+    es_out_Delete(&out->out);
+}
+
 #endif


=====================================
src/input/es_out_source.c
=====================================
@@ -38,15 +38,16 @@
 
 struct es_out_source
 {
-    es_out_t out;
+    struct vlc_input_es_out out;
     input_source_t *in;
-    es_out_t *parent_out;
+    struct vlc_input_es_out *parent_out;
 } ;
 
 static struct es_out_source *
 PRIV(es_out_t *out)
 {
-    struct es_out_source *source = container_of(out, struct es_out_source, out);
+    struct vlc_input_es_out *parent = container_of(out, struct vlc_input_es_out, out);
+    struct es_out_source *source = container_of(parent, struct es_out_source, out);
     return source;
 }
 
@@ -55,19 +56,19 @@ static es_out_id_t *EsOutSourceAdd(es_out_t *out, input_source_t *in,
 {
     assert(in == NULL);
     struct es_out_source *sys = PRIV(out);
-    return sys->parent_out->cbs->add(sys->parent_out, sys->in, fmt);
+    return sys->parent_out->out.cbs->add(&sys->parent_out->out, sys->in, fmt);
 }
 
 static int EsOutSourceSend(es_out_t *out, es_out_id_t *es, block_t *block)
 {
     struct es_out_source *sys = PRIV(out);
-    return es_out_Send(sys->parent_out, es, block);
+    return es_out_Send(&sys->parent_out->out, es, block);
 }
 
 static void EsOutSourceDel(es_out_t *out, es_out_id_t *es)
 {
     struct es_out_source *sys = PRIV(out);
-    es_out_Del(sys->parent_out, es);
+    es_out_Del(&sys->parent_out->out, es);
 }
 
 static int EsOutSourceControl(es_out_t *out, input_source_t *in, int query,
@@ -75,15 +76,15 @@ static int EsOutSourceControl(es_out_t *out, input_source_t *in, int query,
 {
     assert(in == NULL);
     struct es_out_source *sys = PRIV(out);
-    return sys->parent_out->cbs->control(sys->parent_out, sys->in, query, args);
+    return sys->parent_out->out.cbs->control(&sys->parent_out->out, sys->in, query, args);
 }
 
-static int EsOutSourcePrivControl(es_out_t *out, input_source_t *in, int query,
+static int EsOutSourcePrivControl(struct vlc_input_es_out *out, input_source_t *in, int query,
                                   va_list args)
 {
     assert(in == NULL);
-    struct es_out_source *sys = PRIV(out);
-    return sys->parent_out->cbs->priv_control(sys->parent_out, sys->in, query, args);
+    struct es_out_source *sys = PRIV(&out->out);
+    return sys->parent_out->ops->priv_control(sys->parent_out, sys->in, query, args);
 }
 
 static void EsOutSourceDestroy(es_out_t *out)
@@ -92,10 +93,18 @@ static void EsOutSourceDestroy(es_out_t *out)
     free(sys);
 }
 
-es_out_t *input_EsOutSourceNew(es_out_t *parent_out, input_source_t *in)
+struct vlc_input_es_out *
+input_EsOutSourceNew(struct vlc_input_es_out *parent_out, input_source_t *in)
 {
     assert(parent_out && in);
 
+    struct es_out_source *sys = malloc(sizeof(*sys));
+    if (!sys)
+        return NULL;
+
+    sys->in = in;
+    sys->parent_out = parent_out;
+
     static const struct es_out_callbacks es_out_cbs =
     {
         .add = EsOutSourceAdd,
@@ -103,15 +112,16 @@ es_out_t *input_EsOutSourceNew(es_out_t *parent_out, input_source_t *in)
         .del = EsOutSourceDel,
         .control = EsOutSourceControl,
         .destroy = EsOutSourceDestroy,
-        .priv_control = EsOutSourcePrivControl,
     };
+    sys->out.out.cbs = &es_out_cbs;
 
-    struct es_out_source *sys = malloc(sizeof(*sys));
-    if (!sys)
-        return NULL;
+    static const struct vlc_input_es_out_ops ops =
+    {
+        .priv_control = EsOutSourcePrivControl,
+    };
 
     sys->in = in;
-    sys->out.cbs = &es_out_cbs;
+    sys->out.ops = &ops;
     sys->parent_out = parent_out;
 
     return &sys->out;


=====================================
src/input/es_out_timeshift.c
=====================================
@@ -218,7 +218,7 @@ typedef struct
     struct es_out_timeshift *ts;
     input_thread_t *p_input;
     es_out_t       *p_tsout;
-    es_out_t       *p_out;
+    struct vlc_input_es_out *p_out;
     int64_t        i_tmp_size_max;
     const char     *psz_tmp_path;
 
@@ -256,7 +256,7 @@ struct es_out_id_t
 struct es_out_timeshift
 {
     input_thread_t *p_input;
-    es_out_t       *p_out;
+    struct vlc_input_es_out *p_out;
 
     /* Configuration */
     int64_t        i_tmp_size_max;    /* Maximal temporary file size in byte */
@@ -279,12 +279,12 @@ struct es_out_timeshift
     int            i_es;
     es_out_id_t    **pp_es;
 
-    es_out_t       out;
+    struct vlc_input_es_out out;
 };
 
 static void         Del    ( es_out_t *, es_out_id_t * );
 
-static int          TsStart( es_out_t * );
+static int          TsStart(struct es_out_timeshift *);
 static void         TsAutoStop( es_out_t * );
 
 static void         TsStop( ts_thread_t * );
@@ -359,7 +359,8 @@ static int GetTmpFile( char **filename, const char *dirname )
  *****************************************************************************/
 static struct es_out_timeshift * PRIV(es_out_t *out)
 {
-    struct es_out_timeshift *sys = container_of(out, struct es_out_timeshift, out);
+    struct vlc_input_es_out *parent = container_of(out, struct vlc_input_es_out, out);
+    struct es_out_timeshift *sys = container_of(parent, struct es_out_timeshift, out);
     return sys;
 }
 
@@ -448,14 +449,17 @@ static void Del( es_out_t *p_out, es_out_id_t *p_es )
     vlc_mutex_unlock( &p_sys->lock );
 }
 
-static inline int es_out_in_vaControl( es_out_t *p_out, input_source_t *in,
-                                       int i_query, va_list args)
+static inline int es_out_in_vaControl(struct vlc_input_es_out *p_out,
+                                      input_source_t *in,
+                                      int i_query,
+                                      va_list args)
 {
-    return p_out->cbs->control( p_out, in, i_query, args );
+    return p_out->out.cbs->control(&p_out->out, in, i_query, args);
 }
 
-static inline int es_out_in_Control( es_out_t *p_out, input_source_t *in,
-                                     int i_query, ... )
+static inline int es_out_in_Control(struct vlc_input_es_out *p_out,
+                                    input_source_t *in,
+                                    int i_query, ...)
 {
     va_list args;
     int     i_result;
@@ -466,14 +470,17 @@ static inline int es_out_in_Control( es_out_t *p_out, input_source_t *in,
     return i_result;
 }
 
-static inline int es_out_in_vaPrivControl( es_out_t *p_out, input_source_t *in,
-                                           int i_query, va_list args)
+static inline int es_out_in_vaPrivControl(struct vlc_input_es_out *out,
+                                          input_source_t *in,
+                                          int i_query,
+                                          va_list args)
 {
-    return p_out->cbs->priv_control( p_out, in, i_query, args );
+    return out->ops->priv_control(out, in, i_query, args);
 }
 
-static inline int es_out_in_PrivControl( es_out_t *p_out, input_source_t *in,
-                                         int i_query, ... )
+static inline int es_out_in_PrivControl(struct vlc_input_es_out *p_out,
+                                        input_source_t *in,
+                                        int i_query, ... )
 {
     va_list args;
     int     i_result;
@@ -555,7 +562,7 @@ ControlLockedSetPauseState(struct es_out_timeshift *p_sys,
         if( !input_CanPaceControl( p_sys->p_input ) )
         {
             if( !p_sys->b_delayed )
-                TsStart(&p_sys->out);
+                TsStart(p_sys);
             if( p_sys->b_delayed )
                 i_ret = TsChangePause( p_sys->p_ts, b_source_paused, b_paused, i_date );
         }
@@ -595,7 +602,7 @@ ControlLockedSetRate(struct es_out_timeshift *p_sys,
         if( !input_CanPaceControl( p_sys->p_input ) )
         {
             if( !p_sys->b_delayed )
-                TsStart(&p_sys->out);
+                TsStart(p_sys);
             if( p_sys->b_delayed )
                 i_ret = TsChangeRate( p_sys->p_ts, src_rate, rate );
         }
@@ -736,9 +743,12 @@ static int Control( es_out_t *p_tsout, input_source_t *in, int i_query, va_list
     return i_ret;
 }
 
-static int PrivControlLocked( es_out_t *p_tsout, input_source_t *in, int i_query, va_list args )
+static int PrivControlLocked(struct vlc_input_es_out *p_tsout,
+                             input_source_t *in,
+                             int i_query,
+                             va_list args )
 {
-    struct es_out_timeshift *p_sys = PRIV(p_tsout);
+    struct es_out_timeshift *p_sys = PRIV(&p_tsout->out);
 
     switch( i_query )
     {
@@ -806,16 +816,16 @@ static int PrivControlLocked( es_out_t *p_tsout, input_source_t *in, int i_query
     }
 }
 
-static int PrivControl( es_out_t *p_tsout, input_source_t *in, int i_query, va_list args )
+static int PrivControl(struct vlc_input_es_out *p_tsout, input_source_t *in, int i_query, va_list args )
 {
-    struct es_out_timeshift *p_sys = PRIV(p_tsout);
+    struct es_out_timeshift *p_sys = PRIV(&p_tsout->out);
     int i_ret;
 
     vlc_mutex_lock( &p_sys->lock );
 
-    TsAutoStop( p_tsout );
+    TsAutoStop(&p_tsout->out);
 
-    i_ret = PrivControlLocked( p_tsout, in, i_query, args );
+    i_ret = PrivControlLocked(p_tsout, in, i_query, args);
 
     vlc_mutex_unlock( &p_sys->lock );
 
@@ -829,19 +839,26 @@ static const struct es_out_callbacks es_out_timeshift_cbs =
     .del = Del,
     .control = Control,
     .destroy = Destroy,
-    .priv_control = PrivControl,
 };
 
 /*****************************************************************************
  * input_EsOutTimeshiftNew:
  *****************************************************************************/
-es_out_t *input_EsOutTimeshiftNew( input_thread_t *p_input, es_out_t *p_next_out, float rate )
+struct vlc_input_es_out *
+input_EsOutTimeshiftNew(input_thread_t *p_input,
+                        struct vlc_input_es_out *p_next_out,
+                        float rate)
 {
     struct es_out_timeshift *p_sys = malloc( sizeof(*p_sys) );
     if( !p_sys )
         return NULL;
 
-    p_sys->out.cbs = &es_out_timeshift_cbs;
+    static const struct vlc_input_es_out_ops timeshift_ops =
+    {
+        .priv_control = PrivControl,
+    };
+    p_sys->out.ops = &timeshift_ops;
+    p_sys->out.out.cbs = &es_out_timeshift_cbs;
 
     /* */
     p_sys->b_input_paused = false;
@@ -932,11 +949,12 @@ static void TsDestroy( ts_thread_t *p_ts )
 {
     free( p_ts );
 }
-static int TsStart( es_out_t *p_out )
+static int TsStart(struct es_out_timeshift *p_sys)
 {
-    struct es_out_timeshift *p_sys = PRIV(p_out);
     ts_thread_t *p_ts;
 
+    es_out_t *p_out = &p_sys->out.out;
+
     assert( !p_sys->b_delayed );
 
     p_sys->p_ts = p_ts = calloc(1, sizeof(*p_ts));
@@ -1507,7 +1525,7 @@ static int CmdInitAdd( ts_cmd_add_t *p_cmd, input_source_t *in,  es_out_id_t *p_
 }
 static void CmdExecuteAdd(struct es_out_timeshift *p_sys, ts_cmd_add_t *p_cmd)
 {
-    es_out_t *out = p_sys->p_out;
+    es_out_t *out = &p_sys->p_out->out;
     p_cmd->p_es->p_es = out->cbs->add(out, p_cmd->in, p_cmd->p_fmt);
     TAB_APPEND( p_sys->i_es, p_sys->pp_es, p_cmd->p_es );
 }
@@ -1529,6 +1547,7 @@ static void CmdInitSend( ts_cmd_send_t *p_cmd, es_out_id_t *p_es, block_t *p_blo
 
 static int CmdExecuteSend(struct es_out_timeshift *p_sys, ts_cmd_send_t *p_cmd)
 {
+    es_out_t *out = &p_sys->p_out->out;
     block_t *p_block = p_cmd->p_block;
 
     p_cmd->p_block = NULL;
@@ -1536,7 +1555,7 @@ static int CmdExecuteSend(struct es_out_timeshift *p_sys, ts_cmd_send_t *p_cmd)
     if( p_block )
     {
         if( p_cmd->p_es->p_es )
-            return es_out_Send( p_sys->p_out, p_cmd->p_es->p_es, p_block );
+            return es_out_Send(out, p_cmd->p_es->p_es, p_block);
         block_Release( p_block );
     }
     return VLC_EGENERIC;
@@ -1557,7 +1576,7 @@ static int CmdInitDel( ts_cmd_del_t *p_cmd, es_out_id_t *p_es )
 static void CmdExecuteDel(struct es_out_timeshift *p_sys, ts_cmd_del_t *p_cmd)
 {
     if( p_cmd->p_es->p_es )
-        es_out_Del( p_sys->p_out, p_cmd->p_es->p_es );
+        es_out_Del(&p_sys->p_out->out, p_cmd->p_es->p_es );
     TAB_REMOVE( p_sys->i_es, p_sys->pp_es, p_cmd->p_es );
     free( p_cmd->p_es );
 }


=====================================
src/input/input.c
=====================================
@@ -355,8 +355,8 @@ input_thread_t *input_Create( vlc_object_t *p_parent,
     else
         priv->stats = NULL;
 
-    priv->p_es_out_display = input_EsOutNew( p_input, priv->master, priv->rate,
-                                             priv->type );
+    priv->p_es_out_display = input_EsOutNew(p_input, priv->master, priv->rate,
+                                            priv->type);
     if( !priv->p_es_out_display )
     {
         Destroy( p_input );
@@ -380,7 +380,7 @@ static void Destroy(input_thread_t *input)
     if (priv->p_renderer != NULL)
         vlc_renderer_item_release(priv->p_renderer);
     if (priv->p_es_out_display != NULL)
-        es_out_Delete(priv->p_es_out_display);
+        vlc_input_es_out_Delete(priv->p_es_out_display);
 
     if (priv->p_resource != NULL)
         input_resource_Release(priv->p_resource);
@@ -574,8 +574,8 @@ static vlc_tick_t InputSourceGetLength( input_source_t *source, input_item_t *it
     return length;
 }
 
-static void InputSourceStatistics( input_source_t *source, input_item_t *item,
-                                   es_out_t *out )
+static void InputSourceStatistics(input_source_t *source, input_item_t *item,
+                                  struct vlc_input_es_out *out )
 {
     double f_position = 0.0;
     vlc_tick_t i_time;
@@ -1305,8 +1305,8 @@ static int Init( input_thread_t * p_input )
         goto error;
 
     /* Create es out */
-    priv->p_es_out = input_EsOutTimeshiftNew( p_input, priv->p_es_out_display, priv->rate );
-    if( priv->p_es_out == NULL )
+    priv->p_es_out = input_EsOutTimeshiftNew(p_input, priv->p_es_out_display, priv->rate);
+    if (priv->p_es_out == NULL)
         goto error;
 
     /* Handle all early controls */
@@ -1377,7 +1377,7 @@ static int Init( input_thread_t * p_input )
             for (size_t i = 0; i < priv->i_slave; i++)
                 InputSourceMeta( p_input, priv->slave[i], p_meta );
 
-            es_out_ControlSetMeta( priv->p_es_out, p_meta );
+            es_out_ControlSetMeta(&priv->p_es_out->out, p_meta);
             vlc_meta_Delete( p_meta );
         }
     }
@@ -1394,8 +1394,8 @@ error:
     input_ChangeState( p_input, ERROR_S, VLC_TICK_INVALID );
 
     if( input_priv(p_input)->p_es_out )
-        es_out_Delete( input_priv(p_input)->p_es_out );
-    es_out_SetMode( input_priv(p_input)->p_es_out_display, ES_OUT_MODE_END );
+        vlc_input_es_out_Delete(input_priv(p_input)->p_es_out);
+    es_out_SetMode(input_priv(p_input)->p_es_out_display, ES_OUT_MODE_END );
     if( input_priv(p_input)->p_resource )
     {
         if( input_priv(p_input)->p_sout )
@@ -1444,7 +1444,10 @@ static void End( input_thread_t * p_input )
 
     /* Unload all modules */
     if( priv->p_es_out )
-        es_out_Delete( priv->p_es_out );
+    {
+        vlc_input_es_out_Delete(priv->p_es_out);
+        priv->p_es_out = NULL;
+    }
     es_out_SetMode( priv->p_es_out_display, ES_OUT_MODE_END );
 
     if( priv->stats != NULL )
@@ -1933,7 +1936,7 @@ static bool Control( input_thread_t *p_input,
             }
 
             /* Reset the decoders states and clock sync (before calling the demuxer */
-            es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
+            es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
             if( demux_SetPosition( priv->master->p_demux, param.pos.f_val,
                                    !param.pos.b_fast_seek ) )
             {
@@ -1962,7 +1965,7 @@ static bool Control( input_thread_t *p_input,
             }
 
             /* Reset the decoders states and clock sync (before calling the demuxer */
-            es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
+            es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
 
             i_ret = demux_SetTime( priv->master->p_demux, param.time.i_val,
                                    !param.time.b_fast_seek );
@@ -2059,7 +2062,7 @@ static bool Control( input_thread_t *p_input,
                 !priv->master->b_can_pace_control && priv->master->b_can_rate_control )
             {
                 if( !priv->master->b_rescale_ts )
-                    es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
+                    es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
 
                 if( demux_Control( priv->master->p_demux, DEMUX_SET_RATE,
                                    &rate ) )
@@ -2089,8 +2092,8 @@ static bool Control( input_thread_t *p_input,
 
         case INPUT_CONTROL_SET_PROGRAM:
             /* No need to force update, es_out does it if needed */
-            es_out_Control( priv->p_es_out,
-                            ES_OUT_SET_GROUP, (int)param.val.i_int );
+            es_out_Control(&priv->p_es_out->out,
+                           ES_OUT_SET_GROUP, (int)param.val.i_int);
 
             if( priv->master->p_demux == NULL )
                 break; /* Possible when called early, the group will be set on
@@ -2192,9 +2195,9 @@ static bool Control( input_thread_t *p_input,
             if( i_title < 0 || i_title >= priv->master->i_title )
                 break;
 
-            es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
-            demux_Control( priv->master->p_demux,
-                           DEMUX_SET_TITLE, i_title );
+            es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
+            demux_Control(priv->master->p_demux,
+                          DEMUX_SET_TITLE, i_title);
             break;
         }
         case INPUT_CONTROL_SET_SEEKPOINT:
@@ -2234,7 +2237,7 @@ static bool Control( input_thread_t *p_input,
              || i_seekpoint >= priv->master->title[i_title]->i_seekpoint )
                 break;
 
-            es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
+            es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
             demux_Control( priv->master->p_demux,
                            DEMUX_SET_SEEKPOINT, i_seekpoint );
             input_SendEventSeekpoint( p_input, i_title, i_seekpoint );
@@ -2661,15 +2664,18 @@ static int InputSourceInit( input_source_t *in, input_thread_t *p_input,
     char *url;
     if( likely(asprintf( &url, "%s://%s", psz_access, psz_path ) >= 0) )
     {
-        es_out_t *es_out;
-        if (!master )
-            es_out = in->p_slave_es_out =
-                input_EsOutSourceNew( priv->p_es_out, in );
+        struct vlc_input_es_out *es_out;
+        if (!master)
+        {
+            in->p_slave_es_out
+                = es_out
+                = input_EsOutSourceNew(priv->p_es_out, in);
+        }
         else
             es_out = priv->p_es_out;
 
         if( es_out )
-            in->p_demux = InputDemuxNew( p_input, es_out, in, url,
+            in->p_demux = InputDemuxNew( p_input, &es_out->out, in, url,
                                          psz_demux, psz_newanchor ? psz_newanchor : psz_anchor );
         free( url );
     }
@@ -2688,7 +2694,7 @@ static int InputSourceInit( input_source_t *in, input_thread_t *p_input,
                                       " Check the log for details."), psz_mrl );
         if( in->p_slave_es_out )
         {
-            es_out_Delete( in->p_slave_es_out );
+            vlc_input_es_out_Delete(in->p_slave_es_out);
             in->p_slave_es_out = NULL;
         }
         return VLC_EGENERIC;
@@ -2714,7 +2720,7 @@ static int InputSourceInit( input_source_t *in, input_thread_t *p_input,
             msg_Err(p_input, "Failed to create demux filter");
             if( in->p_slave_es_out )
             {
-                es_out_Delete( in->p_slave_es_out );
+                vlc_input_es_out_Delete(in->p_slave_es_out);
                 in->p_slave_es_out = NULL;
             }
             return VLC_EGENERIC;
@@ -2800,7 +2806,7 @@ static void InputSourceDestroy( input_source_t *in )
     if( in->p_demux )
         demux_Delete( in->p_demux );
     if( in->p_slave_es_out )
-        es_out_Delete( in->p_slave_es_out );
+        vlc_input_es_out_Delete(in->p_slave_es_out);
 
     if( in->i_title > 0 )
     {
@@ -2888,7 +2894,7 @@ static void SlaveDemux( input_thread_t *p_input )
             if( in->b_slave_sub && in->b_can_rate_control )
             {
                 if( in->sub_rate != 0 ) /* Don't reset when it's the first time */
-                    es_out_Control( priv->p_es_out, ES_OUT_RESET_PCR );
+                    es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
                 float new_rate = priv->slave_subs_rate;
                 demux_Control( in->p_demux, DEMUX_SET_RATE, &new_rate );
             }
@@ -3071,7 +3077,7 @@ static void InputUpdateMeta( input_thread_t *p_input, demux_t *p_demux )
         vlc_mutex_unlock( &priv->p_item->lock );
     }
 
-    es_out_ControlSetMeta( input_priv(p_input)->p_es_out, p_meta );
+    es_out_ControlSetMeta(&input_priv(p_input)->p_es_out->out, p_meta);
     vlc_meta_Delete( p_meta );
 }
 


=====================================
src/input/input_internal.h
=====================================
@@ -454,8 +454,8 @@ typedef struct input_thread_private_t
     /* Output */
     bool            b_out_pace_control; /* XXX Move it ot es_sout ? */
     sout_stream_t   *p_sout;            /* Idem ? */
-    es_out_t        *p_es_out;
-    es_out_t        *p_es_out_display;
+    struct vlc_input_es_out *p_es_out;
+    struct vlc_input_es_out *p_es_out_display;
     vlc_viewpoint_t viewpoint;
     bool            viewpoint_changed;
     vlc_renderer_item_t *p_renderer;


=====================================
src/input/source.h
=====================================
@@ -28,6 +28,7 @@
 #include <vlc_atomic.h>
 
 typedef struct input_title_t input_title_t;
+struct vlc_input_es_out;
 
 /* input_source_t: gathers all information per input source */
 struct input_source_t
@@ -35,7 +36,7 @@ struct input_source_t
     vlc_atomic_rc_t rc;
 
     demux_t  *p_demux; /**< Demux object (most downstream) */
-    es_out_t *p_slave_es_out; /**< Slave es out */
+    struct vlc_input_es_out *p_slave_es_out; /**< Slave es out */
 
     char *str_id;
     int auto_id;


=====================================
test/modules/demux/timestamps_filter.c
=====================================
@@ -73,12 +73,11 @@ static void trash_es_out_Del(es_out_t *out, es_out_id_t *id)
 
 static const struct es_out_callbacks trash_es_out_cbs =
 {
-    trash_es_out_Add,
-    trash_es_out_Send,
-    trash_es_out_Del,
-    trash_es_out_Control,
-    trash_es_out_Delete,
-    NULL,
+    .add = trash_es_out_Add,
+    .send = trash_es_out_Send,
+    .del = trash_es_out_Del,
+    .control = trash_es_out_Control,
+    .destroy = trash_es_out_Delete,
 };
 
 #define TIMELINE_0 (CLOCK_FREQ)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b96588ccc935e5a6cd9c2c7fd07d1beec7825f7e...132308a6d356e24e56a0e1e07d2f33d6f5517246

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b96588ccc935e5a6cd9c2c7fd07d1beec7825f7e...132308a6d356e24e56a0e1e07d2f33d6f5517246
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