Commit 6192caae authored by Clément Stenac's avatar Clément Stenac

* Handle parameters in streaming profiles

* Remove i18n_string stuff
parent 5a3ae4a1
......@@ -335,6 +335,8 @@ typedef struct announce_method_t announce_method_t;
typedef struct announce_handler_t announce_handler_t;
typedef struct sap_handler_t sap_handler_t;
typedef struct sout_param_t sout_param_t;
typedef struct sout_pcat_t sout_pcat_t;
typedef struct sout_std_t sout_std_t;
typedef struct sout_display_t sout_display_t;
typedef struct sout_duplicate_t sout_duplicate_t;
......@@ -369,8 +371,6 @@ typedef struct iso639_lang_t iso639_lang_t;
typedef struct device_t device_t;
typedef struct device_probe_t device_probe_t;
typedef struct probe_sys_t probe_sys_t;
typedef struct localized_string_t localized_string_t;
typedef struct i18n_string_t i18n_string_t;
/* block */
typedef struct block_t block_t;
......
......@@ -26,6 +26,10 @@
#include <vlc/vlc.h>
/***********************************************************************
* Predefined lists of streaming data
***********************************************************************/
#ifdef WIN32
#define VCODECS_NUMBER 13
#else
......@@ -38,26 +42,11 @@
#define MUXERS_NUMBER 10
enum
{
MUX_PS,
MUX_TS,
MUX_MPEG,
MUX_OGG,
MUX_RAW,
MUX_ASF,
MUX_AVI,
MUX_MP4,
MUX_MOV,
MUX_WAV,
MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW,
MUX_ASF, MUX_AVI, MUX_MP4, MUX_MOV, MUX_WAV,
};
enum
{
ACCESS_HTTP,
ACCESS_UDP,
ACCESS_MMS,
ACCESS_RTP,
ACCESS_FILE
};
enum { ACCESS_HTTP, ACCESS_UDP, ACCESS_MMS, ACCESS_RTP, ACCESS_FILE };
struct codec_desc_t {
char *psz_display;
......@@ -93,7 +82,39 @@ struct mux_desc_t {
//static const char *abitrates_array[] =
//{ "512", "256", "192", "128", "96", "64", "32", "16" } ;
//
/***********************************************************************
* Streaming profiles
***********************************************************************/
/****************** Parameters handling *********************/
struct sout_param_t
{
int i_type;
int i_element;
char *psz_id;
char *psz_string;
vlc_value_t value;
};
struct sout_pcat_t
{
char *psz_name;
int i_params;
sout_param_t **pp_params;
};
void streaming_ParameterApply( sout_param_t *p_param, char **ppsz_dest,
int *pi_dest, float *pf_dest, vlc_bool_t *pb_dest );
/******** Module types definitions and parametrable elements ***************/
/* Transcode */
enum { I_VB, I_AB, I_CHANNELS, F_SCALE, B_SOVERLAY, PSZ_VC, PSZ_AC, PSZ_SC,
PSZ_VE, PSZ_AE };
struct sout_transcode_t
{
int i_vb, i_ab, i_channels;
......@@ -101,18 +122,27 @@ struct sout_transcode_t
vlc_bool_t b_soverlay;
char *psz_vcodec, *psz_acodec, *psz_scodec, *psz_venc, *psz_aenc;
char *psz_additional;
int i_params; sout_param_t **pp_params;
};
void streaming_TranscodeParametersApply( sout_transcode_t *p_module );
struct sout_std_t
/* Standard */
enum { PSZ_MUX, PSZ_ACCESS, PSZ_URL, PSZ_NAME, PSZ_GROUP };
struct sout_std_t
{
char *psz_mux, *psz_access;
char *psz_url, *psz_name, *psz_group;
int i_params; sout_param_t **pp_params;
};
void streaming_StdParametersApply( sout_std_t *p_module );
struct sout_display_t
/* Display */
struct sout_display_t
{
};
/* Duplicate */
struct sout_duplicate_t
{
int i_children, i_conditions;
......@@ -120,6 +150,7 @@ struct sout_duplicate_t
char **ppsz_conditions;
};
/******* Generic profile structures and manipulation functions ********/
typedef union
{
sout_transcode_t *p_transcode;
......@@ -128,7 +159,6 @@ typedef union
sout_display_t *p_display;
} sout_module_type_t;
struct sout_module_t
{
int i_type;
......@@ -136,14 +166,8 @@ struct sout_module_t
sout_module_t *p_parent;
};
enum
{
SOUT_MOD_TRANSCODE,
SOUT_MOD_STD,
SOUT_MOD_RTP,
SOUT_MOD_DUPLICATE,
SOUT_MOD_DISPLAY
};
enum { SOUT_MOD_TRANSCODE, SOUT_MOD_STD, SOUT_MOD_RTP, SOUT_MOD_DUPLICATE,
SOUT_MOD_DISPLAY };
struct sout_chain_t
{
......@@ -152,9 +176,28 @@ struct sout_chain_t
int i_options;
char **ppsz_options;
int i_pcats;
sout_pcat_t **pp_pcats;
};
struct sout_gui_descr_t
static inline sout_chain_t *streaming_ChainNew()
{
DECMALLOC_NULL( p_chain, sout_chain_t );
memset( p_chain, 0, sizeof( sout_chain_t ) );
p_chain->i_options = 0;
return p_chain;
}
struct streaming_profile_t
{
char *psz_title;
char *psz_description;
sout_chain_t *p_chain;
};
/**************** GUI interaction *****************/
struct sout_gui_descr_t
{
/* Access */
vlc_bool_t b_local, b_file, b_http, b_mms, b_rtp, b_udp, b_dump;
......@@ -176,21 +219,7 @@ struct sout_gui_descr_t
int i_ttl;
};
struct streaming_profile_t
{
i18n_string_t *p_title;
i18n_string_t *p_description;
sout_chain_t *p_chain;
};
static inline sout_chain_t *streaming_ChainNew()
{
DECMALLOC_NULL( p_chain, sout_chain_t );
memset( p_chain, 0, sizeof( sout_chain_t ) );
p_chain->i_options = 0;
return p_chain;
}
/***************** Profile parsing ***********************/
struct profile_parser_t
{
......@@ -198,8 +227,4 @@ struct profile_parser_t
streaming_profile_t *p_profile;
};
//VLC_XEXPORT( char *, streaming_ChainToPsz, (sout_chain_t * ) );
#endif
......@@ -34,38 +34,6 @@
VLC_EXPORT( void, resolve_xml_special_chars, ( char *psz_value ) );
VLC_EXPORT( char *, convert_xml_special_chars, ( const char *psz_content ) );
struct localized_string_t
{
char *psz_lang;
char *psz_text;
};
struct i18n_string_t
{
int i_langs;
localized_string_t **pp_langs;
};
static inline void i18n_AddLang( i18n_string_t *p_src,
char *psz_lang, char *psz_text )
{
DECMALLOC_VOID( pl10n, localized_string_t );
pl10n->psz_lang = strdup( psz_lang );
pl10n->psz_text = strdup( psz_text );
INSERT_ELEM( p_src->pp_langs, p_src->i_langs, p_src->i_langs, pl10n );
};
static inline char *i18n_Get( i18n_string_t *p_src, char *psz_lang )
{
int i;
for( i = 0 ; i < p_src->i_langs; i++ )
{
if( !strcmp( p_src->pp_langs[i]->psz_lang, psz_lang ) )
return p_src->pp_langs[i]->psz_text;
}
return strdup( "" );
};
/**
* @}
*/
......
This diff is collapsed.
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