Commit 179f1381 authored by Laurent Aimar's avatar Laurent Aimar

* all: cosmetics + MUX_GET_MIME.

parent a3da7219
...@@ -80,9 +80,9 @@ vlc_module_end(); ...@@ -80,9 +80,9 @@ vlc_module_end();
*****************************************************************************/ *****************************************************************************/
static const char *ppsz_sout_options[] = { static const char *ppsz_sout_options[] = {
"title", "author", "copyright", "comment", "rating", NULL "title", "author", "copyright", "comment", "rating", NULL
};; };
static int Capability(sout_mux_t *, int, void *, void * ); static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -175,9 +175,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -175,9 +175,9 @@ static int Open( vlc_object_t *p_this )
int i; int i;
msg_Dbg( p_mux, "Asf muxer opened" ); msg_Dbg( p_mux, "Asf muxer opened" );
sout_ParseCfg( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg ); sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -267,16 +267,34 @@ static void Close( vlc_object_t * p_this ) ...@@ -267,16 +267,34 @@ static void Close( vlc_object_t * p_this )
/***************************************************************************** /*****************************************************************************
* Capability: * Capability:
*****************************************************************************/ *****************************************************************************/
static int Capability( sout_mux_t *p_mux, int i_query, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_args, void *p_answer )
{ {
sout_mux_sys_t *p_sys = p_mux->p_sys;
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_FALSE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
if( p_sys->b_asf_http )
*ppsz = strdup( "video/x-ms-asf-stream" );
else
*ppsz = strdup( "video/x-ms-asf" );
return VLC_SUCCESS;
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
......
...@@ -51,7 +51,7 @@ vlc_module_end(); ...@@ -51,7 +51,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int Capability(sout_mux_t *, int , void *, void * ); static int Control( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -149,7 +149,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -149,7 +149,7 @@ static int Open( vlc_object_t *p_this )
p_sys->b_write_header = VLC_TRUE; p_sys->b_write_header = VLC_TRUE;
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -212,16 +212,30 @@ static void Close( vlc_object_t * p_this ) ...@@ -212,16 +212,30 @@ static void Close( vlc_object_t * p_this )
sout_AccessOutWrite( p_mux->p_access, p_hdr ); sout_AccessOutWrite( p_mux->p_access, p_hdr );
} }
static int Capability( sout_mux_t *p_mux, int i_query, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_args, void *p_answer )
{ {
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_FALSE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "video/avi" );
return VLC_SUCCESS;
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
......
...@@ -49,7 +49,7 @@ vlc_module_end(); ...@@ -49,7 +49,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * ); static int Control( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -72,7 +72,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -72,7 +72,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg( p_mux, "Dummy/Raw muxer opened" ); msg_Dbg( p_mux, "Dummy/Raw muxer opened" );
msg_Info( p_mux, "Open" ); msg_Info( p_mux, "Open" );
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -96,16 +96,25 @@ static void Close( vlc_object_t * p_this ) ...@@ -96,16 +96,25 @@ static void Close( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static int Capability( sout_mux_t *p_mux, int i_query, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_args, void *p_answer )
{ {
vlc_bool_t *pb_bool;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_MIME: /* Unknown */
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
......
...@@ -70,7 +70,7 @@ static const char *ppsz_sout_options[] = { ...@@ -70,7 +70,7 @@ static const char *ppsz_sout_options[] = {
"faststart", NULL "faststart", NULL
}; };
static int Capability(sout_mux_t *, int, void *, void * ); static int Control( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -188,9 +188,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -188,9 +188,9 @@ static int Open( vlc_object_t *p_this )
bo_t *box; bo_t *box;
msg_Dbg( p_mux, "Mp4 muxer opend" ); msg_Dbg( p_mux, "Mp4 muxer opend" );
sout_ParseCfg( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg ); sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -363,23 +363,27 @@ static void Close( vlc_object_t * p_this ) ...@@ -363,23 +363,27 @@ static void Close( vlc_object_t * p_this )
} }
/***************************************************************************** /*****************************************************************************
* Capability: * Control:
*****************************************************************************/ *****************************************************************************/
static int Capability( sout_mux_t *p_mux, int i_query, void *p_args, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_answer )
{ {
vlc_bool_t *pb_bool;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return SOUT_MUX_CAP_ERR_OK; *pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case SOUT_MUX_CAP_GET_ADD_STREAM_WAIT: case MUX_GET_ADD_STREAM_WAIT:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_MIME: /* Not needed, as not streamable */
default: default:
return SOUT_MUX_CAP_ERR_UNIMPLEMENTED; return VLC_EGENERIC;
} }
} }
......
...@@ -61,7 +61,7 @@ vlc_module_end(); ...@@ -61,7 +61,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * ); static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -116,7 +116,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -116,7 +116,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_mux, "Open" ); msg_Info( p_mux, "Open" );
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -164,18 +164,32 @@ static void Close( vlc_object_t * p_this ) ...@@ -164,18 +164,32 @@ static void Close( vlc_object_t * p_this )
} }
/***************************************************************************** /*****************************************************************************
* Capability: * Control:
*****************************************************************************/ *****************************************************************************/
static int Capability( sout_mux_t *p_mux, int i_query, void *p_args, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_answer )
{ {
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "video/mpeg" );
return VLC_SUCCESS;
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
......
...@@ -307,7 +307,7 @@ static int AllocatePID( sout_mux_sys_t *p_sys, int i_cat ) ...@@ -307,7 +307,7 @@ static int AllocatePID( sout_mux_sys_t *p_sys, int i_cat )
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * ); static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -334,11 +334,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -334,11 +334,11 @@ static int Open( vlc_object_t *p_this )
vlc_value_t val; vlc_value_t val;
msg_Dbg( p_mux, "Open" ); msg_Dbg( p_mux, "Open" );
sout_ParseCfg( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg ); sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_sys = malloc( sizeof( sout_mux_sys_t ) ); p_sys = malloc( sizeof( sout_mux_sys_t ) );
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -493,18 +493,32 @@ static void Close( vlc_object_t * p_this ) ...@@ -493,18 +493,32 @@ static void Close( vlc_object_t * p_this )
} }
/***************************************************************************** /*****************************************************************************
* Capability: * Control:
*****************************************************************************/ *****************************************************************************/
static int Capability( sout_mux_t *p_mux, int i_query, void *p_args, static int Control( sout_mux_t *p_mux, int i_query, va_list args )
void *p_answer )
{ {
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "video/mpeg" ); /* FIXME not sure */
return VLC_SUCCESS;
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
......
...@@ -58,7 +58,7 @@ vlc_module_end(); ...@@ -58,7 +58,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * ); static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * ); static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * ); static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * ); static int Mux ( sout_mux_t * );
...@@ -236,7 +236,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -236,7 +236,7 @@ static int Open( vlc_object_t *p_this )
p_sys->pp_del_streams = 0; p_sys->pp_del_streams = 0;
p_mux->p_sys = p_sys; p_mux->p_sys = p_sys;
p_mux->pf_capacity = Capability; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream; p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux; p_mux->pf_mux = Mux;
...@@ -288,22 +288,35 @@ static void Close( vlc_object_t * p_this ) ...@@ -288,22 +288,35 @@ static void Close( vlc_object_t * p_this )
free( p_sys ); free( p_sys );
} }
static int Capability( sout_mux_t *p_mux, int i_query, void *p_args, /*****************************************************************************
void *p_answer ) * Control:
*****************************************************************************/
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{ {
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query ) switch( i_query )
{ {
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME: case MUX_CAN_ADD_STREAM_WHILE_MUXING:
*(vlc_bool_t*)p_answer = VLC_TRUE; pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
return( SOUT_MUX_CAP_ERR_OK ); *pb_bool = VLC_TRUE;
case SOUT_MUX_CAP_GET_ADD_STREAM_WAIT: return VLC_SUCCESS;
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK ); case MUX_GET_ADD_STREAM_WAIT:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_TRUE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "application/ogg" );
return VLC_SUCCESS;
default: default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED ); return VLC_EGENERIC;
} }
} }
/***************************************************************************** /*****************************************************************************
* AddStream: Add an elementary stream to the muxed stream * AddStream: Add an elementary stream to the muxed stream
*****************************************************************************/ *****************************************************************************/
......
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