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
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
* Raw output byte streams
......@@ -206,12 +201,12 @@ struct sout_stream_t
sout_stream_t *p_next;
/* add, remove a stream */
sout_stream_id_sys_t *(*pf_add)( sout_stream_t *, const es_format_t * );
void (*pf_del)( sout_stream_t *, sout_stream_id_sys_t * );
void *(*pf_add)( sout_stream_t *, const es_format_t * );
void (*pf_del)( sout_stream_t *, void * );
/* 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 );
void (*pf_flush)( sout_stream_t *, sout_stream_id_sys_t * );
void (*pf_flush)( sout_stream_t *, void * );
void *p_sys;
bool pace_nocontrol;
......@@ -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,
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,
const es_format_t *fmt )
static inline void *sout_StreamIdAdd( sout_stream_t *s,
const es_format_t *fmt )
{
return s->pf_add( s, fmt );
}
static inline void sout_StreamIdDel( sout_stream_t *s,
sout_stream_id_sys_t *id )
void *id )
{
s->pf_del( s, id );
}
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 );
}
static inline void sout_StreamFlush( sout_stream_t *s,
sout_stream_id_sys_t *id )
void *id )
{
if (s->pf_flush)
s->pf_flush( s, id );
......
......@@ -54,10 +54,11 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send ( sout_stream_t *, sout_stream_id_sys_t *, block_t * );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
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
{
sout_stream_id_sys_t *id;
......@@ -111,8 +112,7 @@ static void Close( vlc_object_t * p_this )
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_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,
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_id_sys_t *p_es = (sout_stream_id_sys_t *)_p_es;
if( p_es->id != NULL )
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 )
free( p_es );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
{
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();
int i;
......
......@@ -140,13 +140,15 @@ static const char *const ppsz_sout_options_in[] = {
NULL
};
static sout_stream_id_sys_t *AddOut( sout_stream_t *, const es_format_t * );
static void DelOut ( sout_stream_t *, sout_stream_id_sys_t * );
static int SendOut( sout_stream_t *, sout_stream_id_sys_t *, block_t * );
static void *AddOut( sout_stream_t *, const es_format_t * );
static void DelOut( sout_stream_t *, void * );
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 DelIn ( sout_stream_t *, sout_stream_id_sys_t * );
static int SendIn( sout_stream_t *, sout_stream_id_sys_t *, block_t * );
static void *AddIn( sout_stream_t *, const es_format_t * );
static void DelIn( sout_stream_t *, void * );
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
{
......@@ -233,7 +235,7 @@ static void CloseOut( vlc_object_t * p_this )
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;
bridge_t *p_bridge;
......@@ -292,10 +294,10 @@ static sout_stream_id_sys_t * AddOut( sout_stream_t *p_stream, const es_format_t
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);
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 )
p_sys->b_inited = false;
}
static int SendOut( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int SendOut( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
bridged_es_t *p_es;
......@@ -451,7 +452,7 @@ struct sout_stream_id_sys_t
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;
......@@ -488,9 +489,10 @@ static sout_stream_id_sys_t * AddIn( sout_stream_t *p_stream, const es_format_t
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;
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_audio ) p_sys->id_audio = NULL;
......@@ -499,10 +501,10 @@ static void DelIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
free( id );
}
static int SendIn( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
{
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;
bool b_no_es = true;
int i;
......
......@@ -47,9 +47,9 @@
static int Open ( 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 Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
/*****************************************************************************
* Module descriptor
......@@ -65,6 +65,7 @@ vlc_module_begin ()
set_callbacks( Open, Close )
vlc_module_end ()
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
typedef struct
{
unsigned int i_duration;
......@@ -160,7 +161,7 @@ static void Close( vlc_object_t * p_this )
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_id_sys_t *id = NULL;
......@@ -200,7 +201,7 @@ error:
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;
Finish( p_stream );
......@@ -209,10 +210,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
free( id );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buf )
static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buf )
{
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 )
{
......
......@@ -82,6 +82,8 @@ private:
std::string m_mime;
};
typedef struct sout_stream_id_sys_t sout_stream_id_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)
......@@ -277,10 +279,10 @@ vlc_module_begin ()
set_callbacks(AccessOpen, AccessClose)
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_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 (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
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_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
p_sys->out_streams_added--;
if (id == p_sys->video_proxy_id)
p_sys->video_proxy_id = NULL;
return sout_StreamIdDel(p_stream->p_next, id);
}
static int ProxySend(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer)
static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
{
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
|| 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,
}
}
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);
}
......@@ -699,7 +702,7 @@ static void AccessClose(vlc_object_t *p_this)
/*****************************************************************************
* 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 );
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
}
static void DelInternal(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
bool reset_config)
static void DelInternal(sout_stream_t *p_stream, void *_id, bool reset_config)
{
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();
it != p_sys->streams.end(); )
......@@ -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_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock);
DelInternal(p_stream, id, true);
......@@ -877,7 +881,7 @@ bool sout_stream_sys_t::startSoutChain(sout_stream_t *p_stream,
it != out_streams.end(); )
{
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 )
{
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
fmt.video.i_frame_rate = 30;
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 );
const bool success = id != NULL;
......@@ -1401,10 +1405,10 @@ bool sout_stream_sys_t::isFlushing( sout_stream_t *p_stream )
return false;
}
static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer)
static int Send(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
{
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);
if( p_sys->isFlushing( p_stream ) )
......@@ -1427,9 +1431,10 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
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_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock);
sout_stream_id_sys_t *next_id = p_sys->GetSubId( p_stream, id, false );
......
......@@ -45,6 +45,7 @@ struct sout_cycle
char chain[1];
};
typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
struct sout_stream_id_sys_t
{
sout_stream_id_sys_t *prev;
......@@ -70,7 +71,7 @@ static mtime_t get_dts(const block_t *block)
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_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)
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_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if (id->prev != NULL)
id->prev->next = id->next;
......@@ -151,10 +153,10 @@ static void DelStream(sout_stream_t *stream)
sys->stream = NULL;
}
static int Send(sout_stream_t *stream, sout_stream_id_sys_t *id,
block_t *block)
static int Send(sout_stream_t *stream, void *_id, block_t *block)
{
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)
{
......
......@@ -72,13 +72,13 @@ static const char *ppsz_sout_options[] = {
"id", "delay", NULL
};
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send ( sout_stream_t *, sout_stream_id_sys_t *, block_t * );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
typedef struct
{
sout_stream_id_sys_t *id;
void *id;
int i_id;
mtime_t i_delay;
} sout_stream_sys_t;
......@@ -128,7 +128,7 @@ static void Close( vlc_object_t * p_this )
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;
......@@ -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 );
}
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;
......@@ -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 );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
......
......@@ -43,9 +43,9 @@
static int Open ( 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 Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
/*****************************************************************************
* Module descriptor
......@@ -104,7 +104,7 @@ static void Close( vlc_object_t *p_this )
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;
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_
return (void *)p_fmt_copy;
}
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
static void Del( sout_stream_t *p_stream, void *id )
{
msg_Dbg( p_stream, "Removing a stream" );
/* NOTE: id should be freed by the input manager, not here. */
(void) id;
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
VLC_UNUSED(id);
sout_stream_sys_t *p_sys = p_stream->p_sys;
......
......@@ -74,9 +74,9 @@ static const char *const ppsz_sout_options[] = {
"audio", "video", "delay", NULL
};
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
typedef struct
{
......@@ -136,7 +136,7 @@ static void Close( vlc_object_t * p_this )
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;
......@@ -154,17 +154,16 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p
(char*)&p_fmt->i_codec );
return NULL;
}
return (sout_stream_id_sys_t *)p_dec;
return p_dec;
}
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
static void Del( sout_stream_t *p_stream, void *id )
{
(void) p_stream;
input_DecoderDelete( (decoder_t *)id );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
......
......@@ -39,9 +39,9 @@
*****************************************************************************/
static int Open ( vlc_object_t * );
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t* );
/*****************************************************************************
* Module descriptor
......@@ -69,20 +69,19 @@ static int Open( vlc_object_t *p_this )
return VLC_SUCCESS;
}
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 )
{
VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt);
return malloc( 1 );
}
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
static void Del( sout_stream_t *p_stream, void *id )
{
VLC_UNUSED(p_stream);
free( id );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
(void)p_stream; (void)id;
block_ChainRelease( p_buffer );
......
......@@ -53,10 +53,9 @@ vlc_module_end ()
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *,
block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
typedef struct
{
......@@ -70,11 +69,11 @@ typedef struct
char **ppsz_select;
} sout_stream_sys_t;
struct sout_stream_id_sys_t
typedef struct
{
int i_nb_ids;
void **pp_ids;
};
} sout_stream_id_sys_t;
static bool ESSelected( const es_format_t *fmt, char *psz_select );
......@@ -181,7 +180,7 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Add:
*****************************************************************************/
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_id_sys_t *id;
......@@ -237,9 +236,10 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p
/*****************************************************************************
* Del:
*****************************************************************************/
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_id_sys_t *id = (sout_stream_id_sys_t *)_id;
int i_stream;
for( i_stream = 0; i_stream < p_sys->i_nb_streams; i_stream++ )
......@@ -258,10 +258,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
/*****************************************************************************
* Send:
*****************************************************************************/
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
sout_stream_t *p_dup_stream;
int i_stream;
......
......@@ -120,9 +120,9 @@ static const char *const ppsz_sout_options[] = {
NULL
};
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
typedef struct
{
......@@ -203,11 +203,11 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
struct sout_stream_id_sys_t
typedef struct
{
sout_input_t *p_input;
sout_mux_t *p_mux;
};
} sout_stream_id_sys_t;
static char * es_print_url( const char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count,
const char *psz_access, const char *psz_mux )
......@@ -257,7 +257,7 @@ out:
return stream.ptr;
}
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_id_sys_t *id;
......@@ -392,9 +392,10 @@ static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_
return 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 )
{
VLC_UNUSED(p_stream);
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
sout_access_out_t *p_access = id->p_mux->p_access;
sout_MuxDeleteStream( id->p_mux, id->p_input );
......@@ -406,10 +407,10 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
free( id );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
{
VLC_UNUSED(p_stream);
sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
return sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer );
}
......@@ -51,18 +51,18 @@ vlc_module_end ()
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static sout_stream_id_sys_t *Add ( sout_stream_t *, const es_format_t * );
static void Del ( sout_stream_t *, sout_stream_id_sys_t * );
static int Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
static void *Add( sout_stream_t *, const es_format_t * );
static void Del( sout_stream_t *,