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@videolan.org>
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
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;
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 );
/*****************************************************************************
* 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;
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) );
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 );
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;
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
{
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;
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;
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;
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;
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;
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;
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
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;
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;
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 );
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 )
{
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)
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)
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)
{
}
}
-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 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);
}
-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(); )
}
}
-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);
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 );
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;
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 ) )
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 );
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;
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));
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;
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)
{
"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;
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;
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_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;
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
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 ) );
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;
"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
{
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;
(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;
*****************************************************************************/
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
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 );
/*****************************************************************************
* 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
{
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 );
/*****************************************************************************
* 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;
/*****************************************************************************
* 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++ )
/*****************************************************************************
* 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;
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
{
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 )
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;
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 );
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 );
}
/*****************************************************************************
* 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
{
/*****************************************************************************
* 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;
/*****************************************************************************
* 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;
*****************************************************************************/
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 );
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;
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;
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;
};
/* */
-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;
/*****************************************************************************
*
*****************************************************************************/
-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;
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 );
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;
"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 * );
}
/** 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. */
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 );
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 )
*****************************************************************************/
/** 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;
}
-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;
/** 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;
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 );
"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
{
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;
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;
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 );
}
"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
{
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;
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;
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;
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 )
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;
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;
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 );
"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
{
char *prefix;
} sout_stream_sys_t;
-struct sout_stream_id_sys_t
+typedef struct
{
int id;
uint64_t segment_number;
const char *type;
mtime_t previous_dts,track_duration;
struct md5_s hash;
-};
+} sout_stream_id_sys_t;
/*****************************************************************************
* Open:
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;
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 );
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;
/*****************************************************************************
* 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:
}
}
-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;
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 )
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 )
/*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;
{
sout_instance_t *p_sout;
- sout_stream_id_sys_t *id;
+ void *id;
};
sout_instance_t *sout_NewInstance( vlc_object_t *, const char * );