Commit fb0afd83 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Lower the priority of the SVG renderer

* Make the "text renderer" selectable with --text-renderer
fixes #627

Lol, totally forgot to commit this last night :D
parent 4f90955a
......@@ -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 );
......
......@@ -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,
......
......@@ -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,9 +513,20 @@ 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;
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 )
{
if( p_subpic->i_original_picture_height > 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment