Changeset a2dd91771917aa86d9e94aa2d6777f8805332e63

Show
Ignore:
Timestamp:
10/17/07 20:36:22 (11 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1192646182 +0000
git-parent:

[7b3eb71e858bfcb3f22d07985f27226306e26ce2]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1192646182 +0000
Message:

Add Icecast support to profiles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_streaming.h

    rfbf4c80 ra2dd917  
    122122struct sout_transcode_t 
    123123{ 
    124     int i_vb, i_ab, i_channels; 
     124    int32_t i_vb; 
     125    int32_t i_ab; 
     126    int32_t i_channels; 
    125127    float f_scale; 
    126128    vlc_bool_t b_soverlay; 
    127129    char *psz_vcodec; 
    128     char *psz_acodec, *psz_scodec, *psz_venc, *psz_aenc; 
     130    char *psz_acodec; 
     131    char *psz_scodec; 
     132    char *psz_venc; 
     133    char *psz_aenc; 
    129134    char *psz_additional; 
    130135 
    131     int i_params; sout_param_t **pp_params; 
     136    int32_t i_params; 
     137    sout_param_t **pp_params; 
    132138}; 
    133139void streaming_TranscodeParametersApply( sout_transcode_t *p_module ); 
     
    137143struct sout_std_t 
    138144{ 
    139     char *psz_mux, *psz_access; 
    140     char *psz_url, *psz_name, *psz_group; 
    141     int i_params; sout_param_t **pp_params; 
     145    char *psz_mux; 
     146    char *psz_access; 
     147    char *psz_url; 
     148    char *psz_name; 
     149    char *psz_group; 
     150    int i_params; 
     151    sout_param_t **pp_params; 
    142152}; 
    143153void streaming_StdParametersApply( sout_std_t *p_module ); 
     
    151161struct sout_duplicate_t 
    152162{ 
    153     int i_children, i_conditions; 
     163    int i_children; 
     164    int i_conditions; 
    154165    sout_chain_t **pp_children; 
    155166    char **ppsz_conditions; 
     
    202213}; 
    203214 
     215/** struct for holding account information needed to access the services */ 
     216struct streaming_account_t 
     217{ 
     218    char *psz_username; /*< username of account */ 
     219    char *psz_password; /*< password of account */ 
     220}; 
     221 
    204222/**************** GUI interaction *****************/ 
     223/** struct to hold user interface information */ 
    205224struct sout_gui_descr_t 
    206225{ 
    207     /* Access */ 
    208     vlc_bool_t b_local, b_file, b_http, b_mms, b_rtp, b_udp, b_dump; 
    209     char *psz_file, *psz_http, *psz_mms, *psz_rtp, *psz_udp; 
    210     int i_http, i_mms, i_rtp, i_udp; 
     226    /* Access types */ 
     227    vlc_bool_t b_local;   /*< local access module */ 
     228    vlc_bool_t b_file;    /*< file access module */ 
     229    vlc_bool_t b_http;    /*< http access module */ 
     230    vlc_bool_t b_mms;     /*< mms access module */ 
     231    vlc_bool_t b_rtp;     /*< rtp access module */ 
     232    vlc_bool_t b_udp;     /*< udp access module */ 
     233    vlc_bool_t b_dump;    /*< dump access module */ 
     234    vlc_bool_t b_icecast; /*< icecast access module */ 
     235 
     236    char *psz_file;     /*< filename */ 
     237    char *psz_http;     /*< HTTP servername or ipaddress */ 
     238    char *psz_mms;      /*< MMS servername or ipaddress */ 
     239    char *psz_rtp;      /*< RTP servername or ipaddress */ 
     240    char *psz_udp;      /*< UDP servername or ipaddress */ 
     241    char *psz_icecast;  /*< Icecast servername or ipaddress*/ 
     242 
     243    int32_t i_http;     /*< http port number */ 
     244    int32_t i_mms;      /*< mms port number */ 
     245    int32_t i_rtp;      /*< rtp port number */ 
     246    int32_t i_udp;      /*< udp port number */ 
     247    int32_t i_icecast;  /*< icecast port number */ 
    211248 
    212249    /* Mux */ 
    213     char *psz_mux; 
     250    char *psz_mux;      /*< name of muxer to use in streaming */ 
    214251 
    215252    /* Transcode */ 
    216     vlc_bool_t b_soverlay; 
    217     char *psz_vcodec, *psz_acodec, *psz_scodec; 
    218     int i_vb, i_ab, i_channels; 
    219     float f_scale; 
     253    vlc_bool_t b_soverlay; /*< enable burning overlay in the video */ 
     254    char *psz_vcodec;   /*< video codec to use in transcoding */ 
     255    char *psz_acodec;   /*< audio codec to use in transcoding */ 
     256    char *psz_scodec;   /*< subtitle codec to use in transcoding */ 
     257    int32_t i_vb;       /*< video bitrate to use in transcoding */ 
     258    int32_t i_ab;       /*< audio bitrate to use in transcoding */ 
     259    int32_t i_channels; /*< number of audio channels to use in transcoding */ 
     260    float f_scale;      /*< scaling factor to use in transcoding */ 
    220261 
    221262    /* Misc */ 
    222     vlc_bool_t b_sap, b_all_es; 
    223     char *psz_group, *psz_name; 
    224     int i_ttl; 
     263    vlc_bool_t b_sap;   /*< send SAP announcement */ 
     264    vlc_bool_t b_all_es;/*< send all elementary streams from source stream */ 
     265    char *psz_group;    /*< SAP Group name */ 
     266    char *psz_name;     /*< SAP name */ 
     267    int32_t i_ttl;      /*< Time To Live (TTL) for network traversal */ 
     268 
     269    /* Icecast */ 
     270    char *psz_mountpoint;/*< path to Icecast mountpoint */ 
     271    struct streaming_account_t sa_icecast;  /*< Icecast account information */ 
    225272}; 
    226273 
  • src/stream_output/profiles.c

    r0e39834 ra2dd917  
    265265        pd->b_file = VLC_TRUE; pd->psz_file = strdup( STDM->psz_url ); \ 
    266266    } \ 
    267     else if( !strcmp( STDM->psz_access, "http" ) )\ 
     267    else if( !strcmp( STDM->psz_access, "http" ) )\ 
    268268    { \ 
    269269        pd->b_http = VLC_TRUE; pd->psz_http = strdup( STDM->psz_url ); \ 
    270270    } \ 
    271     else if( !strcmp( STDM->psz_access, "mms" ) )\ 
     271    else if( !strcmp( STDM->psz_access, "mms" ) )\ 
    272272    { \ 
    273273        pd->b_mms = VLC_TRUE; pd->psz_mms = strdup( STDM->psz_url ); \ 
    274274    } \ 
    275     else if( !strcmp( STDM->psz_access, "udp" ) )\ 
     275    else if( !strcmp( STDM->psz_access, "udp" ) )\ 
    276276    { \ 
    277277        pd->b_udp = VLC_TRUE; pd->psz_udp = strdup( STDM->psz_url ); \ 
     
    379379    sout_duplicate_t *p_dup = NULL; 
    380380    (void)p_obj; 
     381 
    381382    /* Clean up the chain */ 
    382383    streaming_ChainClean( p_chain ); 
     
    393394    /* #std{} */ 
    394395    if( pd->b_local + pd->b_file + pd->b_http + pd->b_mms + pd->b_rtp + 
    395         pd->b_udp > 1 ) 
     396        pd->b_udp + pd->b_icecast > 1 ) 
    396397    { 
    397398        p_dup = streaming_ChainAddDup( p_chain ); 
     
    425426                                           pd->psz_mux, pd->psz_udp ); 
    426427        } 
    427         if( pd->i_ttl ) ADD_OPT( "ttl=%i", pd->i_ttl ); 
     428        if( pd->i_ttl ) 
     429            ADD_OPT( "ttl=%i", pd->i_ttl ); 
    428430        if( pd->b_sap ) 
    429431        { 
     
    432434            p_std->psz_group = pd->psz_group ? strdup( pd->psz_group ) : NULL; 
    433435        } 
     436    } 
     437    if( pd->b_icecast ) 
     438    { 
     439        sout_std_t *p_std; 
     440        char *psz_username; 
     441 
     442        if( p_dup ) streaming_DupAddChild( p_dup ); 
     443 
     444        if( !strcmp( pd->sa_icecast.psz_username, "" ) ) 
     445        { 
     446            asprintf( &psz_username, "%s", "" ); 
     447        } 
     448        else 
     449        { 
     450            asprintf( &psz_username, "%s:%s@", pd->sa_icecast.psz_username, 
     451                      pd->sa_icecast.psz_password ); 
     452        } 
     453        if( pd->i_icecast > 0 ) 
     454        { 
     455            char *psz_url; 
     456            asprintf( &psz_url, "%s%s:%i%s", psz_username, pd->psz_icecast, 
     457                      pd->i_icecast, pd->psz_mountpoint ); 
     458            p_std = streaming_ChainAddStd( DUP_OR_CHAIN, "shout", 
     459                                           pd->psz_mux, psz_url ); 
     460            free( psz_url ); 
     461        } 
     462        else 
     463        { 
     464            char *psz_url; 
     465            asprintf( &psz_url, "%s:%s@%s%s", pd->sa_icecast.psz_username, 
     466                      pd->sa_icecast.psz_password, pd->psz_icecast, 
     467                      pd->psz_mountpoint ); 
     468            p_std = streaming_ChainAddStd( DUP_OR_CHAIN, "shout", 
     469                                           pd->psz_mux, psz_url ); 
     470            free( psz_url ); 
     471        } 
     472        free( psz_username ); 
    434473    } 
    435474    HANDLE_GUI_URL( http, "http" ) 
     
    491530 
    492531        case SOUT_MOD_DISPLAY: 
    493             CHAIN_APPEND( "display" ) 
     532            CHAIN_APPEND( "display" ); 
    494533            break; 
    495534        case SOUT_MOD_STD: 
    496             CHAIN_APPEND( "std{access=%s,url=%s,mux=%s}", STDM->psz_access, 
     535            CHAIN_APPEND( "std{access=%s,dst=%s,mux=%s}", STDM->psz_access, 
    497536                          STDM->psz_url, STDM->psz_mux ); 
     537            break; 
    498538        } 
    499539        if( i != p_chain->i_modules - 1 ) CHAIN_APPEND( ":" );