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

* all: cosmetics + MUX_GET_MIME.

parent a3da7219
......@@ -80,12 +80,12 @@ vlc_module_end();
*****************************************************************************/
static const char *ppsz_sout_options[] = {
"title", "author", "copyright", "comment", "rating", NULL
};;
};
static int Capability(sout_mux_t *, int, void *, void * );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
typedef struct
{
......@@ -175,9 +175,9 @@ static int Open( vlc_object_t *p_this )
int i;
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_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -267,16 +267,34 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Capability:
*****************************************************************************/
static int Capability( sout_mux_t *p_mux, int i_query,
void *p_args, void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_FALSE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
......
......@@ -51,10 +51,10 @@ vlc_module_end();
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Capability(sout_mux_t *, int , void *, void * );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int Control( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
typedef struct avi_stream_s
{
......@@ -149,7 +149,7 @@ static int Open( vlc_object_t *p_this )
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_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -212,16 +212,30 @@ static void Close( vlc_object_t * p_this )
sout_AccessOutWrite( p_mux->p_access, p_hdr );
}
static int Capability( sout_mux_t *p_mux, int i_query,
void *p_args, void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_FALSE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
......
......@@ -49,10 +49,10 @@ vlc_module_end();
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int Control( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
struct sout_mux_sys_t
{
......@@ -72,7 +72,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg( p_mux, "Dummy/Raw muxer opened" );
msg_Info( p_mux, "Open" );
p_mux->pf_capacity = Capability;
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -96,16 +96,25 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
static int Capability( sout_mux_t *p_mux, int i_query,
void *p_args, void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
vlc_bool_t *pb_bool;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
......
......@@ -70,7 +70,7 @@ static const char *ppsz_sout_options[] = {
"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 DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
......@@ -188,9 +188,9 @@ static int Open( vlc_object_t *p_this )
bo_t *box;
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_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -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,
void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
vlc_bool_t *pb_bool;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return SOUT_MUX_CAP_ERR_OK;
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*pb_bool = VLC_FALSE;
return VLC_SUCCESS;
case SOUT_MUX_CAP_GET_ADD_STREAM_WAIT:
*(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: /* Not needed, as not streamable */
default:
return SOUT_MUX_CAP_ERR_UNIMPLEMENTED;
return VLC_EGENERIC;
}
}
......
......@@ -61,7 +61,7 @@ vlc_module_end();
/*****************************************************************************
* 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 DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
......@@ -116,7 +116,7 @@ static int Open( vlc_object_t *p_this )
msg_Info( p_mux, "Open" );
p_mux->pf_capacity = Capability;
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -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,
void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
......
......@@ -307,10 +307,10 @@ static int AllocatePID( sout_mux_sys_t *p_sys, int i_cat )
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Capability(sout_mux_t *, int, void *, void * );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * );
static int DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static void TSSchedule ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
mtime_t i_pcr_length, mtime_t i_pcr_dts );
......@@ -334,11 +334,11 @@ static int Open( vlc_object_t *p_this )
vlc_value_t val;
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_mux->pf_capacity = Capability;
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -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,
void *p_answer )
static int Control( sout_mux_t *p_mux, int i_query, va_list args )
{
vlc_bool_t *pb_bool;
char **ppsz;
switch( i_query )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
......
......@@ -58,7 +58,7 @@ vlc_module_end();
/*****************************************************************************
* 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 DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
......@@ -236,7 +236,7 @@ static int Open( vlc_object_t *p_this )
p_sys->pp_del_streams = 0;
p_mux->p_sys = p_sys;
p_mux->pf_capacity = Capability;
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
p_mux->pf_delstream = DelStream;
p_mux->pf_mux = Mux;
......@@ -288,22 +288,35 @@ static void Close( vlc_object_t * p_this )
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 )
{
case SOUT_MUX_CAP_GET_ADD_STREAM_ANY_TIME:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK );
case SOUT_MUX_CAP_GET_ADD_STREAM_WAIT:
*(vlc_bool_t*)p_answer = VLC_TRUE;
return( SOUT_MUX_CAP_ERR_OK );
case MUX_CAN_ADD_STREAM_WHILE_MUXING:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
*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_TRUE;
return VLC_SUCCESS;
case MUX_GET_MIME:
ppsz = (char**)va_arg( args, char ** );
*ppsz = strdup( "application/ogg" );
return VLC_SUCCESS;
default:
return( SOUT_MUX_CAP_ERR_UNIMPLEMENTED );
return VLC_EGENERIC;
}
}
/*****************************************************************************
* 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