Commit 173ee01c authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf

core: remove global sout_stream_id_sys_t typedef

Remove the sout_stream_id_sys_t typedef in vlc_common.h (for ODR).

This implies to replace sout_stream_id_sys_t* by void* in the
sout_stream_t functions.

See #17078 and #18033
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 7c7ff180
...@@ -58,11 +58,6 @@ struct sout_instance_t ...@@ -58,11 +58,6 @@ struct sout_instance_t
sout_stream_t *p_stream; sout_stream_t *p_stream;
}; };
/****************************************************************************
* sout_stream_id_sys_t: opaque (private for all sout_stream_t)
****************************************************************************/
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
/** /**
* \defgroup sout_access Access output * \defgroup sout_access Access output
* Raw output byte streams * Raw output byte streams
...@@ -206,12 +201,12 @@ struct sout_stream_t ...@@ -206,12 +201,12 @@ struct sout_stream_t
sout_stream_t *p_next; sout_stream_t *p_next;
/* add, remove a stream */ /* add, remove a stream */
sout_stream_id_sys_t *(*pf_add)( sout_stream_t *, const es_format_t * ); void *(*pf_add)( sout_stream_t *, const es_format_t * );
void (*pf_del)( sout_stream_t *, sout_stream_id_sys_t * ); void (*pf_del)( sout_stream_t *, void * );
/* manage a packet */ /* manage a packet */
int (*pf_send)( sout_stream_t *, sout_stream_id_sys_t *, block_t* ); int (*pf_send)( sout_stream_t *, void *, block_t* );
int (*pf_control)( sout_stream_t *, int, va_list ); int (*pf_control)( sout_stream_t *, int, va_list );
void (*pf_flush)( sout_stream_t *, sout_stream_id_sys_t * ); void (*pf_flush)( sout_stream_t *, void * );
void *p_sys; void *p_sys;
bool pace_nocontrol; bool pace_nocontrol;
...@@ -221,26 +216,26 @@ VLC_API void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_las ...@@ -221,26 +216,26 @@ VLC_API void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_las
VLC_API sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout, VLC_API sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout,
const char *psz_chain, sout_stream_t *p_next, sout_stream_t **p_last) VLC_USED; const char *psz_chain, sout_stream_t *p_next, sout_stream_t **p_last) VLC_USED;
static inline sout_stream_id_sys_t *sout_StreamIdAdd( sout_stream_t *s, static inline void *sout_StreamIdAdd( sout_stream_t *s,
const es_format_t *fmt ) const es_format_t *fmt )
{ {
return s->pf_add( s, fmt ); return s->pf_add( s, fmt );
} }
static inline void sout_StreamIdDel( sout_stream_t *s, static inline void sout_StreamIdDel( sout_stream_t *s,
sout_stream_id_sys_t *id ) void *id )
{ {
s->pf_del( s, id ); s->pf_del( s, id );
} }
static inline int sout_StreamIdSend( sout_stream_t *s, static inline int sout_StreamIdSend( sout_stream_t *s,
sout_stream_id_sys_t *id, block_t *b ) void *id, block_t *b )
{ {
return s->pf_send( s, id, b ); return s->pf_send( s, id, b );
} }
static inline void sout_StreamFlush( sout_stream_t *s, static inline void sout_StreamFlush( sout_stream_t *s,
sout_stream_id_sys_t *id ) void *id )
{ {
if (s->pf_flush) if (s->pf_flush)
s->pf_flush( s, id ); s->pf_flush( s, id );
......
...@@ -54,10 +54,11 @@ vlc_module_end () ...@@ -54,10 +54,11 @@ vlc_module_end ()
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * ); static void *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * ); static void Del( sout_stream_t *, void * );
static int Send ( sout_stream_t *, sout_stream_id_sys_t *, block_t * ); static int Send( sout_stream_t *, void *, block_t * );
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
struct sout_stream_id_sys_t struct sout_stream_id_sys_t
{ {
sout_stream_id_sys_t *id; sout_stream_id_sys_t *id;
...@@ -111,8 +112,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -111,8 +112,7 @@ static void Close( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
const es_format_t *p_fmt )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *p_es = malloc( sizeof(sout_stream_id_sys_t) ); sout_stream_id_sys_t *p_es = malloc( sizeof(sout_stream_id_sys_t) );
...@@ -129,9 +129,10 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, ...@@ -129,9 +129,10 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream,
return p_es; return p_es;
} }
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es ) static void Del( sout_stream_t *p_stream, void *_p_es )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *p_es = (sout_stream_id_sys_t *)_p_es;
if( p_es->id != NULL ) if( p_es->id != NULL )
sout_StreamIdDel( p_stream->p_next, p_es->id ); sout_StreamIdDel( p_stream->p_next, p_es->id );
...@@ -141,10 +142,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es ) ...@@ -141,10 +142,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es )
free( p_es ); free( p_es );
} }
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es, static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
block_t *p_buffer )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *p_es = (sout_stream_id_sys_t *)_p_es;
mtime_t i_current = mdate(); mtime_t i_current = mdate();
int i; int i;
......
...@@ -140,13 +140,15 @@ static const char *const ppsz_sout_options_in[] = { ...@@ -140,13 +140,15 @@ static const char *const ppsz_sout_options_in[] = {
NULL NULL
}; };
static sout_stream_id_sys_t *AddOut( sout_stream_t *, const es_format_t * ); static void *AddOut( sout_stream_t *, const es_format_t * );
static void DelOut ( sout_stream_t *, sout_stream_id_sys_t * ); static void DelOut( sout_stream_t *, void * );
static int SendOut( sout_stream_t *, sout_stream_id_sys_t *, block_t * ); static int SendOut( sout_stream_t *, void *, block_t * );
static sout_stream_id_sys_t *AddIn( sout_stream_t *, const es_format_t * ); static void *AddIn( sout_stream_t *, const es_format_t * );
static void DelIn ( sout_stream_t *, sout_stream_id_sys_t * ); static void DelIn( sout_stream_t *, void * );
static int SendIn( sout_stream_t *, sout_stream_id_sys_t *, block_t * ); static int SendIn( sout_stream_t *, void *, block_t * );
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
typedef struct bridged_es_t typedef struct bridged_es_t
{ {
...@@ -233,7 +235,7 @@ static void CloseOut( vlc_object_t * p_this ) ...@@ -233,7 +235,7 @@ static void CloseOut( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static sout_stream_id_sys_t * AddOut( sout_stream_t *p_stream, const es_format_t *p_fmt ) static void *AddOut( sout_stream_t *p_stream, const es_format_t *p_fmt )
{ {
out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys; out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
bridge_t *p_bridge; bridge_t *p_bridge;
...@@ -292,10 +294,10 @@ static sout_stream_id_sys_t * AddOut( sout_stream_t *p_stream, const es_format_t ...@@ -292,10 +294,10 @@ static sout_stream_id_sys_t * AddOut( sout_stream_t *p_stream, const es_format_t
vlc_mutex_unlock( &lock ); vlc_mutex_unlock( &lock );
return (sout_stream_id_sys_t *)p_sys; return p_sys;
} }
static void DelOut( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) static void DelOut( sout_stream_t *p_stream, void *id )
{ {
VLC_UNUSED(id); VLC_UNUSED(id);
out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys; out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
...@@ -318,8 +320,7 @@ static void DelOut( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) ...@@ -318,8 +320,7 @@ static void DelOut( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
p_sys->b_inited = false; p_sys->b_inited = false;
} }
static int SendOut( sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int SendOut( sout_stream_t *p_stream, void *id, block_t *p_buffer )
block_t *p_buffer )
{ {
out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys; out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
bridged_es_t *p_es; bridged_es_t *p_es;
...@@ -451,7 +452,7 @@ struct sout_stream_id_sys_t ...@@ -451,7 +452,7 @@ struct sout_stream_id_sys_t
enum es_format_category_e i_cat; /* es category. Used for placeholder option */ enum es_format_category_e i_cat; /* es category. Used for placeholder option */
}; };
static sout_stream_id_sys_t * AddIn( sout_stream_t *p_stream, const es_format_t *p_fmt ) static void* AddIn( sout_stream_t *p_stream, const es_format_t *p_fmt )
{ {
in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys; in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys;
...@@ -488,9 +489,10 @@ static sout_stream_id_sys_t * AddIn( sout_stream_t *p_stream, const es_format_t ...@@ -488,9 +489,10 @@ static sout_stream_id_sys_t * AddIn( sout_stream_t *p_stream, const es_format_t
return id; return id;
} }
static void DelIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) static void DelIn( sout_stream_t *p_stream, void *_id )
{ {
in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys; in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if( id == p_sys->id_video ) p_sys->id_video = NULL; if( id == p_sys->id_video ) p_sys->id_video = NULL;
if( id == p_sys->id_audio ) p_sys->id_audio = NULL; if( id == p_sys->id_audio ) p_sys->id_audio = NULL;
...@@ -499,10 +501,10 @@ static void DelIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) ...@@ -499,10 +501,10 @@ static void DelIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
free( id ); free( id );
} }
static int SendIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
block_t *p_buffer )
{ {
in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys; in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
bridge_t *p_bridge; bridge_t *p_bridge;
bool b_no_es = true; bool b_no_es = true;
int i; int i;
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * ); static void *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * ); static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* ); static int Send( sout_stream_t *, void *, block_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -65,6 +65,7 @@ vlc_module_begin () ...@@ -65,6 +65,7 @@ vlc_module_begin ()
set_callbacks( Open, Close ) set_callbacks( Open, Close )
vlc_module_end () vlc_module_end ()
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
typedef struct typedef struct
{ {
unsigned int i_duration; unsigned int i_duration;
...@@ -160,7 +161,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -160,7 +161,7 @@ static void Close( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id = NULL; sout_stream_id_sys_t *id = NULL;
...@@ -200,7 +201,7 @@ error: ...@@ -200,7 +201,7 @@ error:
return NULL; return NULL;
} }
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) static void Del( sout_stream_t *p_stream, void *id )
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
Finish( p_stream ); Finish( p_stream );
...@@ -209,10 +210,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) ...@@ -209,10 +210,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
free( id ); free( id );
} }
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buf )
block_t *p_buf )
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if ( p_sys->id != id ) if ( p_sys->id != id )
{ {
......
...@@ -82,6 +82,8 @@ private: ...@@ -82,6 +82,8 @@ private:
std::string m_mime; std::string m_mime;
}; };
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
struct sout_stream_sys_t struct sout_stream_sys_t
{ {
sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port) sout_stream_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf, bool has_video, int port)
...@@ -277,10 +279,10 @@ vlc_module_begin () ...@@ -277,10 +279,10 @@ vlc_module_begin ()
set_callbacks(AccessOpen, AccessClose) set_callbacks(AccessOpen, AccessClose)
vlc_module_end () vlc_module_end ()
static sout_stream_id_sys_t *ProxyAdd(sout_stream_t *p_stream, const es_format_t *p_fmt) static void *ProxyAdd(sout_stream_t *p_stream, const es_format_t *p_fmt)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = sout_StreamIdAdd(p_stream->p_next, p_fmt); sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( sout_StreamIdAdd(p_stream->p_next, p_fmt) );
if (id) if (id)
{ {
if (p_fmt->i_cat == VIDEO_ES) if (p_fmt->i_cat == VIDEO_ES)
...@@ -290,19 +292,20 @@ static sout_stream_id_sys_t *ProxyAdd(sout_stream_t *p_stream, const es_format_t ...@@ -290,19 +292,20 @@ static sout_stream_id_sys_t *ProxyAdd(sout_stream_t *p_stream, const es_format_t
return id; return id;
} }
static void ProxyDel(sout_stream_t *p_stream, sout_stream_id_sys_t *id) static void ProxyDel(sout_stream_t *p_stream, void *_id)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
p_sys->out_streams_added--; p_sys->out_streams_added--;
if (id == p_sys->video_proxy_id) if (id == p_sys->video_proxy_id)
p_sys->video_proxy_id = NULL; p_sys->video_proxy_id = NULL;
return sout_StreamIdDel(p_stream->p_next, id); return sout_StreamIdDel(p_stream->p_next, id);
} }
static int ProxySend(sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
block_t *p_buffer)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
if (p_sys->cc_has_input if (p_sys->cc_has_input
|| p_sys->out_streams_added >= p_sys->out_streams.size() - p_sys->spu_streams_count) || p_sys->out_streams_added >= p_sys->out_streams.size() - p_sys->spu_streams_count)
{ {
...@@ -349,7 +352,7 @@ static int ProxySend(sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -349,7 +352,7 @@ static int ProxySend(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
} }
} }
static void ProxyFlush(sout_stream_t *p_stream, sout_stream_id_sys_t *id) static void ProxyFlush(sout_stream_t *p_stream, void *id)
{ {
sout_StreamFlush(p_stream->p_next, id); sout_StreamFlush(p_stream->p_next, id);
} }
...@@ -699,7 +702,7 @@ static void AccessClose(vlc_object_t *p_this) ...@@ -699,7 +702,7 @@ static void AccessClose(vlc_object_t *p_this)
/***************************************************************************** /*****************************************************************************
* Sout callbacks * Sout callbacks
*****************************************************************************/ *****************************************************************************/
static sout_stream_id_sys_t *Add(sout_stream_t *p_stream, const es_format_t *p_fmt) static void *Add(sout_stream_t *p_stream, const es_format_t *p_fmt)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
vlc_mutex_locker locker(&p_sys->lock); vlc_mutex_locker locker(&p_sys->lock);
...@@ -724,10 +727,10 @@ static sout_stream_id_sys_t *Add(sout_stream_t *p_stream, const es_format_t *p_f ...@@ -724,10 +727,10 @@ static sout_stream_id_sys_t *Add(sout_stream_t *p_stream, const es_format_t *p_f
} }
static void DelInternal(sout_stream_t *p_stream, sout_stream_id_sys_t *id, static void DelInternal(sout_stream_t *p_stream, void *_id, bool reset_config)
bool reset_config)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
for (std::vector<sout_stream_id_sys_t*>::iterator it = p_sys->streams.begin(); for (std::vector<sout_stream_id_sys_t*>::iterator it = p_sys->streams.begin();
it != p_sys->streams.end(); ) it != p_sys->streams.end(); )
...@@ -773,9 +776,10 @@ static void DelInternal(sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -773,9 +776,10 @@ static void DelInternal(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
} }
} }
static void Del(sout_stream_t *p_stream, sout_stream_id_sys_t *id) static void Del(sout_stream_t *p_stream, void *_id)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock); vlc_mutex_locker locker(&p_sys->lock);
DelInternal(p_stream, id, true); DelInternal(p_stream, id, true);
...@@ -877,7 +881,7 @@ bool sout_stream_sys_t::startSoutChain(sout_stream_t *p_stream, ...@@ -877,7 +881,7 @@ bool sout_stream_sys_t::startSoutChain(sout_stream_t *p_stream,
it != out_streams.end(); ) it != out_streams.end(); )
{ {
sout_stream_id_sys_t *p_sys_id = *it; sout_stream_id_sys_t *p_sys_id = *it;
p_sys_id->p_sub_id = sout_StreamIdAdd( p_out, &p_sys_id->fmt ); p_sys_id->p_sub_id = reinterpret_cast<sout_stream_id_sys_t *>( sout_StreamIdAdd( p_out, &p_sys_id->fmt ) );
if ( p_sys_id->p_sub_id == NULL ) if ( p_sys_id->p_sub_id == NULL )
{ {
msg_Err( p_stream, "can't handle %4.4s stream", (char *)&p_sys_id->fmt.i_codec ); msg_Err( p_stream, "can't handle %4.4s stream", (char *)&p_sys_id->fmt.i_codec );
...@@ -1097,7 +1101,7 @@ sout_stream_sys_t::GetVencOption( sout_stream_t *p_stream, vlc_fourcc_t *p_codec ...@@ -1097,7 +1101,7 @@ sout_stream_sys_t::GetVencOption( sout_stream_t *p_stream, vlc_fourcc_t *p_codec
fmt.video.i_frame_rate = 30; fmt.video.i_frame_rate = 30;
fmt.video.i_frame_rate_base = 1; fmt.video.i_frame_rate_base = 1;
sout_stream_id_sys_t *id = sout_StreamIdAdd( p_sout_test, &fmt ); void *id = sout_StreamIdAdd( p_sout_test, &fmt );
es_format_Clean( &fmt ); es_format_Clean( &fmt );
const bool success = id != NULL; const bool success = id != NULL;
...@@ -1401,10 +1405,10 @@ bool sout_stream_sys_t::isFlushing( sout_stream_t *p_stream ) ...@@ -1401,10 +1405,10 @@ bool sout_stream_sys_t::isFlushing( sout_stream_t *p_stream )
return false; return false;
} }
static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int Send(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
block_t *p_buffer)
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock); vlc_mutex_locker locker(&p_sys->lock);
if( p_sys->isFlushing( p_stream ) ) if( p_sys->isFlushing( p_stream ) )
...@@ -1427,9 +1431,10 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -1427,9 +1431,10 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
return ret; return ret;
} }
static void Flush( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) static void Flush( sout_stream_t *p_stream, void *_id )
{ {
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys ); sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock); vlc_mutex_locker locker(&p_sys->lock);
sout_stream_id_sys_t *next_id = p_sys->GetSubId( p_stream, id, false ); sout_stream_id_sys_t *next_id = p_sys->GetSubId( p_stream, id, false );
......
...@@ -45,6 +45,7 @@ struct sout_cycle ...@@ -45,6 +45,7 @@ struct sout_cycle
char chain[1]; char chain[1];
}; };
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
struct sout_stream_id_sys_t struct sout_stream_id_sys_t
{ {
sout_stream_id_sys_t *prev; sout_stream_id_sys_t *prev;
...@@ -70,7 +71,7 @@ static mtime_t get_dts(const block_t *block) ...@@ -70,7 +71,7 @@ static mtime_t get_dts(const block_t *block)
return block->i_dts; return block->i_dts;
} }
static sout_stream_id_sys_t *Add(sout_stream_t *stream, const es_format_t *fmt) static void *Add(sout_stream_t *stream, const es_format_t *fmt)
{ {
sout_stream_sys_t *sys = stream->p_sys; sout_stream_sys_t *sys = stream->p_sys;
sout_stream_id_sys_t *id = malloc(sizeof (*id)); sout_stream_id_sys_t *id = malloc(sizeof (*id));
...@@ -98,9 +99,10 @@ static sout_stream_id_sys_t *Add(sout_stream_t *stream, const es_format_t *fmt) ...@@ -98,9 +99,10 @@ static sout_stream_id_sys_t *Add(sout_stream_t *stream, const es_format_t *fmt)
return id; return id;
} }
static void Del(sout_stream_t *stream, sout_stream_id_sys_t *id) static void Del(sout_stream_t *stream, void *_id)
{ {
sout_stream_sys_t *sys = stream->p_sys; sout_stream_sys_t *sys = stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if (id->prev != NULL) if (id->prev != NULL)
id->prev->next = id->next; id->prev->next = id->next;
...@@ -151,10 +153,10 @@ static void DelStream(sout_stream_t *stream) ...@@ -151,10 +153,10 @@ static void DelStream(sout_stream_t *stream)
sys->stream = NULL; sys->stream = NULL;
} }
static int Send(sout_stream_t *stream, sout_stream_id_sys_t *id, static int Send(sout_stream_t *stream, void *_id, block_t *block)
block_t *block)
{ {
sout_stream_sys_t *sys = stream->p_sys; sout_stream_sys_t *sys = stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
for (block_t *next = block->p_next; block != NULL; block = next) for (block_t *next = block->p_next; block != NULL; block = next)
{ {
......
...@@ -72,13 +72,13 @@ static const char *ppsz_sout_options[] = { ...@@ -72,13 +72,13 @@ static const char *ppsz_sout_options[] = {
"id", "delay", NULL "id", "delay", NULL
}; };
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * ); static void *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * ); static void Del( sout_stream_t *, void * );
static int Send ( sout_stream_t *, sout_stream_id_sys_t *, block_t * ); static int Send( sout_stream_t *, void *, block_t * );
typedef struct typedef struct
{ {
sout_stream_id_sys_t *id; void *id;
int i_id; int i_id;
mtime_t i_delay; mtime_t i_delay;
} sout_stream_sys_t; } sout_stream_sys_t;
...@@ -128,7 +128,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -128,7 +128,7 @@ static void Close( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
...@@ -143,7 +143,7 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p ...@@ -143,7 +143,7 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p
return sout_StreamIdAdd( p_stream->p_next, p_fmt ); return sout_StreamIdAdd( p_stream->p_next, p_fmt );
} }
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) static void Del( sout_stream_t *p_stream, void *id )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
...@@ -153,8 +153,7 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) ...@@ -153,8 +153,7 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
sout_StreamIdDel( p_stream->p_next, id ); sout_StreamIdDel( p_stream->p_next, id );
} }
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
block_t *p_buffer )
{ {
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static sout_stream_id_sys_t *Add ( sout_stream_t *, const es_format_t * ); static void *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * ); static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* ); static int Send( sout_stream_t *, void *, block_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -104,7 +104,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -104,7 +104,7 @@ static void Close( vlc_object_t *p_this )
free( p_sys ); free( p_sys );
} }
static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
es_format_t *p_fmt_copy = malloc( sizeof( *p_fmt_copy ) ); es_format_t *p_fmt_copy = malloc( sizeof( *p_fmt_copy ) );
...@@ -123,15 +123,14 @@ static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_ ...@@ -123,15 +123,14 @@ static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_
return (void *)p_fmt_copy; return (void *)p_fmt_copy;
}