Commit 364f9dc2 authored by Laurent Aimar's avatar Laurent Aimar

Allowed to give the list of prefered chroma to "text renderer".

parent 717110af
...@@ -125,9 +125,11 @@ struct filter_t ...@@ -125,9 +125,11 @@ struct filter_t
struct struct
{ {
int (*pf_text) ( filter_t *, subpicture_region_t *, int (*pf_text) ( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t *,
const vlc_fourcc_t * );
int (*pf_html) ( filter_t *, subpicture_region_t *, int (*pf_html) ( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t *,
const vlc_fourcc_t * );
} render; } render;
#define pf_render_text u.render.pf_text #define pf_render_text u.render.pf_text
#define pf_render_html u.render.pf_html #define pf_render_html u.render.pf_html
......
...@@ -869,7 +869,7 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string, ...@@ -869,7 +869,7 @@ static picture_t *RenderText( intf_thread_t *p_intf, const char *psz_string,
memset( &fmt_out, 0, sizeof(video_format_t) ); memset( &fmt_out, 0, sizeof(video_format_t) );
p_sys->p_text->pf_render_text( p_sys->p_text, p_sys->p_text->pf_render_text( p_sys->p_text,
p_region, p_region ); p_region, p_region, NULL );
#if defined(FBOSD_BLENDING) #if defined(FBOSD_BLENDING)
fmt_out = p_region->fmt; fmt_out = p_region->fmt;
......
...@@ -31,8 +31,14 @@ ...@@ -31,8 +31,14 @@
#include "dummy.h" #include "dummy.h"
static int RenderText( filter_t *, subpicture_region_t *, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t * ); subpicture_region_t *p_region_in,
const vlc_fourcc_t *p_chroma_list )
{
VLC_UNUSED(p_filter); VLC_UNUSED(p_region_out); VLC_UNUSED(p_region_in);
VLC_UNUSED(p_chroma_list);
return VLC_EGENERIC;
}
int OpenRenderer( vlc_object_t *p_this ) int OpenRenderer( vlc_object_t *p_this )
{ {
...@@ -42,9 +48,3 @@ int OpenRenderer( vlc_object_t *p_this ) ...@@ -42,9 +48,3 @@ int OpenRenderer( vlc_object_t *p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in )
{
VLC_UNUSED(p_filter); VLC_UNUSED(p_region_out); VLC_UNUSED(p_region_in);
return VLC_EGENERIC;
}
...@@ -2333,16 +2333,20 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -2333,16 +2333,20 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
} }
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const video_format_t *p_chroma_list )
{ {
VLC_UNUSED( p_chroma_list );
return RenderCommon( p_filter, p_region_out, p_region_in, false ); return RenderCommon( p_filter, p_region_out, p_region_in, false );
} }
#ifdef HAVE_STYLES #ifdef HAVE_STYLES
static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const video_format_t *p_chroma_list )
{ {
VLC_UNUSED( p_chroma_list );
return RenderCommon( p_filter, p_region_out, p_region_in, true ); return RenderCommon( p_filter, p_region_out, p_region_in, true );
} }
......
...@@ -66,9 +66,11 @@ static void Destroy( vlc_object_t * ); ...@@ -66,9 +66,11 @@ static void Destroy( vlc_object_t * );
static int LoadFontsFromAttachments( filter_t *p_filter ); static int LoadFontsFromAttachments( filter_t *p_filter );
static int RenderText( filter_t *, subpicture_region_t *, static int RenderText( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t *,
const vlc_fourcc_t * );
static int RenderHtml( filter_t *, subpicture_region_t *, static int RenderHtml( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t *,
const vlc_fourcc_t * );
static int GetFontSize( filter_t *p_filter ); static int GetFontSize( filter_t *p_filter );
static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region, static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
...@@ -308,7 +310,8 @@ static char *EliminateCRLF( char *psz_string ) ...@@ -308,7 +310,8 @@ static char *EliminateCRLF( char *psz_string )
// Renders a text subpicture region into another one. // Renders a text subpicture region into another one.
// It is used as pf_add_string callback in the vout method by this module // It is used as pf_add_string callback in the vout method by this module
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const vlc_fourcc_t *p_chroma_list )
{ {
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
char *psz_string; char *psz_string;
...@@ -768,7 +771,8 @@ static int ProcessNodes( filter_t *p_filter, ...@@ -768,7 +771,8 @@ static int ProcessNodes( filter_t *p_filter,
} }
static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const vlc_fourcc_t *p_chroma_list )
{ {
int rv = VLC_SUCCESS; int rv = VLC_SUCCESS;
stream_t *p_sub = NULL; stream_t *p_sub = NULL;
......
...@@ -55,7 +55,8 @@ typedef struct svg_rendition_t svg_rendition_t; ...@@ -55,7 +55,8 @@ typedef struct svg_rendition_t svg_rendition_t;
static int Create ( vlc_object_t * ); static int Create ( vlc_object_t * );
static void Destroy ( vlc_object_t * ); static void Destroy ( vlc_object_t * );
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ); subpicture_region_t *p_region_in,
const vlc_fourcc_t * );
static char *svg_GetTemplate( vlc_object_t *p_this ); static char *svg_GetTemplate( vlc_object_t *p_this );
/***************************************************************************** /*****************************************************************************
...@@ -428,7 +429,8 @@ static void svg_RenderPicture( filter_t *p_filter, ...@@ -428,7 +429,8 @@ static void svg_RenderPicture( filter_t *p_filter,
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const vlc_fourcc_t *p_chroma_list )
{ {
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
svg_rendition_t *p_svg = NULL; svg_rendition_t *p_svg = NULL;
......
...@@ -47,7 +47,8 @@ static void Destroy( vlc_object_t * ); ...@@ -47,7 +47,8 @@ static void Destroy( vlc_object_t * );
/* The RenderText call maps to pf_render_string, defined in vlc_filter.h */ /* The RenderText call maps to pf_render_string, defined in vlc_filter.h */
static int RenderText( filter_t *, subpicture_region_t *, static int RenderText( filter_t *, subpicture_region_t *,
subpicture_region_t * ); subpicture_region_t *,
const vlc_fourcc_t * );
static int Render( filter_t *, subpicture_region_t *, uint8_t *, int, int); static int Render( filter_t *, subpicture_region_t *, uint8_t *, int, int);
static int SetFont( filter_t *, int ); static int SetFont( filter_t *, int );
...@@ -296,7 +297,8 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region, ...@@ -296,7 +297,8 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
} }
static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
subpicture_region_t *p_region_in ) subpicture_region_t *p_region_in,
const vlc_fourcc_t *p_chroma_list )
{ {
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
int i_font_color, i_font_alpha, i_font_size; int i_font_color, i_font_alpha, i_font_size;
......
...@@ -257,6 +257,7 @@ static filter_t *SpuRenderCreateAndLoadScale(vlc_object_t *object, ...@@ -257,6 +257,7 @@ static filter_t *SpuRenderCreateAndLoadScale(vlc_object_t *object,
static void SpuRenderText(spu_t *spu, bool *rerender_text, static void SpuRenderText(spu_t *spu, bool *rerender_text,
subpicture_region_t *region, subpicture_region_t *region,
const vlc_fourcc_t *chroma_list,
mtime_t elapsed_time) mtime_t elapsed_time)
{ {
filter_t *text = spu->p->text; filter_t *text = spu->p->text;
...@@ -289,9 +290,9 @@ static void SpuRenderText(spu_t *spu, bool *rerender_text, ...@@ -289,9 +290,9 @@ static void SpuRenderText(spu_t *spu, bool *rerender_text,
var_SetBool(text, "text-rerender", false); var_SetBool(text, "text-rerender", false);
if (text->pf_render_html && region->psz_html) if (text->pf_render_html && region->psz_html)
text->pf_render_html(text, region, region); text->pf_render_html(text, region, region, chroma_list);
else if (text->pf_render_text) else if (text->pf_render_text)
text->pf_render_text(text, region, region); text->pf_render_text(text, region, region, chroma_list);
*rerender_text = var_GetBool(text, "text-rerender"); *rerender_text = var_GetBool(text, "text-rerender");
} }
...@@ -691,6 +692,7 @@ static void SpuRenderRegion(spu_t *spu, ...@@ -691,6 +692,7 @@ static void SpuRenderRegion(spu_t *spu,
/* Render text region */ /* Render text region */
if (region->fmt.i_chroma == VLC_CODEC_TEXT) { if (region->fmt.i_chroma == VLC_CODEC_TEXT) {
SpuRenderText(spu, &restore_text, region, SpuRenderText(spu, &restore_text, region,
chroma_list,
render_date - subpic->i_start); render_date - subpic->i_start);
/* Check if the rendering has failed ... */ /* Check if the rendering has failed ... */
......
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