Changeset 1ff5e7267e7a4711f60cbe7300060d13d2955bd7

Show
Ignore:
Timestamp:
01/10/04 20:04:09 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1096653849 +0000
git-parent:

[bb1ef14f0a2d4f7a71912bee5cb04dd2af3723d9]

git-author:
Gildas Bazin <gbazin@videolan.org> 1096653849 +0000
Message:

* configure.ac: added an --enable-httpd and --enable-vlm option
* src/misc/httpd.c: use dummy wrapper if httpd is disabled.
* src/misc/vlm.c: use dummy wrapper if vlm is disabled.
* modules/control/http.c, telnet.c: properly handle cases where http/vlm is not available.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    rb2656b1 r1ff5e72  
    11861186#  VLC_ADD_PLUGINS([stream_out_transrate]) 
    11871187 
    1188   dnl Ogg and vorbis are handled in their respective section 
    1189 fi 
    1190  
     1188  AC_DEFINE(ENABLE_SOUT, 1, Define if you want the stream output support) 
     1189fi 
     1190 
     1191dnl 
     1192dnl HTTP daemon 
     1193dnl 
     1194AC_ARG_ENABLE(httpd, 
     1195  [  --enable-httpd          HTTP daemon (default enabled)]) 
     1196if test "${enable_httpd}" != "no" 
     1197then 
     1198  AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP dameon support) 
     1199fi 
     1200 
     1201dnl 
     1202dnl VideoLAN manager 
     1203dnl 
     1204AC_ARG_ENABLE(vlm, 
     1205  [  --enable-vlm            VideoLAN manager (default enabled)]) 
     1206if test "${enable_vlm}" != "no" 
     1207then 
     1208  AC_DEFINE(ENABLE_VLM, 1, Define if you want the VideoLAN manager support) 
     1209fi 
    11911210 
    11921211dnl 
     
    16311650dnl 
    16321651AC_ARG_ENABLE(screen, 
    1633   [  --enable-screen            Screen capture support (default enabled)]) 
     1652  [  --enable-screen         Screen capture support (default enabled)]) 
    16341653if test "${enable_screen}" != "no"; then 
    16351654  if test "${SYS}" = "darwin"; then 
     
    20012020dnl 
    20022021AC_ARG_ENABLE(toolame, 
    2003 [  --enable-toolame        toolame codec (default disabled)]) 
     2022[  --enable-toolame        toolame codec (default disabled)]) 
    20042023if test "${enable_toolame}" = "yes" 
    20052024then 
     
    26622681dnl 
    26632682AC_ARG_ENABLE(opengl, 
    2664   [  --enable-opengl            OpenGL support (default enabled)]) 
     2683  [  --enable-opengl         OpenGL support (default enabled)]) 
    26652684if test "${enable_opengl}" != "no" && test "${SYS}" != "beos"; then 
    26662685  if test "${SYS}" != "darwin"; then 
  • modules/control/http.c

    rcc0c26f r1ff5e72  
    11251125 
    11261126    /* fprintf( stderr," mvar_VlmSetNew: name=`%s'\n", name ); */ 
    1127     if( vlm == NULL ) 
    1128         return s; 
     1127    if( vlm == NULL ) return s; 
     1128 
    11291129    if( vlm_ExecuteCommand( vlm, "show", &msg ) ) 
    11301130    { 
     
    19751975                        p_intf->p_sys->p_vlm = vlm_New( p_intf ); 
    19761976 
     1977                    if( p_intf->p_sys->p_vlm == NULL ) break; 
     1978 
    19771979                    uri_extract_value( p_request, "name", name, 512 ); 
    19781980                    if( StrToMacroType( control ) == MVLC_VLM_NEW ) 
     
    20322034                        p_intf->p_sys->p_vlm = vlm_New( p_intf ); 
    20332035 
     2036                    if( p_intf->p_sys->p_vlm == NULL ) break; 
     2037 
    20342038                    uri_extract_value( p_request, "name", name, 512 ); 
    20352039                    sprintf( psz, "del %s", name ); 
     
    20512055                    if( p_intf->p_sys->p_vlm == NULL ) 
    20522056                        p_intf->p_sys->p_vlm = vlm_New( p_intf ); 
     2057 
     2058                    if( p_intf->p_sys->p_vlm == NULL ) break; 
    20532059 
    20542060                    uri_extract_value( p_request, "name", name, 512 ); 
     
    20802086                    if( p_intf->p_sys->p_vlm == NULL ) 
    20812087                        p_intf->p_sys->p_vlm = vlm_New( p_intf ); 
     2088 
     2089                    if( p_intf->p_sys->p_vlm == NULL ) break; 
    20822090 
    20832091                    uri_extract_value( p_request, "file", file, 512 ); 
     
    23712379                        { 
    23722380                            if( p_intf->p_sys->p_vlm == NULL ) 
    2373                             { 
    23742381                                p_intf->p_sys->p_vlm = vlm_New( p_intf ); 
    2375                             } 
    23762382                            index = mvar_VlmSetNew( m.param1, p_intf->p_sys->p_vlm ); 
    23772383                        } 
  • modules/control/telnet.c

    rb3e49f8 r1ff5e72  
    117117   int             i_clients; 
    118118   int             fd; 
    119    vlm_t          *mediatheque; 
     119   vlm_t          *mediatheque; 
    120120}; 
    121121 
     
    126126{ 
    127127    intf_thread_t *p_intf = (intf_thread_t*) p_this; 
     128    vlm_t *mediatheque; 
    128129    int i_telnetport; 
    129130 
     131    if( !(mediatheque = vlm_New( p_intf )) ) 
     132    { 
     133        msg_Err( p_intf, "cannot start VLM" ); 
     134        return VLC_EGENERIC; 
     135    } 
     136 
     137    msg_Info( p_intf, _("Using the VLM interface plugin...") ); 
     138 
    130139    i_telnetport = config_GetInt( p_intf, "telnet-port" ); 
    131  
    132 #ifdef WIN32 
    133     vlc_bool_t b_quiet; 
    134     b_quiet = config_GetInt( p_intf, "dummy-quiet" ); 
    135     if( !b_quiet ) 
    136         CONSOLE_INTRO_MSG; 
    137 #endif 
    138  
    139     msg_Info( p_intf, _("Using the VLM interface plugin...") ); 
    140  
    141     p_intf->pf_run = Run; 
    142140 
    143141    p_intf->p_sys = malloc( sizeof( intf_sys_t ) ); 
     
    152150    p_intf->p_sys->i_clients   = 0; 
    153151    p_intf->p_sys->clients     = NULL; 
    154     p_intf->p_sys->mediatheque = vlm_New( p_intf ); 
     152    p_intf->p_sys->mediatheque = mediatheque; 
     153    p_intf->pf_run = Run; 
    155154 
    156155    return VLC_SUCCESS; 
  • src/misc/httpd.c

    r51002a6 r1ff5e72  
    2626#include <vlc/vlc.h> 
    2727 
     28#ifdef ENABLE_HTTPD 
     29 
    2830#include "vlc_httpd.h" 
    2931#include "network.h" 
     
    377379    { ".jpeg",  "image/jpeg" }, 
    378380    { ".png",   "image/png" }, 
     381    { ".mpjpeg","multipart/x-mixed-replace; boundary=This Random String" }, 
    379382 
    380383    /* media mime */ 
     
    24722475    return ntohs( i_port ); 
    24732476} 
     2477 
     2478#else /* ENABLE_HTTPD */ 
     2479 
     2480/* We just define an empty wrapper */ 
     2481httpd_host_t *httpd_HostNew( vlc_object_t *a, char *b, int c ) 
     2482{ 
     2483    msg_Err( a, "HTTP daemon support is disabled" ); 
     2484    return 0; 
     2485} 
     2486void httpd_HostDelete( httpd_host_t *a ){} 
     2487httpd_url_t *httpd_UrlNew( httpd_host_t *a, char *b ){ return 0; } 
     2488httpd_url_t *httpd_UrlNewUnique( httpd_host_t *a, char *b, char *c, 
     2489                                 char *d ){ return 0; } 
     2490int httpd_UrlCatch( httpd_url_t *a, int b, httpd_callback_t c, 
     2491                    httpd_callback_sys_t *d ){ return 0; } 
     2492void httpd_UrlDelete( httpd_url_t *a ){} 
     2493 
     2494char *httpd_ClientIP( httpd_client_t *a ){ return 0; } 
     2495void httpd_ClientModeStream( httpd_client_t *a ){} 
     2496void httpd_ClientModeBidir( httpd_client_t *a ){} 
     2497 
     2498void httpd_FileDelete( httpd_file_t *a ){} 
     2499httpd_file_t *httpd_FileNew( httpd_host_t *a, char *b, char *c, char *d, 
     2500                             char *e, httpd_file_callback_t f, 
     2501                             httpd_file_sys_t *g ){ return 0; } 
     2502 
     2503void httpd_RedirectDelete( httpd_redirect_t *a ){} 
     2504httpd_redirect_t *httpd_RedirectNew( httpd_host_t *a, 
     2505                                     char *b, char *c ){ return 0; } 
     2506 
     2507void httpd_StreamDelete( httpd_stream_t *a ){} 
     2508int  httpd_StreamHeader( httpd_stream_t *a, uint8_t *b, int c ){ return 0; } 
     2509int  httpd_StreamSend  ( httpd_stream_t *a, uint8_t *b, int c ){ return 0; } 
     2510httpd_stream_t *httpd_StreamNew( httpd_host_t *a, char *b, char *c, 
     2511                                 char *d, char *e ){ return 0; } 
     2512 
     2513void httpd_MsgInit ( httpd_message_t *a ){} 
     2514void httpd_MsgAdd  ( httpd_message_t *a, char *b, char *c, ... ){} 
     2515char *httpd_MsgGet ( httpd_message_t *a, char *b ){ return 0; } 
     2516void httpd_MsgClean( httpd_message_t *a ){} 
     2517 
     2518#endif /* ENABLE_HTTPD */ 
  • src/misc/vlm.c

    r51002a6 r1ff5e72  
    3030 
    3131#include <vlc/vlc.h> 
     32 
     33#ifdef ENABLE_VLM 
     34 
    3235#include <vlc/intf.h> 
    3336#include <vlc/input.h> 
     
    21342137    return VLC_SUCCESS; 
    21352138} 
     2139 
     2140#else /* ENABLE_VLM */ 
     2141 
     2142/* We just define an empty wrapper */ 
     2143vlm_t *__vlm_New( vlc_object_t *a ) 
     2144{ 
     2145    msg_Err( a, "VideoLAN manager support is disabled" ); 
     2146    return 0; 
     2147} 
     2148void vlm_Delete( vlm_t *a ){} 
     2149int vlm_ExecuteCommand( vlm_t *a, char *b, vlm_message_t **c ){ return -1; } 
     2150void vlm_MessageDelete( vlm_message_t *a ){} 
     2151 
     2152#endif /* ENABLE_VLM */