[vlc-commits] core: remove global sout_stream_id_sys_t typedef
Romain Vimont
git at videolan.org
Mon Apr 30 17:45:20 CEST 2018
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Fri Apr 27 22:05:02 2018 +0200| [173ee01c08f341945f1a8ae30150e139a5348ad2] | committer: 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 <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=173ee01c08f341945f1a8ae30150e139a5348ad2
---
include/vlc_sout.h | 23 +++++++---------
modules/stream_out/autodel.c | 17 ++++++------
modules/stream_out/bridge.c | 32 +++++++++++-----------
modules/stream_out/chromaprint.c | 15 ++++++-----
modules/stream_out/chromecast/cast.cpp | 35 +++++++++++++-----------
modules/stream_out/cycle.c | 10 ++++---
modules/stream_out/delay.c | 15 +++++------
modules/stream_out/description.c | 13 +++++----
modules/stream_out/display.c | 15 +++++------
modules/stream_out/dummy.c | 13 +++++----
modules/stream_out/duplicate.c | 20 +++++++-------
modules/stream_out/es.c | 19 ++++++-------
modules/stream_out/gather.c | 19 ++++++-------
modules/stream_out/mosaic_bridge.c | 15 +++++------
modules/stream_out/record.c | 16 +++++------
modules/stream_out/rtp.c | 33 +++++++++++------------
modules/stream_out/rtp.h | 1 +
modules/stream_out/setid.c | 17 ++++++------
modules/stream_out/smem.c | 46 ++++++++++++++------------------
modules/stream_out/standard.c | 11 ++++----
modules/stream_out/stats.c | 19 ++++++-------
modules/stream_out/transcode/transcode.c | 16 +++++------
modules/stream_out/transcode/transcode.h | 2 ++
src/stream_output/stream_output.h | 2 +-
24 files changed, 210 insertions(+), 214 deletions(-)
diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 9dd5b866b1..7e4a8d4a45 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -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 );
diff --git a/modules/stream_out/autodel.c b/modules/stream_out/autodel.c
index c172f8598f..f0f1facd8c 100644
--- a/modules/stream_out/autodel.c
+++ b/modules/stream_out/autodel.c
@@ -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;
diff --git a/modules/stream_out/bridge.c b/modules/stream_out/bridge.c
index 38eca85865..818fd52ed5 100644
--- a/modules/stream_out/bridge.c
+++ b/modules/stream_out/bridge.c
@@ -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;
diff --git a/modules/stream_out/chromaprint.c b/modules/stream_out/chromaprint.c
index d13972f750..e81b6b12c4 100644
--- a/modules/stream_out/chromaprint.c
+++ b/modules/stream_out/chromaprint.c
@@ -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 )
{
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index bf0d07a6ef..19d68ba893 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -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 );
diff --git a/modules/stream_out/cycle.c b/modules/stream_out/cycle.c
index 9bb428be65..b6fc5191d1 100644
--- a/modules/stream_out/cycle.c
+++ b/modules/stream_out/cycle.c
@@ -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)
{
diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index c90480a1ed..5ec217eb7a 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -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;
diff --git a/modules/stream_out/description.c b/modules/stream_out/description.c
index 618c0547d5..128f4ecce5 100644
--- a/modules/stream_out/description.c
+++ b/modules/stream_out/description.c
@@ -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;
diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index 72e44b883a..e057431d3f 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -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;
diff --git a/modules/stream_out/dummy.c b/modules/stream_out/dummy.c
index a4e105b978..24886f60d9 100644
--- a/modules/stream_out/dummy.c
+++ b/modules/stream_out/dummy.c
@@ -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 );
diff --git a/modules/stream_out/duplicate.c b/modules/stream_out/duplicate.c
index fc41bc7c0c..1463830142 100644
--- a/modules/stream_out/duplicate.c
+++ b/modules/stream_out/duplicate.c
@@ -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;
diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index c5929d821d..221ce47d05 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -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 );
}
diff --git a/modules/stream_out/gather.c b/modules/stream_out/gather.c
index d269ac50e8..ff078b637d 100644
--- a/modules/stream_out/gather.c
+++ b/modules/stream_out/gather.c
@@ -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 *, void * );
+static int Send( sout_stream_t *, void *, block_t * );
-struct sout_stream_id_sys_t
+typedef struct
{
bool b_used;
bool b_streamswap;
es_format_t fmt;
void *id;
-};
+} sout_stream_id_sys_t;
typedef struct
{
@@ -121,7 +121,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;
@@ -197,18 +197,19 @@ 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 )
{
VLC_UNUSED(p_stream);
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
id->b_used = false;
}
/*****************************************************************************
* 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_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if ( id->b_streamswap )
{
id->b_streamswap = false;
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 3227cfdbea..1d0c7a5944 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -73,9 +73,9 @@ struct decoder_owner_sys_t
*****************************************************************************/
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 * );
static int decoder_queue_video( decoder_t *p_dec, picture_t *p_pic );
inline static int video_update_format_decoder( decoder_t *p_dec );
@@ -270,7 +270,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;
bridge_t *p_bridge;
@@ -405,10 +405,10 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, const es_format_t *p
p_sys->p_vf2 = NULL;
}
- return (sout_stream_id_sys_t *)p_sys;
+ return p_sys;
}
-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(id);
sout_stream_sys_t *p_sys = p_stream->p_sys;
@@ -566,8 +566,7 @@ static int decoder_queue_video( decoder_t *p_dec, picture_t *p_pic )
return 0;
}
-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;
diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 5bccc9447a..007c8596b0 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -75,11 +75,11 @@ static const char *const ppsz_sout_options[] = {
};
/* */
-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
{
es_format_t fmt;
@@ -180,7 +180,7 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
*
*****************************************************************************/
-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;
@@ -201,9 +201,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 )
{
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->p_out )
OutputStart( p_stream );
@@ -228,8 +229,7 @@ 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 )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 71e59cecb6..a9603d9ef0 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -269,14 +269,13 @@ static const char *const ppsz_sout_options[] = {
"mp4a-latm", 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 sout_stream_id_sys_t *MuxAdd( sout_stream_t *, const es_format_t * );
-static void MuxDel ( sout_stream_t *, sout_stream_id_sys_t * );
-static int MuxSend( 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 * );
+
+static void *MuxAdd( sout_stream_t *, const es_format_t * );
+static void MuxDel( sout_stream_t *, void * );
+static int MuxSend( sout_stream_t *, void *, block_t * );
static sout_access_out_t *GrabberCreate( sout_stream_t *p_sout );
static void* ThreadSend( void * );
@@ -950,8 +949,7 @@ uint32_t rtp_compute_ts( unsigned i_clock_rate, int64_t i_pts )
}
/** Add an ES as a new RTP stream */
-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 )
{
/* NOTE: As a special case, if we use a non-RTP
* mux (TS/PS), then p_fmt is NULL. */
@@ -1216,9 +1214,10 @@ 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;
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
vlc_mutex_lock( &p_sys->lock_es );
TAB_REMOVE( p_sys->i_es, p_sys->es, id );
@@ -1261,9 +1260,9 @@ 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 )
{
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
assert( ((sout_stream_sys_t *)p_stream->p_sys)->p_mux == NULL );
while( p_buffer != NULL )
@@ -1674,8 +1673,7 @@ size_t rtp_mtu (const sout_stream_id_sys_t *id)
*****************************************************************************/
/** Add an ES to a non-RTP muxed stream */
-static sout_stream_id_sys_t *MuxAdd( sout_stream_t *p_stream,
- const es_format_t *p_fmt )
+static void *MuxAdd( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
sout_input_t *p_input;
sout_stream_sys_t *p_sys = p_stream->p_sys;
@@ -1693,8 +1691,7 @@ static sout_stream_id_sys_t *MuxAdd( sout_stream_t *p_stream,
}
-static int MuxSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *p_buffer )
+static int MuxSend( sout_stream_t *p_stream, void *id, block_t *p_buffer )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_mux_t *p_mux = p_sys->p_mux;
@@ -1705,7 +1702,7 @@ static int MuxSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
/** Remove an ES from a non-RTP muxed stream */
-static void MuxDel( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
+static void MuxDel( sout_stream_t *p_stream, void *id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_mux_t *p_mux = p_sys->p_mux;
diff --git a/modules/stream_out/rtp.h b/modules/stream_out/rtp.h
index 93adcd3c27..b366505aa3 100644
--- a/modules/stream_out/rtp.h
+++ b/modules/stream_out/rtp.h
@@ -24,6 +24,7 @@
typedef struct rtsp_stream_t rtsp_stream_t;
typedef struct rtsp_stream_id_t rtsp_stream_id_t;
+typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
const char *path );
diff --git a/modules/stream_out/setid.c b/modules/stream_out/setid.c
index 9266458900..208f7e5028 100644
--- a/modules/stream_out/setid.c
+++ b/modules/stream_out/setid.c
@@ -95,10 +95,10 @@ static const char *ppsz_sout_options_lang[] = {
"id", "lang", NULL
};
-static sout_stream_id_sys_t *AddId ( sout_stream_t *, const es_format_t * );
-static sout_stream_id_sys_t *AddLang( 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 *AddId ( sout_stream_t *, const es_format_t * );
+static void *AddLang( 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
{
@@ -187,7 +187,7 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
-static sout_stream_id_sys_t * AddId( sout_stream_t *p_stream, const es_format_t *p_fmt )
+static void *AddId( 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;
es_format_t fmt;
@@ -205,7 +205,7 @@ static sout_stream_id_sys_t * AddId( sout_stream_t *p_stream, const es_format_t
return sout_StreamIdAdd( p_stream->p_next, p_fmt );
}
-static sout_stream_id_sys_t * AddLang( sout_stream_t *p_stream, const es_format_t *p_fmt )
+static void *AddLang( 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;
es_format_t fmt;
@@ -224,13 +224,12 @@ static sout_stream_id_sys_t * AddLang( sout_stream_t *p_stream, const es_format_
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_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 )
{
return sout_StreamIdSend( p_stream->p_next, id, p_buffer );
}
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index 50d98c5ac9..f16bd649cf 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -125,25 +125,21 @@ static const char *const ppsz_sout_options[] = {
"video-postrender-callback", "audio-postrender-callback", "video-data", "audio-data", "time-sync", 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 * );
-static sout_stream_id_sys_t *AddVideo( sout_stream_t *p_stream,
- const es_format_t *p_fmt );
-static sout_stream_id_sys_t *AddAudio( sout_stream_t *p_stream,
- const es_format_t *p_fmt );
+static void *AddVideo( sout_stream_t *p_stream, const es_format_t *p_fmt );
+static void *AddAudio( sout_stream_t *p_stream, const es_format_t *p_fmt );
-static int SendVideo( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *p_buffer );
-static int SendAudio( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *p_buffer );
+static int SendVideo( sout_stream_t *p_stream, void *id, block_t *p_buffer );
+static int SendAudio( sout_stream_t *p_stream, void *id, block_t *p_buffer );
-struct sout_stream_id_sys_t
+typedef struct
{
es_format_t format;
void *p_data;
-};
+} sout_stream_id_sys_t;
typedef struct
{
@@ -255,8 +251,7 @@ static void Close( vlc_object_t * p_this )
free( p_stream->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_id_sys_t *id = NULL;
@@ -267,8 +262,7 @@ static sout_stream_id_sys_t *Add( sout_stream_t *p_stream,
return id;
}
-static sout_stream_id_sys_t *AddVideo( sout_stream_t *p_stream,
- const es_format_t *p_fmt )
+static void *AddVideo( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
char* psz_tmp;
sout_stream_id_sys_t *id;
@@ -317,8 +311,7 @@ static sout_stream_id_sys_t *AddVideo( sout_stream_t *p_stream,
return id;
}
-static sout_stream_id_sys_t *AddAudio( sout_stream_t *p_stream,
- const es_format_t *p_fmt )
+static void *AddAudio( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
char* psz_tmp;
sout_stream_id_sys_t* id;
@@ -343,16 +336,17 @@ static sout_stream_id_sys_t *AddAudio( sout_stream_t *p_stream,
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;
es_format_Clean( &id->format );
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 )
{
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if ( id->format.i_cat == VIDEO_ES )
return SendVideo( p_stream, id, p_buffer );
else if ( id->format.i_cat == AUDIO_ES )
@@ -360,10 +354,10 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
return VLC_SUCCESS;
}
-static int SendVideo( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *p_buffer )
+static int SendVideo( 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;
size_t i_size = p_buffer->i_buffer;
uint8_t* p_pixels = NULL;
@@ -387,10 +381,10 @@ static int SendVideo( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
return VLC_SUCCESS;
}
-static int SendAudio( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
- block_t *p_buffer )
+static int SendAudio( 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;
int i_size;
uint8_t* p_pcm_buffer = NULL;
int i_samples = 0;
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index d3104c42ee..2038339799 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -130,26 +130,25 @@ typedef struct
session_descriptor_t *p_session;
} sout_stream_sys_t;
-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;
- return (sout_stream_id_sys_t*)sout_MuxAddStream( p_sys->p_mux, p_fmt );
+ return sout_MuxAddStream( p_sys->p_mux, 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 = p_stream->p_sys;
sout_MuxDeleteStream( p_sys->p_mux, (sout_input_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;
return sout_MuxSendBuffer( p_sys->p_mux, (sout_input_t*)id, p_buffer );
}
-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 = p_stream->p_sys;
sout_MuxFlush( p_sys->p_mux, (sout_input_t*)id );
diff --git a/modules/stream_out/stats.c b/modules/stream_out/stats.c
index 20fda0650f..cbf0b963c1 100644
--- a/modules/stream_out/stats.c
+++ b/modules/stream_out/stats.c
@@ -67,9 +67,9 @@ static const char *ppsz_sout_options[] = {
"output", "prefix", 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
{
@@ -77,7 +77,7 @@ typedef struct
char *prefix;
} sout_stream_sys_t;
-struct sout_stream_id_sys_t
+typedef struct
{
int id;
uint64_t segment_number;
@@ -85,7 +85,7 @@ struct sout_stream_id_sys_t
const char *type;
mtime_t previous_dts,track_duration;
struct md5_s hash;
-};
+} sout_stream_id_sys_t;
/*****************************************************************************
* Open:
@@ -148,7 +148,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 *id;
@@ -187,9 +187,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 )
{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
EndMD5( &id->hash );
char *outputhash = psz_md5_hash( &id->hash );
@@ -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_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;
+ sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
struct md5_s hash;
block_t *p_block = p_buffer;
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 038aa5eae8..1eee324a9e 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -230,9 +230,9 @@ static const char *const ppsz_sout_options[] = {
/*****************************************************************************
* 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 * );
/*****************************************************************************
* Open:
@@ -484,8 +484,7 @@ static void DeleteSoutStreamID( sout_stream_id_sys_t *id )
}
}
-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;
@@ -554,8 +553,9 @@ 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_id_sys_t *id = (sout_stream_id_sys_t *)_id;
if( id->b_transcode )
{
switch( id->p_decoder->fmt_in.i_cat )
@@ -581,9 +581,9 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
DeleteSoutStreamID( 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_id_sys_t *id = (sout_stream_id_sys_t *)_id;
block_t *p_out = NULL;
if( id->b_error )
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 2f67bce7f2..e4a778d84c 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -14,6 +14,8 @@
/*100ms is around the limit where people are noticing lipsync issues*/
#define MASTER_SYNC_MAX_DRIFT 100000
+typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
+
typedef struct
{
sout_stream_id_sys_t *id_video;
diff --git a/src/stream_output/stream_output.h b/src/stream_output/stream_output.h
index c7ff95269d..d855be6930 100644
--- a/src/stream_output/stream_output.h
+++ b/src/stream_output/stream_output.h
@@ -37,7 +37,7 @@ struct sout_packetizer_input_t
{
sout_instance_t *p_sout;
- sout_stream_id_sys_t *id;
+ void *id;
};
sout_instance_t *sout_NewInstance( vlc_object_t *, const char * );
More information about the vlc-commits
mailing list