[vlc-commits] sout: distinguish filter and output capabilities
Rémi Denis-Courmont
git at videolan.org
Wed Mar 4 21:19:38 CET 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar 3 23:33:39 2020 +0200| [7fc6e51819e060255990b2f5307f5d46efcd6e4c] | committer: Rémi Denis-Courmont
sout: distinguish filter and output capabilities
This removes the "sout stream" capability, and adds two new ones instead:
- "sout output" for final nodes in the sout chain, and
- "sout filter" for non-final nodes in the sout chain.
This is mainly to prevent impossible / non-working chain constructs.
Note: In practice, only "cycle" and "stats" plugins supported both modes
in any meaningful mannter. They are split into two submodules each.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7fc6e51819e060255990b2f5307f5d46efcd6e4c
---
modules/services_discovery/upnp.cpp | 2 +-
modules/stream_out/autodel.c | 2 +-
modules/stream_out/bridge.c | 4 ++--
modules/stream_out/chromaprint.c | 2 +-
modules/stream_out/chromecast/cast.cpp | 4 ++--
modules/stream_out/cycle.c | 6 +++++-
modules/stream_out/delay.c | 2 +-
modules/stream_out/display.c | 2 +-
modules/stream_out/dummy.c | 2 +-
modules/stream_out/duplicate.c | 2 +-
modules/stream_out/es.c | 2 +-
modules/stream_out/gather.c | 2 +-
modules/stream_out/mosaic_bridge.c | 2 +-
modules/stream_out/record.c | 2 +-
modules/stream_out/rtp.c | 2 +-
modules/stream_out/sdi/sdiout.cpp | 2 +-
modules/stream_out/setid.c | 4 ++--
modules/stream_out/smem.c | 2 +-
modules/stream_out/standard.c | 2 +-
modules/stream_out/stats.c | 4 ++--
modules/stream_out/transcode/transcode.c | 2 +-
src/stream_output/stream_output.c | 4 ++--
22 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 4f0a8d24c2..357d03be6d 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -167,7 +167,7 @@ vlc_module_begin()
add_submodule()
set_shortname("dlna")
set_description(N_("UPnP/DLNA stream output"))
- set_capability("sout stream", 0)
+ set_capability("sout output", 0)
add_shortcut("dlna")
set_category(CAT_SOUT)
set_subcategory(SUBCAT_SOUT_STREAM)
diff --git a/modules/stream_out/autodel.c b/modules/stream_out/autodel.c
index cb3cbccc39..02ae06b1a2 100644
--- a/modules/stream_out/autodel.c
+++ b/modules/stream_out/autodel.c
@@ -44,7 +44,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("Autodel"))
set_description( N_("Automatically add/delete input streams"))
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "autodel" )
set_callbacks( Open, Close )
vlc_module_end ()
diff --git a/modules/stream_out/bridge.c b/modules/stream_out/bridge.c
index 003c036f5d..7e9c741b18 100644
--- a/modules/stream_out/bridge.c
+++ b/modules/stream_out/bridge.c
@@ -92,7 +92,7 @@ vlc_module_begin ()
set_description( N_("Bridge stream output"))
add_submodule ()
set_section( N_("Bridge out"), NULL )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "bridge-out" )
/* Only usable with VLM. No category so not in gui preferences
set_category( CAT_SOUT )
@@ -105,7 +105,7 @@ vlc_module_begin ()
add_submodule ()
set_section( N_("Bridge in"), NULL )
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "bridge-in" )
/*set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )*/
diff --git a/modules/stream_out/chromaprint.c b/modules/stream_out/chromaprint.c
index 8d580e8d06..8ae33881f9 100644
--- a/modules/stream_out/chromaprint.c
+++ b/modules/stream_out/chromaprint.c
@@ -58,7 +58,7 @@ static int Send( sout_stream_t *, void *, block_t * );
vlc_module_begin ()
set_description( N_("Chromaprint stream output") )
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "chromaprint" )
add_integer( "duration", 90, DURATION_TEXT, DURATION_LONGTEXT, true )
set_callbacks( Open, Close )
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 97b6368295..ed83a333f2 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -212,7 +212,7 @@ vlc_module_begin ()
set_shortname(N_("Chromecast"))
set_description(N_("Chromecast stream output"))
- set_capability("sout stream", 0)
+ set_capability("sout output", 0)
add_shortcut("chromecast")
set_category(CAT_SOUT)
set_subcategory(SUBCAT_SOUT_STREAM)
@@ -232,7 +232,7 @@ vlc_module_begin ()
add_submodule()
/* sout proxy that start the cc input when all streams are loaded */
add_shortcut("chromecast-proxy")
- set_capability("sout stream", 0)
+ set_capability("sout filter", 0)
set_callback(ProxyOpen)
add_submodule()
set_subcategory(SUBCAT_SOUT_ACO)
diff --git a/modules/stream_out/cycle.c b/modules/stream_out/cycle.c
index 0c7481339e..673f126dbd 100644
--- a/modules/stream_out/cycle.c
+++ b/modules/stream_out/cycle.c
@@ -326,9 +326,13 @@ static void Close(vlc_object_t *obj)
vlc_module_begin()
set_shortname(N_("cycle"))
set_description(N_("Cyclic stream output"))
- set_capability("sout stream", 0)
+ set_capability("sout output", 0)
set_category(CAT_SOUT)
set_subcategory(SUBCAT_SOUT_STREAM)
set_callbacks(Open, Close)
add_shortcut("cycle")
+ add_submodule()
+ add_shortcut("cycle")
+ set_capability("sout filter", 0)
+ set_callbacks(Open, Close)
vlc_module_end()
diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index ff04a2ed73..2c23d87034 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -52,7 +52,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin()
set_shortname( N_("Delay"))
set_description( N_("Delay a stream"))
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "delay" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index 32562329b7..2f84ce408b 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -52,7 +52,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("Display"))
set_description( N_("Display stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "display" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/dummy.c b/modules/stream_out/dummy.c
index cb37798cee..07686fd1c8 100644
--- a/modules/stream_out/dummy.c
+++ b/modules/stream_out/dummy.c
@@ -47,7 +47,7 @@ static int Send( sout_stream_t *, void *, block_t* );
*****************************************************************************/
vlc_module_begin ()
set_description( N_("Dummy stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "dummy", "drop" )
set_callback( Open )
vlc_module_end ()
diff --git a/modules/stream_out/duplicate.c b/modules/stream_out/duplicate.c
index 916b264b92..516a852d18 100644
--- a/modules/stream_out/duplicate.c
+++ b/modules/stream_out/duplicate.c
@@ -41,7 +41,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_description( N_("Duplicate stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "duplicate", "dup" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index 03d1f671e1..f21e6be55c 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -76,7 +76,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_shortname( "ES" )
set_description( N_("Elementary stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "es" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/gather.c b/modules/stream_out/gather.c
index 4fc4fc16f6..bcbff9803d 100644
--- a/modules/stream_out/gather.c
+++ b/modules/stream_out/gather.c
@@ -41,7 +41,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_description( N_("Gathering stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "gather" )
set_callbacks( Open, Close )
vlc_module_end ()
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 63846634e3..518ea73b30 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -140,7 +140,7 @@ static int yCallback( vlc_object_t *, char const *,
vlc_module_begin ()
set_shortname( N_( "Mosaic bridge" ) )
set_description(N_("Mosaic bridge stream output") )
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "mosaic-bridge" )
add_string( CFG_PREFIX "id", "Id", ID_TEXT, ID_LONGTEXT,
diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 50348224fc..ce2ce958e7 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -54,7 +54,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_description( N_("Record stream output") )
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "record" )
set_shortname( N_("Record") )
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index c471b46266..f4a089e79a 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -186,7 +186,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("RTP"))
set_description( N_("RTP stream output") )
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "rtp" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/sdi/sdiout.cpp b/modules/stream_out/sdi/sdiout.cpp
index ef47f10538..56797a1fdb 100644
--- a/modules/stream_out/sdi/sdiout.cpp
+++ b/modules/stream_out/sdi/sdiout.cpp
@@ -177,7 +177,7 @@ vlc_module_begin ()
set_shortname(N_("SDI output"))
set_description(N_("SDI stream output"))
- set_capability("sout stream", 0)
+ set_capability("sout output", 0)
add_shortcut("sdiout")
set_category(CAT_SOUT)
set_subcategory(SUBCAT_SOUT_STREAM)
diff --git a/modules/stream_out/setid.c b/modules/stream_out/setid.c
index 208f7e5028..7ae348f27f 100644
--- a/modules/stream_out/setid.c
+++ b/modules/stream_out/setid.c
@@ -61,7 +61,7 @@ vlc_module_begin()
set_shortname( N_("Set ID"))
set_section( N_("Set ES id"), NULL )
set_description( N_("Change the id of an elementary stream"))
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "setid" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
@@ -74,7 +74,7 @@ vlc_module_begin()
set_section( N_("Set ES Lang"), NULL )
set_shortname( N_("Set Lang"))
set_description( N_("Change the language of an elementary stream"))
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "setlang" );
set_callbacks( OpenLang, Close )
add_integer( SOUT_CFG_PREFIX_LANG "id", 0, ID_TEXT, ID_LONGTEXT, false )
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index be462be205..01e3ad565a 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -94,7 +94,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("Smem"))
set_description( N_("Stream output to memory buffer") )
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "smem" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index 5c3717ea8a..105bc206c3 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -90,7 +90,7 @@ static void Close ( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("Standard"))
set_description( N_("Standard stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout output", 50 )
add_shortcut( "standard", "std", "file", "http", "udp", SRT_SHORTCUT )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
diff --git a/modules/stream_out/stats.c b/modules/stream_out/stats.c
index 5cbb97c2f1..d6dd7cc0cb 100644
--- a/modules/stream_out/stats.c
+++ b/modules/stream_out/stats.c
@@ -294,7 +294,7 @@ static void Close( vlc_object_t * p_this )
vlc_module_begin()
set_shortname( N_("Stats"))
set_description( N_("Writes statistic info about stream"))
- set_capability( "sout stream", 0 )
+ set_capability( "sout output", 0 )
add_shortcut( "stats" )
set_category( CAT_SOUT )
set_subcategory( SUBCAT_SOUT_STREAM )
@@ -302,7 +302,7 @@ vlc_module_begin()
add_string( SOUT_CFG_PREFIX "output", "", OUTPUT_TEXT,OUTPUT_LONGTEXT, false );
add_string( SOUT_CFG_PREFIX "prefix", "stats", PREFIX_TEXT,PREFIX_TEXT, false );
add_submodule()
- set_capability( "sout stream", 0 )
+ set_capability( "sout filter", 0 )
add_shortcut( "stats" )
set_callbacks( FilterOpen, Close )
vlc_module_end()
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 8f0c3d06e6..a4bdc000e9 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -144,7 +144,7 @@ static void Close( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("Transcode"))
set_description( N_("Transcode stream output") )
- set_capability( "sout stream", 50 )
+ set_capability( "sout filter", 50 )
add_shortcut( "transcode" )
set_callbacks( Open, Close )
set_category( CAT_SOUT )
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index dd83aef1c4..a89b6601c5 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -797,6 +797,7 @@ void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last)
static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name,
config_chain_t *p_cfg, sout_stream_t *p_next)
{
+ const char *cap = (p_next != NULL) ? "sout filter" : "sout output";
sout_stream_t *p_stream;
assert(psz_name);
@@ -816,8 +817,7 @@ static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name,
msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
- p_stream->p_module =
- module_need( p_stream, "sout stream", p_stream->psz_name, true );
+ p_stream->p_module = module_need( p_stream, cap, p_stream->psz_name, true );
if( !p_stream->p_module )
{
More information about the vlc-commits
mailing list