Changeset 14b3f0cfa16fa0147dafd44b64bf94403a0095fb

Show
Ignore:
Timestamp:
14/07/03 23:32:59 (5 years ago)
Author:
Sigmund Augdal Helberg <sigmunau@videolan.org>
git-committer:
Sigmund Augdal Helberg <sigmunau@videolan.org> 1058218379 +0000
git-parent:

[371148d3db06625f4842833f10f7deb66e3001df]

git-author:
Sigmund Augdal Helberg <sigmunau@videolan.org> 1058218379 +0000
Message:

All: My shot at improving subtitle rendering in vlc. Now each vout uses a "text renderer" module to render text on the video when needed. I decieded to make this a module type, because other api's (win32 and macosx) is supposed to do better than freetype under some circumstances.

include/video_output.h: added some members needed by text renderer modules
src/video_output/video_output.c: load and unload text renderer module when needed
src/video_output/video_text.c: implemented some functions to show text on the video
include/osd.h: exported the functions to show text
modules/misc/Modules.am, module/misc/freetype.c: new text renderer module, largly based on the old osdtext module.
modules/video_filter/Modules.am, modules/video_filter/osd_text.c: removed the osdtext module
configure.ac: changes "osdtext" to "freetype" some places
modules/codec/spudec/*: when iconv is available, use it to convert textual subtitles from the encoding given by --sub-encoding to utf8. Use new code to render subtitles
modules/control/lirc/lirc.c: use new code to give feedback on buttons pressed. untested.
modules/demux/util/sub.c: remove all traces of the ugly old osdtext module
modules/misc/dummy/*: added a "text renderer" submodule in the dummy module
src/misc/modules.c: included osd.h as it seems to be needed to export symbols

final notes: you need to give a proper value to --freetype-font. This should be the path to a font file freetype2 can handle (almost any format afaik) with a unicode translation table in it. Windows ttf files will do. In linux at least openoffice distributes some fonts that work. I think macosx and beos also has useable fonts.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    rd46bb4f r14b3f0c  
    11dnl Autoconf settings for vlc 
    2 dnl $Id: configure.ac,v 1.29 2003/07/14 16:10:20 gbazin Exp $ 
     2dnl $Id: configure.ac,v 1.30 2003/07/14 21:32:58 sigmunau Exp $ 
    33 
    44AC_INIT(vlc,0.6.0) 
     
    21302130  if test "${FREETYPE_CONFIG}" != "no" 
    21312131  then 
    2132     AX_ADD_PLUGINS([osdtext]) 
    2133     AX_ADD_CFLAGS([osdtext],[`${FREETYPE_CONFIG} --cflags`]) 
    2134     AX_ADD_LDFLAGS([osdtext],[`${FREETYPE_CONFIG} --libs`]) 
     2132    AX_ADD_PLUGINS([freetype]) 
     2133    AX_ADD_CFLAGS([freetype],[`${FREETYPE_CONFIG} --cflags`]) 
     2134    AX_ADD_LDFLAGS([freetype],[`${FREETYPE_CONFIG} --libs`]) 
    21352135    CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_freetype}" 
    21362136  elif test "${enable_freetype}" =  "yes" 
  • include/osd.h

    rb5d99c6 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2003 VideoLAN 
    5  * $Id: osd.h,v 1.1 2003/03/23 16:38:40 sigmunau Exp $ 
     5 * $Id: osd.h,v 1.2 2003/07/14 21:32:58 sigmunau Exp $ 
    66 * 
    77 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> 
     
    2626#define OSD_ALIGN_TOP 0 
    2727#define OSD_ALIGN_BOTTOM 0x2 
     28struct text_style_t 
     29{ 
     30    int i_size; 
     31    uint32_t i_color; 
     32    vlc_bool_t b_italic; 
     33    vlc_bool_t b_bold; 
     34    vlc_bool_t b_underline; 
     35}; 
     36static const text_style_t default_text_style = { 22, 0xffffff, VLC_FALSE, VLC_FALSE, VLC_FALSE }; 
     37 
     38VLC_EXPORT( void, vout_ShowTextRelative, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t ) ); 
     39VLC_EXPORT( void,  vout_ShowTextAbsolute, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) ); 
  • include/video_output.h

    rc302e98 r14b3f0c  
    66 ***************************************************************************** 
    77 * Copyright (C) 1999, 2000 VideoLAN 
    8  * $Id: video_output.h,v 1.95 2003/06/09 00:33:34 massiot Exp $ 
     8 * $Id: video_output.h,v 1.96 2003/07/14 21:32:58 sigmunau Exp $ 
    99 * 
    1010 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    5151} vout_chroma_t; 
    5252 
    53 /***************************************************************************** 
    54  * vout_thread_t: video output thread descriptor 
    55  ***************************************************************************** 
     53/** 
     54 * \brief video output thread descriptor 
     55 * 
    5656 * Any independant video output device, such as an X11 window or a GGI device, 
    5757 * is represented by a video output thread, and described using the following 
    5858 * structure. 
    59  *****************************************************************************
     59 *
    6060struct vout_thread_t 
    6161{ 
    6262    VLC_COMMON_MEMBERS 
    6363 
    64     /* Thread properties and lock */ 
    65     vlc_mutex_t         picture_lock;                   /* picture heap lock */ 
    66     vlc_mutex_t         subpicture_lock;             /* subpicture heap lock */ 
    67     vlc_mutex_t         change_lock;                   /* thread change lock */ 
    68     vout_sys_t *        p_sys;                       /* system output method */ 
    69  
    70     /* Current display properties */ 
    71     uint16_t            i_changes;             /* changes made to the thread */ 
    72     float               f_gamma;                                    /* gamma */ 
    73     vlc_bool_t          b_grayscale;           /* color or grayscale display */ 
    74     vlc_bool_t          b_info;              /* print additional information */ 
    75     vlc_bool_t          b_interface;                     /* render interface */ 
    76     vlc_bool_t          b_scale;                    /* allow picture scaling */ 
    77     vlc_bool_t          b_fullscreen;           /* toogle fullscreen display */ 
    78     vlc_bool_t          b_override_aspect;         /* aspect ratio overriden */ 
    79     mtime_t             render_time;             /* last picture render time */ 
    80     unsigned int        i_window_width;                /* video window width */ 
    81     unsigned int        i_window_height;              /* video window height */ 
    82  
    83     /* Plugin used and shortcuts to access its capabilities */ 
     64    /** \name Thread properties and locks */ 
     65    /**@{*/ 
     66    vlc_mutex_t         picture_lock;                 /**< picture heap lock */ 
     67    vlc_mutex_t         subpicture_lock;           /**< subpicture heap lock */ 
     68    vlc_mutex_t         change_lock;                 /**< thread change lock */ 
     69    vout_sys_t *        p_sys;                     /**< system output method */ 
     70    /**@}*/ 
     71     
     72    /** \name Current display properties */ 
     73    /**@{*/ 
     74    uint16_t            i_changes;           /**< changes made to the thread */ 
     75    float               f_gamma;                                  /**< gamma */ 
     76    vlc_bool_t          b_grayscale;         /**< color or grayscale display */ 
     77    vlc_bool_t          b_info;            /**< print additional information */ 
     78    vlc_bool_t          b_interface;                   /**< render interface */ 
     79    vlc_bool_t          b_scale;                  /**< allow picture scaling */ 
     80    vlc_bool_t          b_fullscreen;         /**< toogle fullscreen display */ 
     81    vlc_bool_t          b_override_aspect;       /**< aspect ratio overriden */ 
     82    mtime_t             render_time;           /**< last picture render time */ 
     83    unsigned int        i_window_width;              /**< video window width */ 
     84    unsigned int        i_window_height;            /**< video window height */ 
     85    /**@}*/ 
     86     
     87    /** \name Plugin used and shortcuts to access its capabilities */ 
     88    /**@{*/ 
    8489    module_t *   p_module; 
    8590    int       ( *pf_init )       ( vout_thread_t * ); 
     
    8893    void      ( *pf_render )     ( vout_thread_t *, picture_t * ); 
    8994    void      ( *pf_display )    ( vout_thread_t *, picture_t * ); 
     95    /**@}*/ 
    9096 
    91     /* Statistics - these numbers are not supposed to be accurate, but are a 
     97    /** \name Statistics 
     98     * These numbers are not supposed to be accurate, but are a 
    9299     * good indication of the thread status */ 
    93     count_t             c_fps_samples;                     /* picture counts */ 
    94     mtime_t             p_fps_sample[VOUT_FPS_SAMPLES]; /* FPS samples dates */ 
     100    /**@{*/ 
     101    count_t       c_fps_samples;                         /**< picture counts */ 
     102    mtime_t       p_fps_sample[VOUT_FPS_SAMPLES];     /**< FPS samples dates */ 
     103    /**@}*/ 
    95104 
    96     /* Video heap and translation tables */ 
    97     int                 i_heap_size;                            /* heap size */ 
    98     picture_heap_t      render;                         /* rendered pictures */ 
    99     picture_heap_t      output;                            /* direct buffers */ 
    100     vlc_bool_t          b_direct;              /* rendered are like direct ? */ 
    101     vout_chroma_t       chroma;                        /* translation tables */ 
     105    /** \name Video heap and translation tables */ 
     106    /**@{*/ 
     107    int                 i_heap_size;                          /**< heap size */ 
     108    picture_heap_t      render;                       /**< rendered pictures */ 
     109    picture_heap_t      output;                          /**< direct buffers */ 
     110    vlc_bool_t          b_direct;            /**< rendered are like direct ? */ 
     111    vout_chroma_t       chroma;                      /**< translation tables */ 
     112    /**@}*/ 
    102113 
    103114    /* Picture and subpicture heaps */ 
    104     picture_t           p_picture[2*VOUT_MAX_PICTURES];          /* pictures */ 
    105     subpicture_t        p_subpicture[VOUT_MAX_PICTURES];      /* subpictures */ 
    106  
    107     /* Bitmap fonts */ 
    108     vout_font_t *       p_default_font;                      /* default font */ 
    109     vout_font_t *       p_large_font;                          /* large font */ 
     115    picture_t           p_picture[2*VOUT_MAX_PICTURES];        /**< pictures */ 
     116    subpicture_t        p_subpicture[VOUT_MAX_PICTURES];    /**< subpictures */ 
    110117 
    111118    /* Statistics */ 
    112     count_t             c_loops; 
    113     count_t             c_pictures, c_late_pictures; 
    114     mtime_t             display_jitter;    /* average deviation from the PTS */ 
    115     count_t             c_jitter_samples;  /* number of samples used for the * 
    116                                             * calculation of the jitter      */ 
    117     /* delay created by internal caching */ 
     119    count_t          c_loops; 
     120    count_t          c_pictures, c_late_pictures; 
     121    mtime_t          display_jitter;    /**< average deviation from the PTS */ 
     122    count_t          c_jitter_samples;  /**< number of samples used 
     123                                           for the calculation of the 
     124                                           jitter  */ 
     125    /** delay created by internal caching */ 
    118126    int                 i_pts_delay; 
    119127 
     
    121129    char *psz_filter_chain; 
    122130    vlc_bool_t b_filter_change; 
     131 
     132    /* text renderer data */ 
     133    text_renderer_sys_t * p_text_renderer_data;        /**< private data for 
     134                                   the text renderer */ 
     135    module_t *            p_text_renderer_module;  /**< text renderer module */ 
     136    int ( *pf_add_string ) ( vout_thread_t *, char *, text_style_t *, int,   
     137                 int, int, mtime_t, mtime_t ); /**< callback used when a new string needs to be shown on the vout */ 
    123138}; 
    124139 
  • modules/codec/spudec/spudec.c

    rcae8721 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: spudec.c,v 1.19 2003/06/12 22:27:35 massiot Exp $ 
     5 * $Id: spudec.c,v 1.20 2003/07/14 21:32:58 sigmunau Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    5353#define DEFAULT_FONT "font-eutopiabold21.rle" 
    5454 
     55#define ENCODING_TEXT N_("subtitle text encoding") 
     56#define ENCODING_LONGTEXT N_("change the encoding used in text subtitles") 
     57 
    5558vlc_module_begin(); 
    5659    add_category_hint( N_("subtitles"), NULL, VLC_TRUE ); 
     
    6366              FONT_TEXT, FONT_LONGTEXT, VLC_TRUE ); 
    6467#endif 
     68#if defined(HAVE_ICONV) 
     69    add_string( "spudec-encoding", "ISO-8859-1", NULL, ENCODING_TEXT, 
     70        ENCODING_LONGTEXT, VLC_FALSE ); 
     71#endif 
    6572    set_description( _("subtitles decoder") ); 
    6673    set_capability( "decoder", 50 ); 
     
    152159        } 
    153160#endif 
    154  
     161#if defined(HAVE_ICONV) 
     162    p_spudec->iconv_handle = iconv_open( "UTF-8", config_GetPsz( p_spudec->p_fifo, "spudec-encoding" ) ); 
     163    if( p_spudec->iconv_handle == (iconv_t)-1 ) 
     164    { 
     165        msg_Warn( p_spudec->p_fifo, "Unable to do requested conversion" ); 
     166    } 
     167#endif 
    155168        while( (!p_spudec->p_fifo->b_die) && (!p_spudec->p_fifo->b_error) ) 
    156169        { 
     
    325338        } 
    326339    } 
    327  
     340#if defined(HAVE_ICONV) 
     341    if( p_spudec->iconv_handle != (iconv_t)-1 ) 
     342    { 
     343    iconv_close( p_spudec->iconv_handle ); 
     344    } 
     345#endif 
    328346    CloseBitstream( &p_spudec->bit_stream ); 
    329347    free( p_spudec ); 
  • modules/codec/spudec/spudec.h

    rade615b r14b3f0c  
     1 
    12/***************************************************************************** 
    23 * spudec.h : sub picture unit decoder thread interface 
    34 ***************************************************************************** 
    45 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: spudec.h,v 1.5 2002/12/06 16:34:05 sam Exp $ 
     6 * $Id: spudec.h,v 1.6 2003/07/14 21:32:58 sigmunau Exp $ 
    67 * 
    78 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    2122 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. 
    2223 *****************************************************************************/ 
     24 
     25#if defined(HAVE_ICONV) 
     26#include <iconv.h> 
     27#endif 
     28 
    2329 
    2430typedef struct spudec_thread_t spudec_thread_t; 
     
    8490    unsigned int        i_spu_size;            /* size of current SPU packet */ 
    8591    unsigned int        i_rle_size;                  /* size of the RLE part */ 
     92#if defined(HAVE_ICONV) 
     93    iconv_t             iconv_handle;     /* handle to iconv instance */ 
     94#endif 
    8695}; 
    8796 
  • modules/codec/spudec/text.c

    r3a52126 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: text.c,v 1.5 2003/05/11 14:33:32 sigmunau Exp $ 
     5 * $Id: text.c,v 1.6 2003/07/14 21:32:58 sigmunau Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    2222 *****************************************************************************/ 
    2323 
    24 /* define USE_FREETYPE here to disable the old style subtitles */ 
    2524 
    2625/***************************************************************************** 
     
    3332#include <vlc/vout.h> 
    3433#include <vlc/decoder.h> 
     34#include <osd.h> 
    3535 
    3636#include "spudec.h" 
     
    4545void E_(ParseText)( spudec_thread_t *p_spudec, subtitler_font_t *p_font ) 
    4646{ 
    47 #if !defined(USE_FREETYPE) 
    4847    char         * psz_subtitle; 
    4948    mtime_t        i_pts, i_dts; 
     
    7574    if( psz_subtitle[0] != '\0' ) 
    7675    { 
     76#if defined(HAVE_ICONV) 
     77    char *psz_new_subtitle, *psz_convert_buffer_out, *psz_convert_buffer_in; 
     78    size_t ret, inbytes_left, outbytes_left; 
     79    psz_new_subtitle = malloc( 6 * strlen( psz_subtitle ) * sizeof(char) ); 
     80    psz_convert_buffer_out = psz_new_subtitle; 
     81    psz_convert_buffer_in = psz_subtitle; 
     82    inbytes_left = strlen( psz_subtitle ); 
     83    outbytes_left = 6 * inbytes_left; 
     84    ret = iconv( p_spudec->iconv_handle, &psz_convert_buffer_in, &inbytes_left, &psz_convert_buffer_out, &outbytes_left ); 
     85    *psz_convert_buffer_out = '\0'; 
     86    if( inbytes_left ) 
     87    { 
     88        msg_Warn( p_spudec->p_fifo, "Something fishy happened during conversion" ); 
     89    } 
     90    else 
     91    { 
     92        msg_Dbg( p_spudec->p_fifo, "reencoded \"%s\" into \"%s\"", psz_subtitle, psz_new_subtitle ); 
     93        vout_ShowTextAbsolute( p_spudec->p_vout, psz_new_subtitle, NULL,  
     94                   OSD_ALIGN_BOTTOM|OSD_ALIGN_LEFT, 20, 20,  
     95                   i_pts, i_dts ); 
     96    } 
     97    free( psz_new_subtitle ); 
     98#else 
     99    vout_ShowTextAbsolute( p_spudec->p_vout, psz_subtitle, NULL,  
     100                   OSD_ALIGN_BOTTOM|OSD_ALIGN_LEFT, 20, 20,  
     101                   i_pts, i_dts ); 
     102#endif 
     103#if 0 
    77104        subtitler_PlotSubtitle( p_spudec->p_vout, 
    78105                                psz_subtitle, p_font, 
    79106                                i_pts, 
    80107                                i_dts ); 
     108#endif 
    81109    } 
    82110 
     
    85113     * for b_die and b_error */ 
    86114    NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream ); 
    87 #else 
    88     msleep(10); 
    89 #endif 
    90115} 
  • modules/control/lirc/lirc.c

    ra1e8137 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: lirc.c,v 1.6 2003/03/30 18:14:37 gbazin Exp $ 
     5 * $Id: lirc.c,v 1.7 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> 
     
    371371static void Feedback( intf_thread_t *p_intf, char *psz_string ) 
    372372{ 
    373         vlc_value_t val, lockval; 
    374     if ( p_intf->p_sys->p_vout 
    375          && var_Get( p_intf->p_sys->p_vout, "lock", &lockval ) == VLC_SUCCESS ) 
    376     { 
    377         vlc_mutex_lock( lockval.p_address ); 
    378         val.i_int = OSD_ALIGN_RIGHT|OSD_ALIGN_BOTTOM; 
    379         var_Set( p_intf->p_sys->p_vout, "flags", val );  
    380         val.i_int = 400000; 
    381         var_Set( p_intf->p_sys->p_vout, "duration", val );  
    382         val.i_int = 30; 
    383         var_Set( p_intf->p_sys->p_vout, "x-margin", val );  
    384         val.i_int = 20; 
    385         var_Set( p_intf->p_sys->p_vout, "y-margin", val ); 
    386         val.psz_string = psz_string; 
    387         var_Set( p_intf->p_sys->p_vout, "string", val ); 
    388         vlc_mutex_unlock( lockval.p_address ); 
    389     } 
    390     else 
    391     { 
    392         msg_Dbg( p_intf, psz_string ); 
     373    if ( p_intf->p_sys->p_vout ) 
     374    { 
     375    vout_ShowTextRelative( p_intf->p_sys->p_vout, psz_string, NULL,  
     376                 OSD_ALIGN_TOP|OSD_ALIGN_RIGHT, 30,20,400000 ); 
    393377    } 
    394378} 
  • modules/demux/util/sub.c

    rfee9cb8 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: sub.c,v 1.16 2003/06/26 18:14:56 sam Exp $ 
     5 * $Id: sub.c,v 1.17 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    2222 *****************************************************************************/ 
    2323 
    24 /* define USE_FREETYPE to use freetype for subtitles */ 
    25  
    2624/***************************************************************************** 
    2725 * Preamble 
     
    3432#include <vlc/vlc.h> 
    3533#include <vlc/input.h> 
    36 #if defined(USE_FREETYPE) 
    37 #include <osd.h> 
    38 #endif 
    3934#include "vlc_video.h" 
    4035 
     
    448443static int  sub_demux( subtitle_demux_t *p_sub, mtime_t i_maxdate ) 
    449444{ 
    450 #if defined(USE_FREETYPE) 
    451     vlc_object_t *p_vout = NULL; 
    452 #endif 
    453445    if( p_sub->p_es->p_decoder_fifo && !p_sub->i_previously_selected ) 
    454446    { 
     
    470462 
    471463        int i_len; 
    472 #if defined(USE_FREETYPE) 
    473         p_vout = vlc_object_find( p_sub, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 
    474 #endif 
    475464 
    476465        i_len = strlen( p_sub->subtitle[p_sub->i_subtitle].psz_text ) + 1; 
     
    515504            p_pes->i_dts = 0; 
    516505        } 
    517 #if defined(USE_FREETYPE) 
    518         if( p_vout ) 
    519         { 
    520             vlc_value_t val, lockval; 
    521             if( var_Get( p_vout, "lock", &lockval ) == VLC_SUCCESS ) 
    522             { 
    523                 int64_t i_tmp; 
    524                 vlc_mutex_lock( lockval.p_address ); 
    525                 msg_Dbg( p_sub, "pts "I64Fd" dts " I64Fd, p_pes->i_pts, 
    526                          p_pes->i_dts ); 
    527                 i_tmp = p_pes->i_dts - p_pes->i_pts; 
    528                 val.i_int = OSD_ALIGN_LEFT|OSD_ALIGN_BOTTOM; 
    529                 var_Set( p_vout, "flags", val );  
    530                 val.time.i_low = (int)(p_pes->i_pts+p_sub->p_input->i_pts_delay); 
    531                 val.time.i_high = (int)( p_pes->i_pts >> 32 ); 
    532                 var_Set( p_vout, "start-date", val );  
    533                 val.time.i_low = (int)(p_pes->i_dts + p_sub->p_input->i_pts_delay); 
    534                 val.time.i_high = (int)( p_pes->i_dts >> 32 ); 
    535                 var_Set( p_vout, "stop-date", val );  
    536                 val.i_int = 20; 
    537                 var_Set( p_vout, "x-margin", val );  
    538                 val.i_int = 20; 
    539                 var_Set( p_vout, "y-margin", val ); 
    540                 val.psz_string = p_sub->subtitle[p_sub->i_subtitle].psz_text; 
    541                 var_Set( p_vout, "string", val ); 
    542                 vlc_mutex_unlock( lockval.p_address ); 
    543             } 
    544         } 
    545 #endif 
     506 
    546507        p_pes->i_nb_data = 1; 
    547508        p_pes->p_first = 
     
    564525        p_sub->i_subtitle++; 
    565526    } 
    566 #if defined(USE_FREETYPE) 
    567     if ( p_vout ) 
    568     { 
    569         vlc_object_release( p_vout ); 
    570     } 
    571 #endif 
    572527    return( 0 ); 
    573528} 
  • modules/misc/Modules.am

    rfe17002 r14b3f0c  
    66SOURCES_screensaver = screensaver.c 
    77SOURCES_qte_main = qte_main.cpp 
     8SOURCES_freetype = freetype.c 
    89SOURCES_httpd = httpd.c 
  • modules/misc/dummy/Modules.am

    rfe17002 r14b3f0c  
    77    input.c \ 
    88    decoder.c \ 
     9    renderer.c \ 
    910    $(NULL) 
    1011 
  • modules/misc/dummy/dummy.c

    r0f0a0c6 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001 VideoLAN 
    5  * $Id: dummy.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $ 
     5 * $Id: dummy.c,v 1.9 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    8181        add_category_hint( N_("Video"), NULL, VLC_FALSE ); 
    8282        add_string( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, VLC_FALSE ); 
     83    add_submodule(); 
     84        set_description( _("dummy font renderer function") ); 
     85        set_capability( "text renderer", 1 ); 
     86        set_callbacks( E_(OpenRenderer), NULL ); 
    8387vlc_module_end(); 
    8488 
  • modules/misc/dummy/dummy.h

    r19ea8fe r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001, 2002 VideoLAN 
    5  * $Id: dummy.h,v 1.1 2002/08/04 17:23:43 sam Exp $ 
     5 * $Id: dummy.h,v 1.2 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    3838int  E_(OpenVideo)    ( vlc_object_t * ); 
    3939 
     40int E_(OpenRenderer)  ( vlc_object_t * ); 
  • modules/video_filter/Modules.am

    r79ddd26 r14b3f0c  
    77SOURCES_crop = crop.c 
    88SOURCES_motionblur = motionblur.c 
    9 SOURCES_osdtext = osd_text.c 
    109SOURCES_logo = logo.c 
    1110noinst_HEADERS += filter_common.h 
  • src/misc/modules.c

    r1122ff8 r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules.c,v 1.124 2003/07/01 12:56:47 sam Exp $ 
     5 * $Id: modules.c,v 1.125 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    8888#include "stream_output.h" 
    8989#include "announce.h" 
     90#include "osd.h" 
    9091 
    9192#include "iso_lang.h" 
  • src/video_output/video_output.c

    r2d80aa6 r14b3f0c  
    66 ***************************************************************************** 
    77 * Copyright (C) 2000-2001 VideoLAN 
    8  * $Id: video_output.c,v 1.228 2003/06/28 21:18:58 fenrir Exp $ 
     8 * $Id: video_output.c,v 1.229 2003/07/14 21:32:59 sigmunau Exp $ 
    99 * 
    1010 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    383383        return NULL; 
    384384    } 
    385  
     385    p_vout->p_text_renderer_module = module_Need( p_vout, "text renderer",  
     386                          NULL ); 
     387    if( p_vout->p_text_renderer_module == NULL ) 
     388    { 
     389    msg_Warn( p_vout, "no suitable text renderer module" ); 
     390    p_vout->pf_add_string = NULL; 
     391    } 
    386392    /* Create a few object variables for interface interaction */ 
    387393    var_Create( p_vout, "fullscreen", VLC_VAR_BOOL ); 
     
    10111017        module_Unneed( p_vout, p_vout->chroma.p_module ); 
    10121018    } 
    1013  
     1019     
    10141020    /* Destroy all remaining pictures */ 
    10151021    for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++ ) 
     
    10311037    } 
    10321038 
     1039    module_Unneed( p_vout, p_vout->p_text_renderer_module ); 
     1040     
    10331041    /* Destroy translation tables */ 
    10341042    p_vout->pf_end( p_vout ); 
  • src/video_output/video_text.c

    r51c3c7d r14b3f0c  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: video_text.c,v 1.43 2003/06/26 12:19:59 sam Exp $ 
     5 * $Id: video_text.c,v 1.44 2003/07/14 21:32:59 sigmunau Exp $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    2222 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. 
    2323 *****************************************************************************/ 
     24#include <vlc/vout.h> 
     25 
     26/** 
     27 * \brief Show text on the video for some time 
     28 * \param p_vout pointer to the vout the text is to be showed on 
     29 * \param psz_string The text to be shown 
     30 * \param p_style Pointer to a struct with text style info 
     31 * \param i_flags flags for alignment and such 
     32 * \param i_hmargin horizontal margin in pixels 
     33 * \param i_vmargin vertical margin in pixels 
     34 * \param i_duration Amount of time the text is to be shown. 
     35 */ 
     36void vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string,  
     37                  text_style_t *p_style, int i_flags,  
     38                  int i_hmargin, int i_vmargin,  
     39                  mtime_t i_duration ) 
     40{ 
     41    mtime_t i_now = mdate(); 
     42    if ( p_vout->pf_add_string ) 
     43    { 
     44    p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin, 
     45                   i_vmargin, i_now, i_now + i_duration ); 
     46    } 
     47    else 
     48    { 
     49    msg_Warn( p_vout, "No text renderer found" ); 
     50    } 
     51} 
     52 
     53/** 
     54 * \brief Show text on the video from a given start date to a given end date 
     55 * \param p_vout pointer to the vout the text is to be showed on 
     56 * \param psz_string The text to be shown 
     57 * \param p_style Pointer to a struct with text style info 
     58 * \param i_flags flags for alignment and such 
     59 * \param i_hmargin horizontal margin in pixels 
     60 * \param i_vmargin vertical margin in pixels 
     61 * \param i_start the time when this string is to appear on the video 
     62 * \param i_stop the time when this string should stop to be displayed 
     63 *               if this is 0 the string will be shown untill the next string 
     64 *               is about to be shown 
     65 */ 
     66void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string,  
     67                  text_style_t *p_style, int i_flags,  
     68                  int i_hmargin, int i_vmargin, mtime_t i_start,  
     69                  mtime_t i_stop ) 
     70{ 
     71    if ( p_vout->pf_add_string ) 
     72    { 
     73    p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin, 
     74                   i_vmargin, i_start, i_stop ); 
     75    } 
     76    else 
     77    { 
     78    msg_Warn( p_vout, "No text renderer found" ); 
     79    } 
     80} 
     81 
     82 
     83 
    2484 
    2585/* XXX: unused */