]> git.sesse.net Git - vlc/commitdiff
* Lower the priority of the SVG renderer
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 7 Apr 2006 12:19:01 +0000 (12:19 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 7 Apr 2006 12:19:01 +0000 (12:19 +0000)
* Make the "text renderer" selectable with --text-renderer
fixes #627

Lol, totally forgot to commit this last night :D

modules/misc/svg.c
src/libvlc.h
src/video_output/vout_subpictures.c

index e6038262916bb7de8b35ac13b395456d00bb078e..0abff45b256a4eb86243912859863ff6c6ce8d99 100644 (file)
@@ -69,7 +69,7 @@ static int  RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 vlc_module_begin();
  set_category( CAT_INPUT);
  set_category( SUBCAT_INPUT_SCODEC );
- set_capability( "text renderer", 101 );
+ set_capability( "text renderer", 99 );
  add_shortcut( "svg" );
  add_string( "svg-template-file", "", NULL, TEMPLATE_TEXT, TEMPLATE_LONGTEXT, VLC_TRUE );
  set_callbacks( Create, Destroy );
index 8e2b209f8f5f99a36546d12c385aa7933362f725..a6d8a885a2ce24c4f9c3099ae9a1961083b98cef 100644 (file)
@@ -497,6 +497,10 @@ static char *ppsz_clock_descriptions[] =
     "VLC can display messages on the video. This is called OSD (On Screen " \
     "Display).")
 
+#define TEXTRENDERER_TEXT N_("Text rendering module")
+#define TEXTRENDERER_LONGTEXT N_( \
+    "VLC normally uses Freetype for rendering, but this allows you to use svg for instance.")
+
 #define SUB_FILTER_TEXT N_("Subpictures filter module")
 #define SUB_FILTER_LONGTEXT N_( \
     "This adds so-called \"subpicture filters\". These filters overlay " \
@@ -1217,6 +1221,8 @@ vlc_module_begin();
 
     add_bool( "spu", 1, NULL, SPU_TEXT, SPU_LONGTEXT, VLC_TRUE );
     add_bool( "osd", 1, NULL, OSD_TEXT, OSD_LONGTEXT, VLC_FALSE );
+    add_module( "text-renderer", "text renderer", NULL, NULL, TEXTRENDERER_TEXT,
+                TEXTRENDERER_LONGTEXT, VLC_TRUE );
 
     set_section( N_("Subtitles") , NULL );
     add_file( "sub-file", NULL, NULL, SUB_FILE_TEXT,
index e0f1dd03dd9d4fec4125b10ae7d2665882d635d0..6bc5039ace5157d4bd29c6a9ca03f03ef16cbcf9 100644 (file)
@@ -499,6 +499,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
         /* Load the text rendering module */
         if( !p_spu->p_text && p_region )
         {
+            char *psz_modulename = NULL;
+
             p_spu->p_text = vlc_object_create( p_spu, VLC_OBJECT_FILTER );
             vlc_object_attach( p_spu->p_text, p_spu );
 
@@ -511,8 +513,19 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
 
             p_spu->p_text->pf_sub_buffer_new = spu_new_buffer;
             p_spu->p_text->pf_sub_buffer_del = spu_del_buffer;
-            p_spu->p_text->p_module =
-                module_Need( p_spu->p_text, "text renderer", 0, 0 );
+
+            psz_modulename = var_CreateGetString( p_spu, "text-renderer" );
+            if( psz_modulename && *psz_modulename )
+            {
+                p_spu->p_text->p_module =
+                    module_Need( p_spu->p_text, "text renderer", psz_modulename, VLC_TRUE );
+            }
+            if( !p_spu->p_text->p_module )
+            {
+                p_spu->p_text->p_module =
+                    module_Need( p_spu->p_text, "text renderer", 0, 0 );
+            }
+            if( psz_modulename ) free( psz_modulename );
         }
         else if( p_region )
         {