Commit e3ae3978 authored by Laurent Aimar's avatar Laurent Aimar

* http: added a mime option.

parent 55d25614
...@@ -49,15 +49,17 @@ static void Close( vlc_object_t * ); ...@@ -49,15 +49,17 @@ static void Close( vlc_object_t * );
#define PASS_TEXT N_("Password") #define PASS_TEXT N_("Password")
#define PASS_LONGTEXT N_("Allows you to give a password that will be " \ #define PASS_LONGTEXT N_("Allows you to give a password that will be " \
"requested to access the stream." ) "requested to access the stream." )
#define MIME_TEXT N_("Mime")
#define MIME_LONGTEXT N_("Allows you to give the mime returned by the server." )
vlc_module_begin(); vlc_module_begin();
set_description( _("HTTP stream output") ); set_description( _("HTTP stream output") );
set_capability( "sout access", 0 ); set_capability( "sout access", 0 );
add_shortcut( "http" ); add_shortcut( "http" );
add_shortcut( "mmsh" ); add_shortcut( "mmsh" );
add_string( SOUT_CFG_PREFIX "user", "", NULL, "User", "", VLC_TRUE ); add_string( SOUT_CFG_PREFIX "user", "", NULL, USER_TEXT, USER_LONGTEXT, VLC_TRUE );
add_string( SOUT_CFG_PREFIX "pwd", "", NULL, "Password", "", VLC_TRUE ); add_string( SOUT_CFG_PREFIX "pwd", "", NULL, PASS_TEXT, PASS_LONGTEXT, VLC_TRUE );
add_string( SOUT_CFG_PREFIX "mime", "", NULL, MIME_TEXT, MIME_LONGTEXT, VLC_TRUE );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
vlc_module_end(); vlc_module_end();
...@@ -66,7 +68,7 @@ vlc_module_end(); ...@@ -66,7 +68,7 @@ vlc_module_end();
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
static const char *ppsz_sout_options[] = { static const char *ppsz_sout_options[] = {
"user", "pwd", NULL "user", "pwd", "mime", NULL
}; };
static int Write( sout_access_out_t *, block_t * ); static int Write( sout_access_out_t *, block_t * );
...@@ -180,19 +182,27 @@ static int Open( vlc_object_t *p_this ) ...@@ -180,19 +182,27 @@ static int Open( vlc_object_t *p_this )
if( p_access->psz_access && !strcmp( p_access->psz_access, "mmsh" ) ) if( p_access->psz_access && !strcmp( p_access->psz_access, "mmsh" ) )
{ {
psz_mime = "video/x-ms-asf-stream"; psz_mime = strdup( "video/x-ms-asf-stream" );
}
else
{
var_Get( p_access, SOUT_CFG_PREFIX "mime", &val );
if( *val.psz_string )
psz_mime = val.psz_string;
else
free( val.psz_string );
} }
var_Get( p_access, SOUT_CFG_PREFIX "user", &val ); var_Get( p_access, SOUT_CFG_PREFIX "user", &val );
if( val.psz_string && *val.psz_string ) if( *val.psz_string )
psz_user = val.psz_string; psz_user = val.psz_string;
else if( val.psz_string ) else
free( val.psz_string ); free( val.psz_string );
var_Get( p_access, SOUT_CFG_PREFIX "pwd", &val ); var_Get( p_access, SOUT_CFG_PREFIX "pwd", &val );
if( val.psz_string && *val.psz_string ) if( *val.psz_string )
psz_pwd = val.psz_string; psz_pwd = val.psz_string;
else if( val.psz_string ) else
free( val.psz_string ); free( val.psz_string );
p_sys->p_httpd_stream = p_sys->p_httpd_stream =
...@@ -200,6 +210,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -200,6 +210,7 @@ static int Open( vlc_object_t *p_this )
psz_user, psz_pwd ); psz_user, psz_pwd );
if( psz_user ) free( psz_user ); if( psz_user ) free( psz_user );
if( psz_pwd ) free( psz_pwd ); if( psz_pwd ) free( psz_pwd );
if( psz_mime ) free( psz_mime );
if( p_sys->p_httpd_stream == NULL ) if( p_sys->p_httpd_stream == NULL )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment