[vlc-commits] Allowed to give the list of prefered chroma to "text renderer".

Laurent Aimar git at videolan.org
Sat Jun 25 20:23:21 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jun 25 20:11:03 2011 +0200| [364f9dc2bde4a9ad849c9500482b1374ed2e46f8] | committer: Laurent Aimar

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=364f9dc2bde4a9ad849c9500482b1374ed2e46f8
---

 include/vlc_filter.h                    |    6 ++++--
 modules/gui/fbosd.c                     |    2 +-
 modules/misc/dummy/renderer.c           |   16 ++++++++--------
 modules/misc/text_renderer/freetype.c   |    8 ++++++--
 modules/misc/text_renderer/quartztext.c |   12 ++++++++----
 modules/misc/text_renderer/svg.c        |    6 ++++--
 modules/misc/text_renderer/win32text.c  |    6 ++++--
 src/video_output/vout_subpictures.c     |    6 ++++--
 8 files changed, 39 insertions(+), 23 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index f7b536d..c2ec30f 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -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
diff --git a/modules/gui/fbosd.c b/modules/gui/fbosd.c
index 35c139d..375d895 100644
--- a/modules/gui/fbosd.c
+++ b/modules/gui/fbosd.c
@@ -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;
diff --git a/modules/misc/dummy/renderer.c b/modules/misc/dummy/renderer.c
index 75c7693..219cef7 100644
--- a/modules/misc/dummy/renderer.c
+++ b/modules/misc/dummy/renderer.c
@@ -31,8 +31,14 @@
 
 #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;
-}
diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index e793078..fff78a4 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -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 );
 }
 
diff --git a/modules/misc/text_renderer/quartztext.c b/modules/misc/text_renderer/quartztext.c
index 523af67..e6b066f 100644
--- a/modules/misc/text_renderer/quartztext.c
+++ b/modules/misc/text_renderer/quartztext.c
@@ -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;
diff --git a/modules/misc/text_renderer/svg.c b/modules/misc/text_renderer/svg.c
index 344197c..5e7de1b 100644
--- a/modules/misc/text_renderer/svg.c
+++ b/modules/misc/text_renderer/svg.c
@@ -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;
diff --git a/modules/misc/text_renderer/win32text.c b/modules/misc/text_renderer/win32text.c
index 6eb988c..460a945 100644
--- a/modules/misc/text_renderer/win32text.c
+++ b/modules/misc/text_renderer/win32text.c
@@ -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;
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index ea6929c..e41d09c 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -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 ... */



More information about the vlc-commits mailing list