]> git.sesse.net Git - vlc/commitdiff
Allowed to give the list of prefered chroma to "text renderer".
authorLaurent Aimar <fenrir@videolan.org>
Sat, 25 Jun 2011 18:11:03 +0000 (20:11 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 25 Jun 2011 18:11:03 +0000 (20:11 +0200)
include/vlc_filter.h
modules/gui/fbosd.c
modules/misc/dummy/renderer.c
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/quartztext.c
modules/misc/text_renderer/svg.c
modules/misc/text_renderer/win32text.c
src/video_output/vout_subpictures.c

index f7b536d3f3812f842200fcb33e349740beb2f590..c2ec30f8174d357323b378fe8f7a88231dd626aa 100644 (file)
@@ -125,9 +125,11 @@ struct filter_t
         struct
         {
             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 *,
-                                     subpicture_region_t * );
+                                     subpicture_region_t *,
+                                     const vlc_fourcc_t * );
         } render;
 #define pf_render_text     u.render.pf_text
 #define pf_render_html     u.render.pf_html
index 35c139d34455e5bd42f0e1338b6f946e4573712c..375d89505740180123cda956b8c5ba6737f30bd1 100644 (file)
@@ -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) );
 
             p_sys->p_text->pf_render_text( p_sys->p_text,
-                                           p_region, p_region );
+                                           p_region, p_region, NULL );
 
 #if defined(FBOSD_BLENDING)
             fmt_out = p_region->fmt;
index 75c76932c31c901b9064bfcbae05ec08b3505250..219cef746e046952420c01aeed5a145ad8b679ad 100644 (file)
 
 #include "dummy.h"
 
-static int RenderText( filter_t *, subpicture_region_t *,
-                       subpicture_region_t * );
+static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
+                       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 )
 {
@@ -42,9 +48,3 @@ int OpenRenderer( vlc_object_t *p_this )
     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;
-}
index e7930785f33dd95e2bd64494cd9a7e9adee74416..fff78a4e63631da96a27385f95bd44d488604302 100644 (file)
@@ -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,
-                       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 );
 }
 
 #ifdef HAVE_STYLES
 
 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 );
 }
 
index 523af677eb6751c71cd870d688d3784842b943e7..e6b066f65d710b055dc86f173c995a13e1a97f42 100644 (file)
@@ -66,9 +66,11 @@ static void Destroy( vlc_object_t * );
 static int LoadFontsFromAttachments( filter_t *p_filter );
 
 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 *,
-                       subpicture_region_t * );
+                       subpicture_region_t *,
+                       const vlc_fourcc_t * );
 
 static int GetFontSize( filter_t *p_filter );
 static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
@@ -308,7 +310,8 @@ static char *EliminateCRLF( char *psz_string )
 // Renders a text subpicture region into another one.
 // 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,
-                       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;
     char         *psz_string;
@@ -768,7 +771,8 @@ static int ProcessNodes( filter_t *p_filter,
 }
 
 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;
     stream_t     *p_sub = NULL;
index 344197cb8fcface07fc8a1d7fabe45a5c0699229..5e7de1be55684262afbc7c013ab2935068dc9ee4 100644 (file)
@@ -55,7 +55,8 @@ typedef struct svg_rendition_t svg_rendition_t;
 static int  Create    ( vlc_object_t * );
 static void Destroy   ( vlc_object_t * );
 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 );
 
 /*****************************************************************************
@@ -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,
-                       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;
     svg_rendition_t *p_svg = NULL;
index 6eb988cd1d5edbe369f81a3ed132bfc458e594ef..460a945f7b60e09d795221ea9328256b75301297 100644 (file)
@@ -47,7 +47,8 @@ static void Destroy( vlc_object_t * );
 
 /* The RenderText call maps to pf_render_string, defined in vlc_filter.h */
 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 SetFont( filter_t *, int );
@@ -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,
-                       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;
     int i_font_color, i_font_alpha, i_font_size;
index ea6929c096cdde126585750bf93394983087f20a..e41d09cd24b2285d5d0604b9db45127203c211f4 100644 (file)
@@ -257,6 +257,7 @@ static filter_t *SpuRenderCreateAndLoadScale(vlc_object_t *object,
 
 static void SpuRenderText(spu_t *spu, bool *rerender_text,
                           subpicture_region_t *region,
+                          const vlc_fourcc_t *chroma_list,
                           mtime_t elapsed_time)
 {
     filter_t *text = spu->p->text;
@@ -289,9 +290,9 @@ static void SpuRenderText(spu_t *spu, bool *rerender_text,
     var_SetBool(text, "text-rerender", false);
 
     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)
-        text->pf_render_text(text, region, region);
+        text->pf_render_text(text, region, region, chroma_list);
     *rerender_text = var_GetBool(text, "text-rerender");
 }
 
@@ -691,6 +692,7 @@ static void SpuRenderRegion(spu_t *spu,
     /* Render text region */
     if (region->fmt.i_chroma == VLC_CODEC_TEXT) {
         SpuRenderText(spu, &restore_text, region,
+                      chroma_list,
                       render_date - subpic->i_start);
 
         /* Check if the rendering has failed ... */