Changeset 14b3f0cfa16fa0147dafd44b64bf94403a0095fb
- Timestamp:
- 14/07/03 23:32:59 (5 years ago)
- git-parent:
- Files:
-
- configure.ac (modified) (2 diffs)
- include/osd.h (modified) (2 diffs)
- include/video_output.h (modified) (4 diffs)
- modules/codec/spudec/spudec.c (modified) (5 diffs)
- modules/codec/spudec/spudec.h (modified) (3 diffs)
- modules/codec/spudec/text.c (modified) (6 diffs)
- modules/control/lirc/lirc.c (modified) (2 diffs)
- modules/demux/util/sub.c (modified) (7 diffs)
- modules/misc/Modules.am (modified) (1 diff)
- modules/misc/dummy/Modules.am (modified) (1 diff)
- modules/misc/dummy/dummy.c (modified) (2 diffs)
- modules/misc/dummy/dummy.h (modified) (2 diffs)
- modules/misc/freetype.c (added)
- modules/video_filter/Modules.am (modified) (1 diff)
- modules/video_filter/osd_text.c (deleted)
- src/misc/modules.c (modified) (2 diffs)
- src/video_output/video_output.c (modified) (4 diffs)
- src/video_output/video_text.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
configure.ac
rd46bb4f r14b3f0c 1 1 dnl Autoconf settings for vlc 2 dnl $Id: configure.ac,v 1. 29 2003/07/14 16:10:20 gbazinExp $2 dnl $Id: configure.ac,v 1.30 2003/07/14 21:32:58 sigmunau Exp $ 3 3 4 4 AC_INIT(vlc,0.6.0) … … 2130 2130 if test "${FREETYPE_CONFIG}" != "no" 2131 2131 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`]) 2135 2135 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_freetype}" 2136 2136 elif test "${enable_freetype}" = "yes" include/osd.h
rb5d99c6 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2003 VideoLAN 5 * $Id: osd.h,v 1. 1 2003/03/23 16:38:40sigmunau Exp $5 * $Id: osd.h,v 1.2 2003/07/14 21:32:58 sigmunau Exp $ 6 6 * 7 7 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> … … 26 26 #define OSD_ALIGN_TOP 0 27 27 #define OSD_ALIGN_BOTTOM 0x2 28 struct 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 }; 36 static const text_style_t default_text_style = { 22, 0xffffff, VLC_FALSE, VLC_FALSE, VLC_FALSE }; 37 38 VLC_EXPORT( void, vout_ShowTextRelative, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t ) ); 39 VLC_EXPORT( void, vout_ShowTextAbsolute, ( vout_thread_t *, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) ); include/video_output.h
rc302e98 r14b3f0c 6 6 ***************************************************************************** 7 7 * Copyright (C) 1999, 2000 VideoLAN 8 * $Id: video_output.h,v 1.9 5 2003/06/09 00:33:34 massiotExp $8 * $Id: video_output.h,v 1.96 2003/07/14 21:32:58 sigmunau Exp $ 9 9 * 10 10 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 51 51 } vout_chroma_t; 52 52 53 /** ***************************************************************************54 * vout_thread_t:video output thread descriptor55 * ****************************************************************************53 /** 54 * \brief video output thread descriptor 55 * 56 56 * Any independant video output device, such as an X11 window or a GGI device, 57 57 * is represented by a video output thread, and described using the following 58 58 * structure. 59 * ****************************************************************************/59 */ 60 60 struct vout_thread_t 61 61 { 62 62 VLC_COMMON_MEMBERS 63 63 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 /**@{*/ 84 89 module_t * p_module; 85 90 int ( *pf_init ) ( vout_thread_t * ); … … 88 93 void ( *pf_render ) ( vout_thread_t *, picture_t * ); 89 94 void ( *pf_display ) ( vout_thread_t *, picture_t * ); 95 /**@}*/ 90 96 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 92 99 * 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 /**@}*/ 95 104 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 /**@}*/ 102 113 103 114 /* 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 */ 110 117 111 118 /* 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 */ 118 126 int i_pts_delay; 119 127 … … 121 129 char *psz_filter_chain; 122 130 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 */ 123 138 }; 124 139 modules/codec/spudec/spudec.c
rcae8721 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: spudec.c,v 1. 19 2003/06/12 22:27:35 massiotExp $5 * $Id: spudec.c,v 1.20 2003/07/14 21:32:58 sigmunau Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 53 53 #define DEFAULT_FONT "font-eutopiabold21.rle" 54 54 55 #define ENCODING_TEXT N_("subtitle text encoding") 56 #define ENCODING_LONGTEXT N_("change the encoding used in text subtitles") 57 55 58 vlc_module_begin(); 56 59 add_category_hint( N_("subtitles"), NULL, VLC_TRUE ); … … 63 66 FONT_TEXT, FONT_LONGTEXT, VLC_TRUE ); 64 67 #endif 68 #if defined(HAVE_ICONV) 69 add_string( "spudec-encoding", "ISO-8859-1", NULL, ENCODING_TEXT, 70 ENCODING_LONGTEXT, VLC_FALSE ); 71 #endif 65 72 set_description( _("subtitles decoder") ); 66 73 set_capability( "decoder", 50 ); … … 152 159 } 153 160 #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 155 168 while( (!p_spudec->p_fifo->b_die) && (!p_spudec->p_fifo->b_error) ) 156 169 { … … 325 338 } 326 339 } 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 328 346 CloseBitstream( &p_spudec->bit_stream ); 329 347 free( p_spudec ); modules/codec/spudec/spudec.h
rade615b r14b3f0c 1 1 2 /***************************************************************************** 2 3 * spudec.h : sub picture unit decoder thread interface 3 4 ***************************************************************************** 4 5 * Copyright (C) 1999, 2000 VideoLAN 5 * $Id: spudec.h,v 1. 5 2002/12/06 16:34:05 samExp $6 * $Id: spudec.h,v 1.6 2003/07/14 21:32:58 sigmunau Exp $ 6 7 * 7 8 * Authors: Samuel Hocevar <sam@zoy.org> … … 21 22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 22 23 *****************************************************************************/ 24 25 #if defined(HAVE_ICONV) 26 #include <iconv.h> 27 #endif 28 23 29 24 30 typedef struct spudec_thread_t spudec_thread_t; … … 84 90 unsigned int i_spu_size; /* size of current SPU packet */ 85 91 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 86 95 }; 87 96 modules/codec/spudec/text.c
r3a52126 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2001 VideoLAN 5 * $Id: text.c,v 1. 5 2003/05/11 14:33:32sigmunau Exp $5 * $Id: text.c,v 1.6 2003/07/14 21:32:58 sigmunau Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 22 22 *****************************************************************************/ 23 23 24 /* define USE_FREETYPE here to disable the old style subtitles */25 24 26 25 /***************************************************************************** … … 33 32 #include <vlc/vout.h> 34 33 #include <vlc/decoder.h> 34 #include <osd.h> 35 35 36 36 #include "spudec.h" … … 45 45 void E_(ParseText)( spudec_thread_t *p_spudec, subtitler_font_t *p_font ) 46 46 { 47 #if !defined(USE_FREETYPE)48 47 char * psz_subtitle; 49 48 mtime_t i_pts, i_dts; … … 75 74 if( psz_subtitle[0] != '\0' ) 76 75 { 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 77 104 subtitler_PlotSubtitle( p_spudec->p_vout, 78 105 psz_subtitle, p_font, 79 106 i_pts, 80 107 i_dts ); 108 #endif 81 109 } 82 110 … … 85 113 * for b_die and b_error */ 86 114 NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream ); 87 #else88 msleep(10);89 #endif90 115 } modules/control/lirc/lirc.c
ra1e8137 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: lirc.c,v 1. 6 2003/03/30 18:14:37 gbazinExp $5 * $Id: lirc.c,v 1.7 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> … … 371 371 static void Feedback( intf_thread_t *p_intf, char *psz_string ) 372 372 { 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 ); 393 377 } 394 378 } modules/demux/util/sub.c
rfee9cb8 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: sub.c,v 1.1 6 2003/06/26 18:14:56 samExp $5 * $Id: sub.c,v 1.17 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Laurent Aimar <fenrir@via.ecp.fr> … … 22 22 *****************************************************************************/ 23 23 24 /* define USE_FREETYPE to use freetype for subtitles */25 26 24 /***************************************************************************** 27 25 * Preamble … … 34 32 #include <vlc/vlc.h> 35 33 #include <vlc/input.h> 36 #if defined(USE_FREETYPE)37 #include <osd.h>38 #endif39 34 #include "vlc_video.h" 40 35 … … 448 443 static int sub_demux( subtitle_demux_t *p_sub, mtime_t i_maxdate ) 449 444 { 450 #if defined(USE_FREETYPE)451 vlc_object_t *p_vout = NULL;452 #endif453 445 if( p_sub->p_es->p_decoder_fifo && !p_sub->i_previously_selected ) 454 446 { … … 470 462 471 463 int i_len; 472 #if defined(USE_FREETYPE)473 p_vout = vlc_object_find( p_sub, VLC_OBJECT_VOUT, FIND_ANYWHERE );474 #endif475 464 476 465 i_len = strlen( p_sub->subtitle[p_sub->i_subtitle].psz_text ) + 1; … … 515 504 p_pes->i_dts = 0; 516 505 } 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 546 507 p_pes->i_nb_data = 1; 547 508 p_pes->p_first = … … 564 525 p_sub->i_subtitle++; 565 526 } 566 #if defined(USE_FREETYPE)567 if ( p_vout )568 {569 vlc_object_release( p_vout );570 }571 #endif572 527 return( 0 ); 573 528 } modules/misc/Modules.am
rfe17002 r14b3f0c 6 6 SOURCES_screensaver = screensaver.c 7 7 SOURCES_qte_main = qte_main.cpp 8 SOURCES_freetype = freetype.c 8 9 SOURCES_httpd = httpd.c modules/misc/dummy/Modules.am
rfe17002 r14b3f0c 7 7 input.c \ 8 8 decoder.c \ 9 renderer.c \ 9 10 $(NULL) 10 11 modules/misc/dummy/dummy.c
r0f0a0c6 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: dummy.c,v 1. 8 2003/06/17 16:09:16 gbazinExp $5 * $Id: dummy.c,v 1.9 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 81 81 add_category_hint( N_("Video"), NULL, VLC_FALSE ); 82 82 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 ); 83 87 vlc_module_end(); 84 88 modules/misc/dummy/dummy.h
r19ea8fe r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001, 2002 VideoLAN 5 * $Id: dummy.h,v 1. 1 2002/08/04 17:23:43 samExp $5 * $Id: dummy.h,v 1.2 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 38 38 int E_(OpenVideo) ( vlc_object_t * ); 39 39 40 int E_(OpenRenderer) ( vlc_object_t * ); modules/video_filter/Modules.am
r79ddd26 r14b3f0c 7 7 SOURCES_crop = crop.c 8 8 SOURCES_motionblur = motionblur.c 9 SOURCES_osdtext = osd_text.c10 9 SOURCES_logo = logo.c 11 10 noinst_HEADERS += filter_common.h src/misc/modules.c
r1122ff8 r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001 VideoLAN 5 * $Id: modules.c,v 1.12 4 2003/07/01 12:56:47 samExp $5 * $Id: modules.c,v 1.125 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 88 88 #include "stream_output.h" 89 89 #include "announce.h" 90 #include "osd.h" 90 91 91 92 #include "iso_lang.h" src/video_output/video_output.c
r2d80aa6 r14b3f0c 6 6 ***************************************************************************** 7 7 * Copyright (C) 2000-2001 VideoLAN 8 * $Id: video_output.c,v 1.22 8 2003/06/28 21:18:58 fenrirExp $8 * $Id: video_output.c,v 1.229 2003/07/14 21:32:59 sigmunau Exp $ 9 9 * 10 10 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 383 383 return NULL; 384 384 } 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 } 386 392 /* Create a few object variables for interface interaction */ 387 393 var_Create( p_vout, "fullscreen", VLC_VAR_BOOL ); … … 1011 1017 module_Unneed( p_vout, p_vout->chroma.p_module ); 1012 1018 } 1013 1019 1014 1020 /* Destroy all remaining pictures */ 1015 1021 for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++ ) … … 1031 1037 } 1032 1038 1039 module_Unneed( p_vout, p_vout->p_text_renderer_module ); 1040 1033 1041 /* Destroy translation tables */ 1034 1042 p_vout->pf_end( p_vout ); src/video_output/video_text.c
r51c3c7d r14b3f0c 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: video_text.c,v 1.4 3 2003/06/26 12:19:59 samExp $5 * $Id: video_text.c,v 1.44 2003/07/14 21:32:59 sigmunau Exp $ 6 6 * 7 7 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 22 22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 23 23 *****************************************************************************/ 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 */ 36 void 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 */ 66 void 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 24 84 25 85 /* XXX: unused */
