[vlc-devel] commit: Add bind and path aliases for standard streamoutput, so you can document (Ilkka Ollakka )
git version control
git at videolan.org
Mon Mar 17 09:23:55 CET 2008
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Fri Mar 14 22:57:55 2008 +0200| [80a74d66eb92914ffba1e4996de3bf74060ba5e5]
Add bind and path aliases for standard streamoutput, so you can document
streaming (hopefully) more cleaner way like:
standard{access=http,bind=:8080,path=/myfile.ts}
equals to
standard{access=http,dst=:8080//myfile.ts}
(that extra / doesn't seem to harm and it's only visual flaw)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=80a74d66eb92914ffba1e4996de3bf74060ba5e5
---
modules/stream_out/standard.c | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index bfa13a5..148f153 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -46,6 +46,14 @@
#define DEST_TEXT N_("Output destination")
#define DEST_LONGTEXT N_( \
"Destination (URL) to use for the stream." )
+#define BIND_TEXT N_("address to bind to (helper setting for dst)")
+#define BIND_LONGTEXT N_( \
+ "address:port to bind vlc to listening incoming streams "\
+ "helper setting for dst,dst=bind+'/'+path" )
+#define PATH_TEXT N_("filename for stream (helper setting for dst)")
+#define PATH_LONGTEXT N_( \
+ "Filename for stream "\
+ "helper setting for dst, dst=bind+'/'+path" )
#define NAME_TEXT N_("Session name")
#define NAME_LONGTEXT N_( \
"This allows you to specify a name for the session, that will be announced "\
@@ -98,6 +106,10 @@ vlc_module_begin();
MUX_LONGTEXT, VLC_FALSE );
add_string( SOUT_CFG_PREFIX "dst", "", NULL, DEST_TEXT,
DEST_LONGTEXT, VLC_FALSE );
+ add_string( SOUT_CFG_PREFIX "bind", "", NULL, BIND_TEXT,
+ BIND_LONGTEXT, VLC_FALSE );
+ add_string( SOUT_CFG_PREFIX "path", "", NULL, PATH_TEXT,
+ PATH_LONGTEXT, VLC_FALSE );
change_unsafe();
add_bool( SOUT_CFG_PREFIX "sap", VLC_FALSE, NULL, SAP_TEXT, SAP_LONGTEXT,
@@ -125,7 +137,8 @@ vlc_module_end();
*****************************************************************************/
static const char *ppsz_sout_options[] = {
"access", "mux", "url", "dst",
- "sap", "name", "group", "description", "url", "email", "phone", NULL
+ "sap", "name", "group", "description", "url", "email", "phone",
+ "bind", "path", NULL
};
#define DEFAULT_PORT 1234
@@ -152,6 +165,8 @@ static int Open( vlc_object_t *p_this )
char *psz_mux;
char *psz_access;
char *psz_url;
+ char *psz_bind;
+ char *psz_path;
vlc_value_t val;
@@ -171,8 +186,24 @@ static int Open( vlc_object_t *p_this )
psz_mux = *val.psz_string ? val.psz_string : NULL;
if( !*val.psz_string ) free( val.psz_string );
+ var_Get( p_stream, SOUT_CFG_PREFIX "bind", &val );
+ psz_bind = *val.psz_string ? val.psz_string : NULL;
+ if( !*val.psz_string ) free( val.psz_string);
+
+ var_Get( p_stream, SOUT_CFG_PREFIX "path", &val );
+ psz_path = *val.psz_string ? val.psz_string : NULL;
+ if( !*val.psz_string ) free( val.psz_string);
+
+ if( psz_bind ) psz_url = psz_bind;
+ if( psz_url && psz_path )
+ {
+ if( asprintf( &psz_url,"%s/%s",psz_url,psz_path ) == -1 )
+ psz_url = NULL;
+ free( psz_path );
+ }
+
var_Get( p_stream, SOUT_CFG_PREFIX "dst", &val );
- psz_url = *val.psz_string ? val.psz_string : NULL;
+ if( *val.psz_string ) psz_url = val.psz_string;
if( !*val.psz_string ) free( val.psz_string );
p_sys = p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) );
More information about the vlc-devel
mailing list