Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (13)
Showing
with 118 additions and 55 deletions
......@@ -41,7 +41,7 @@ typedef struct input_resource_t input_resource_t;
/* */
struct vlc_clock_t;
VLC_API vlc_input_decoder_t *
vlc_input_decoder_Create( vlc_object_t *, const es_format_t *,
vlc_input_decoder_Create( vlc_object_t *, const es_format_t *, const char *es_id,
struct vlc_clock_t *, input_resource_t * ) VLC_USED;
/**
......
......@@ -232,7 +232,7 @@ struct sout_stream_operations {
*
* \note Mandatory callback.
*/
void *(*add)(sout_stream_t *, const es_format_t *);
void *(*add)(sout_stream_t *, const es_format_t *, const char *);
/**
* Implementation of ::sout_StreamIdDel().
*
......@@ -287,11 +287,19 @@ VLC_API sout_stream_t *sout_StreamChainNew(vlc_object_t *parent,
* The returned opaque identifier should be released by ::sout_StreamIdDel().
*
* \param fmt A non-NULL es-format descriptor.
* \param es_id A non-NULL unique string describing the ES. This string is
* guaranteed to be valid for the whole lifetime of the ES (at
* least until ::sout_StreamIdDel() is called).
* Note that if stream output filters creates or duplicate a new
* ES, they are responsible for the validity and uniqueness of the
* string ID they pass to the next stream.
*
* \return An opaque pointer identifying the ES.
* \retval NULL In case of error.
*/
VLC_API void *sout_StreamIdAdd(sout_stream_t *, const es_format_t *fmt) VLC_USED;
VLC_API void *sout_StreamIdAdd(sout_stream_t *,
const es_format_t *fmt,
const char *es_id) VLC_USED;
/**
* Delete an ES from the stream output.
......
......@@ -47,6 +47,7 @@ struct sout_stream_id_sys_t
{
sout_stream_id_sys_t *id;
es_format_t fmt;
const char *es_id;
vlc_tick_t i_last;
bool b_error;
struct vlc_list node;
......@@ -59,7 +60,7 @@ typedef struct
struct vlc_list ids;
} sout_stream_sys_t;
static void *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, const char *es_id )
{
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) );
......@@ -70,6 +71,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
p_es->id = NULL;
p_es->i_last = VLC_TICK_INVALID;
p_es->es_id = es_id;
p_es->b_error = false;
vlc_list_append(&p_es->node, &p_sys->ids);
return p_es;
......@@ -96,7 +98,7 @@ static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
: p_sys->last_pcr;
if ( !p_es->id && !p_es->b_error )
{
p_es->id = sout_StreamIdAdd( p_stream->p_next, &p_es->fmt );
p_es->id = sout_StreamIdAdd( p_stream->p_next, &p_es->fmt, p_es->es_id );
if ( p_es->id == NULL )
{
p_es->b_error = true;
......
......@@ -40,7 +40,7 @@
*****************************************************************************/
#define ID_TEXT N_("ID")
#define ID_LONGTEXT N_( \
"Integer identifier for this elementary stream. This will be used to " \
"String identifier for this elementary stream. This will be used to " \
"\"find\" this stream later." )
#define DEST_TEXT N_( "Destination bridge-in name" )
......@@ -97,7 +97,7 @@ vlc_module_begin ()
add_shortcut( "bridge-out" )
/* Only usable with VLM. No category so not in gui preferences
set_subcategory( SUBCAT_SOUT_STREAM )*/
add_integer( SOUT_CFG_PREFIX_OUT "id", 0, ID_TEXT, ID_LONGTEXT )
add_string( SOUT_CFG_PREFIX_OUT "id", NULL, ID_TEXT, ID_LONGTEXT )
add_string( SOUT_CFG_PREFIX_OUT "in-name", "default",
DEST_TEXT, DEST_LONGTEXT )
set_callbacks( OpenOut, CloseOut )
......@@ -145,6 +145,7 @@ typedef struct bridged_es_t
block_t *p_block;
block_t **pp_last;
bool b_empty;
char *es_id;
/* bridge in part */
sout_stream_id_sys_t *id;
......@@ -167,13 +168,13 @@ static vlc_mutex_t lock = VLC_STATIC_MUTEX;
typedef struct out_sout_stream_sys_t
{
bridged_es_t *p_es;
int i_id;
char *new_id;
bool b_inited;
char *psz_name;
} out_sout_stream_sys_t;
static void *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, const char *es_id )
{
vlc_object_t *vlc = VLC_OBJECT(vlc_object_instance(p_stream));
out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
......@@ -208,6 +209,15 @@ static void *AddOut( sout_stream_t *p_stream, const es_format_t *p_fmt )
break;
}
char *bridged_es_id;
if ( p_sys->new_id != NULL )
bridged_es_id = strdup( p_sys->new_id );
else if ( asprintf(&bridged_es_id, "%s/%s/%d", es_id, p_sys->psz_name, i) == -1 )
bridged_es_id = NULL;
if ( unlikely(bridged_es_id == NULL) )
return NULL;
if ( i == p_bridge->i_es_num )
{
p_bridge->pp_es = xrealloc( p_bridge->pp_es,
......@@ -219,7 +229,7 @@ static void *AddOut( sout_stream_t *p_stream, const es_format_t *p_fmt )
p_sys->p_es = p_es = p_bridge->pp_es[i];
p_es->fmt = *p_fmt;
p_es->fmt.i_id = p_sys->i_id;
p_es->es_id = bridged_es_id;
p_es->p_block = NULL;
p_es->pp_last = &p_es->p_block;
p_es->b_empty = false;
......@@ -253,6 +263,8 @@ static void DelOut( sout_stream_t *p_stream, void *id )
block_ChainRelease( p_es->p_block );
p_es->p_block = NULL;
free( p_es->es_id );
p_es->b_changed = true;
vlc_mutex_unlock( &lock );
......@@ -323,8 +335,7 @@ static int OpenOut( vlc_object_t *p_this )
return VLC_ENOMEM;
p_sys->b_inited = false;
var_Get( p_stream, SOUT_CFG_PREFIX_OUT "id", &val );
p_sys->i_id = val.i_int;
p_sys->new_id = var_GetNonEmptyString( p_stream, SOUT_CFG_PREFIX_OUT "id" );
var_Get( p_stream, SOUT_CFG_PREFIX_OUT "in-name", &val );
if( asprintf( &p_sys->psz_name, "bridge-struct-%s", val.psz_string )<0 )
......@@ -381,14 +392,14 @@ struct sout_stream_id_sys_t
enum es_format_category_e i_cat; /* es category. Used for placeholder option */
};
static void* 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, const char *es_id )
{
in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *id = malloc( sizeof( sout_stream_id_sys_t ) );
if( !id ) return NULL;
id->id = sout_StreamIdAdd( p_stream->p_next, p_fmt );
id->id = sout_StreamIdAdd( p_stream->p_next, p_fmt, es_id );
if( !id->id )
{
free( id );
......@@ -493,8 +504,10 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
p_bridge->pp_es[i]->fmt.i_id += p_sys->i_id_offset;
if( !p_sys->b_placeholder )
{
p_bridge->pp_es[i]->id = sout_StreamIdAdd(
p_stream->p_next, &p_bridge->pp_es[i]->fmt );
p_bridge->pp_es[i]->id =
sout_StreamIdAdd( p_stream->p_next,
&p_bridge->pp_es[i]->fmt,
p_bridge->pp_es[i]->es_id );
if ( p_bridge->pp_es[i]->id == NULL )
{
msg_Warn( p_stream, "couldn't create chain for id %d",
......
......@@ -46,7 +46,7 @@
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
......@@ -163,7 +163,8 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id = NULL;
......@@ -201,6 +202,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
error:
free( id );
return NULL;
(void)es_id;
}
static void Del( sout_stream_t *p_stream, void *id )
......
......@@ -165,6 +165,7 @@ private:
struct sout_stream_id_sys_t
{
es_format_t fmt;
const char *es_id;
sout_stream_id_sys_t *p_sub_id;
bool flushed;
};
......@@ -241,10 +242,10 @@ vlc_module_begin ()
set_callbacks(AccessOpen, AccessClose)
vlc_module_end ()
static void *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, const char* es_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 *>( 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, es_id) );
if (id)
{
if (p_fmt->i_cat == VIDEO_ES)
......@@ -657,7 +658,7 @@ static void AccessClose(vlc_object_t *p_this)
/*****************************************************************************
* Sout callbacks
*****************************************************************************/
static void *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, const char *es_id)
{
sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
vlc_mutex_locker locker(&p_sys->lock);
......@@ -672,6 +673,7 @@ static void *Add(sout_stream_t *p_stream, const es_format_t *p_fmt)
if (p_sys_id != NULL)
{
es_format_Copy( &p_sys_id->fmt, p_fmt );
p_sys_id->es_id = es_id;
p_sys_id->p_sub_id = NULL;
p_sys_id->flushed = false;
......@@ -849,7 +851,8 @@ 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 = reinterpret_cast<sout_stream_id_sys_t *>( 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, p_sys_id->es_id) );
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 );
......
......@@ -52,6 +52,7 @@ struct sout_stream_id_sys_t
{
struct vlc_list node;
es_format_t fmt;
const char *es_id;
void *id;
};
......@@ -71,7 +72,8 @@ static vlc_tick_t get_dts(const block_t *block)
return block->i_dts;
}
static void *Add(sout_stream_t *stream, const es_format_t *fmt)
static void *
Add(sout_stream_t *stream, const es_format_t *fmt, const char *es_id)
{
sout_stream_sys_t *sys = stream->p_sys;
sout_stream_id_sys_t *id = malloc(sizeof (*id));
......@@ -85,8 +87,9 @@ static void *Add(sout_stream_t *stream, const es_format_t *fmt)
return NULL;
}
id->es_id = es_id;
if (sys->stream != NULL)
id->id = sout_StreamIdAdd(sys->stream, &id->fmt);
id->id = sout_StreamIdAdd(sys->stream, &id->fmt, id->es_id);
vlc_list_append(&id->node, &sys->ids);
return id;
......@@ -118,8 +121,9 @@ static int AddStream(sout_stream_t *stream, char *chain)
if (sys->stream == NULL)
return -1;
// TODO(Alaric): store es_ids and pass them to the substream chain.
vlc_list_foreach (id, &sys->ids, node)
id->id = sout_StreamIdAdd(sys->stream, &id->fmt);
id->id = sout_StreamIdAdd(sys->stream, &id->fmt, id->es_id);
return 0;
}
......
......@@ -42,7 +42,8 @@ typedef struct
vlc_tick_t i_delay;
} sout_stream_sys_t;
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
......@@ -50,11 +51,11 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
msg_Dbg( p_stream, "delaying ID %d by %"PRId64,
p_sys->i_id, p_sys->i_delay );
p_sys->id = sout_StreamIdAdd( p_stream->p_next, p_fmt );
p_sys->id = sout_StreamIdAdd( p_stream->p_next, p_fmt, es_id );
return p_sys->id;
}
return sout_StreamIdAdd( p_stream->p_next, p_fmt );
return sout_StreamIdAdd( p_stream->p_next, p_fmt, es_id );
}
static void Del( sout_stream_t *p_stream, void *id )
......
......@@ -94,7 +94,7 @@ typedef struct
vlc_clock_t *clock;
} sout_stream_id_sys_t;
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
......@@ -116,7 +116,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
}
id->dec = vlc_input_decoder_Create(
VLC_OBJECT(p_stream), p_fmt, id->clock, p_sys->p_resource );
VLC_OBJECT(p_stream), p_fmt, es_id, id->clock, p_sys->p_resource );
if( id->dec == NULL )
{
msg_Err( p_stream, "cannot create decoder for fcc=`%4.4s'",
......
......@@ -52,6 +52,7 @@ namespace DLNA
struct sout_stream_id_sys_t
{
es_format_t fmt;
const char *es_id;
sout_stream_id_sys_t *p_sub_id;
};
......@@ -194,7 +195,7 @@ bool sout_stream_sys_t::startSoutChain(sout_stream_t *p_stream,
{
sout_stream_id_sys_t *p_sys_id = *it;
p_sys_id->p_sub_id = static_cast<sout_stream_id_sys_t *>(
sout_StreamIdAdd( p_out, &p_sys_id->fmt ) );
sout_StreamIdAdd( p_out, &p_sys_id->fmt, p_sys_id->es_id ) );
if ( p_sys_id->p_sub_id == nullptr )
{
msg_Err( p_stream, "can't handle %4.4s stream",
......@@ -766,7 +767,8 @@ int MediaRenderer::SetAVTransportURI(const char* uri, const protocol_info_t& pro
return VLC_SUCCESS;
}
static void *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, const char *es_id)
{
sout_stream_sys_t *p_sys = static_cast<sout_stream_sys_t *>( p_stream->p_sys );
......@@ -780,6 +782,7 @@ static void *Add(sout_stream_t *p_stream, const es_format_t *p_fmt)
if(p_sys_id != nullptr)
{
es_format_Copy(&p_sys_id->fmt, p_fmt);
p_sys_id->es_id = es_id;
p_sys_id->p_sub_id = nullptr;
p_sys->streams.push_back(p_sys_id);
p_sys->es_changed = true;
......
......@@ -33,9 +33,9 @@
#include <vlc_block.h>
#include <vlc_sout.h>
static void *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, const char *es_id )
{
VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt);
VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt); VLC_UNUSED(es_id);
return malloc( 1 );
}
......
......@@ -58,7 +58,7 @@ vlc_module_end ()
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
static void SetPCR( sout_stream_t *, vlc_tick_t );
......@@ -209,7 +209,8 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Add:
*****************************************************************************/
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id;
......@@ -233,7 +234,9 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
sout_stream_t *out = p_sys->pp_streams[i_stream];
id_new = (void*)sout_StreamIdAdd( out, p_fmt );
/* FIXME(Alaric): suffix the string id with the duplicated track
* count. */
id_new = (void*)sout_StreamIdAdd( out, p_fmt, es_id );
if( id_new )
{
msg_Dbg( p_stream, " - added for output %d", i_stream );
......
......@@ -110,7 +110,8 @@ out:
return stream.ptr;
}
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
......@@ -241,6 +242,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
p_sys->count_sync += id->synchronous;
return id;
(void)es_id;
}
static void Del( sout_stream_t *p_stream, void *_id )
......
......@@ -50,7 +50,7 @@ vlc_module_end ()
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
......@@ -61,6 +61,7 @@ typedef struct
es_format_t fmt;
void *id;
char *es_id;
struct vlc_list node;
} sout_stream_id_sys_t;
......@@ -112,7 +113,8 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Add:
*****************************************************************************/
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id;
......@@ -155,6 +157,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
sout_StreamIdDel( p_stream->p_next, id->id );
es_format_Clean( &id->fmt );
free( id->es_id );
free( id );
}
......@@ -162,12 +165,21 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
id = malloc( sizeof( sout_stream_id_sys_t ) );
if( id == NULL )
return NULL;
id->es_id = strdup( es_id );
if( unlikely(id->es_id == NULL) )
{
free( id );
return NULL;
}
es_format_Copy( &id->fmt, p_fmt );
id->b_streamswap = false;
id->b_used = true;
id->id = sout_StreamIdAdd( p_stream->p_next, &id->fmt );
id->id = sout_StreamIdAdd( p_stream->p_next, &id->fmt, id->es_id );
if( id->id == NULL )
{
free( id->es_id );
free( id );
return NULL;
}
......
......@@ -81,7 +81,7 @@ static inline struct decoder_owner *dec_get_owner( decoder_t *p_dec )
*****************************************************************************/
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
......@@ -329,7 +329,8 @@ static vlc_decoder_device * video_filter_hold_device(vlc_object_t *o, void *sys)
return MosaicHoldDecoderDevice(p_owner);
}
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
bridge_t *p_bridge;
......@@ -457,6 +458,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
msg_Dbg( p_stream, "mosaic bridge id=%s pos=%d", p_es->psz_id, i );
return p_sys;
(void)es_id;
}
static void Del( sout_stream_t *p_stream, void *id )
......
......@@ -75,7 +75,7 @@ static const char *const ppsz_sout_options[] = {
};
/* */
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
static void Del( sout_stream_t *, void * );
static int Send( sout_stream_t *, void *, block_t * );
......@@ -83,6 +83,7 @@ typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
struct sout_stream_id_sys_t
{
es_format_t fmt;
const char *es_id;
block_t *p_first;
block_t **pp_last;
......@@ -181,7 +182,8 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
*
*****************************************************************************/
static void *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, const char *es_id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id;
......@@ -190,7 +192,9 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
if( !id )
return NULL;
es_format_Copy( &id->fmt, p_fmt );
id->es_id = es_id;
id->p_first = NULL;
id->pp_last = &id->p_first;
id->id = NULL;
......@@ -218,7 +222,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
sout_StreamIdDel( p_sys->p_out, id->id );
es_format_Clean( &id->fmt );
TAB_REMOVE( p_sys->i_id, p_sys->id, id );
if( p_sys->i_id <= 0 )
......@@ -372,7 +376,7 @@ static int OutputNew( sout_stream_t *p_stream,
{
sout_stream_id_sys_t *id = p_sys->id[i];
id->id = sout_StreamIdAdd( p_sys->p_out, &id->fmt );
id->id = sout_StreamIdAdd( p_sys->p_out, &id->fmt, id->es_id );
if( id->id )
i_count++;
}
......
......@@ -120,7 +120,7 @@ GetVencOption( sout_stream_t *p_stream, std::vector<vlc_fourcc_t> codecs,
fmt.video.i_frame_rate = 30;
fmt.video.i_frame_rate_base = 1;
void *id = sout_StreamIdAdd( p_sout_test, &fmt );
void *id = sout_StreamIdAdd( p_sout_test, &fmt, "video/1" );
es_format_Clean( &fmt );
const bool success = id != NULL;
......
......@@ -249,11 +249,11 @@ static const char *const ppsz_sout_options[] = {
"mp4a-latm", NULL
};
static void *Add( sout_stream_t *, const es_format_t * );
static void *Add( sout_stream_t *, const es_format_t *, const char * );
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 *MuxAdd( sout_stream_t *, const es_format_t *, const char * );
static void MuxDel( sout_stream_t *, void * );
static int MuxSend( sout_stream_t *, void *, block_t * );
......@@ -582,7 +582,7 @@ static int Open( vlc_object_t *p_this )
if( p_sys->p_mux != NULL )
{
sout_stream_id_sys_t *id = Add( p_stream, NULL );
sout_stream_id_sys_t *id = Add( p_stream, NULL, NULL );
if( id == NULL )
{
Close( p_this );
......@@ -917,7 +917,7 @@ uint32_t rtp_compute_ts( unsigned i_clock_rate, vlc_tick_t i_pts )
}
/** Add an ES as a new RTP stream */
static void *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, const char * es_id )
{
/* NOTE: As a special case, if we use a non-RTP
* mux (TS/PS), then p_fmt is NULL. */
......@@ -1581,7 +1581,8 @@ size_t rtp_mtu (const sout_stream_id_sys_t *id)
*****************************************************************************/
/** Add an ES to a non-RTP muxed stream */
static void *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, const char *es_id )
{
sout_input_t *p_input;
sout_stream_sys_t *p_sys = p_stream->p_sys;
......@@ -1596,6 +1597,7 @@ static void *MuxAdd( sout_stream_t *p_stream, const es_format_t *p_fmt )
}
return (sout_stream_id_sys_t *)p_input;
(void)es_id;
}
......
......@@ -216,7 +216,9 @@ AbstractStream *SDIOutput::createStream(const StreamID &id,
return s;
}
void *SDIOutput::SoutCallback_Add(sout_stream_t *p_stream, const es_format_t *fmt)
void *SDIOutput::SoutCallback_Add(sout_stream_t *p_stream,
const es_format_t *fmt,
const char *)
{
SDIOutput *me = reinterpret_cast<SDIOutput *>(p_stream->p_sys);
return me->Add(fmt);
......
......@@ -81,7 +81,7 @@ namespace sdi_sout
} ancillary;
private:
static void *SoutCallback_Add(sout_stream_t *, const es_format_t *);
static void *SoutCallback_Add(sout_stream_t *, const es_format_t *, const char *);
static void SoutCallback_Del(sout_stream_t *, void *);
static int SoutCallback_Send(sout_stream_t *, void *, block_t*);
static int SoutCallback_Control(sout_stream_t *, int, va_list);
......