]> git.sesse.net Git - vlc/blobdiff - modules/codec/substext.h
Qt: Open: Don't allow next step if item is missing.
[vlc] / modules / codec / substext.h
index df9779c7c10d246ac96c5106a0cc18895de3e2d0..fe5df95350e3ac0cb4ccdbb4d5aa2dcd17939026 100644 (file)
@@ -5,10 +5,12 @@ struct subpicture_updater_sys_t {
     int  align;
     int  x;
     int  y;
+    int  i_font_height_percent;
 
     bool is_fixed;
     int  fixed_width;
     int  fixed_height;
+    bool renderbg;
 };
 
 static int SubpictureTextValidate(subpicture_t *subpic,
@@ -59,6 +61,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
     r->psz_text = sys->text ? strdup(sys->text) : NULL;
     r->psz_html = sys->html ? strdup(sys->html) : NULL;
     r->i_align  = sys->align;
+    r->b_renderbg = sys->renderbg;
     if (!sys->is_fixed) {
         const float margin_ratio = 0.04;
         const int   margin_h     = margin_ratio * fmt_dst->i_visible_width;
@@ -80,6 +83,18 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
         r->i_x = sys->x * fmt_dst->i_width  / sys->fixed_width;
         r->i_y = sys->y * fmt_dst->i_height / sys->fixed_height;
     }
+
+    if (sys->i_font_height_percent != 0)
+    {
+        r->p_style = text_style_New();
+        if (r->p_style)
+        {
+           r->p_style->i_font_size = sys->i_font_height_percent *
+             subpic->i_original_picture_height / 100;
+            r->p_style->i_font_color = 0xffffff;
+            r->p_style->i_font_alpha = 0xff;
+       }
+    }
 }
 static void SubpictureTextDestroy(subpicture_t *subpic)
 {