- mtime_t i_now = mdate();
- if ( p_vout->pf_add_string )
- {
- p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin,
- i_vmargin, i_now, i_now + i_duration );
- }
- else
- {
- msg_Warn( p_vout, "No text renderer found" );
- }
+ VLC_UNUSED(subpic); VLC_UNUSED(ts); VLC_UNUSED(fmt_src);
+ VLC_UNUSED(has_dst_changed); VLC_UNUSED(fmt_dst);
+
+ if( !has_src_changed && !has_dst_changed)
+ return VLC_SUCCESS;
+ return VLC_EGENERIC;
+}
+
+static void OSDTextUpdate(subpicture_t *subpic,
+ const video_format_t *fmt_src,
+ const video_format_t *fmt_dst,
+ mtime_t ts)
+{
+ subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ VLC_UNUSED(fmt_dst); VLC_UNUSED(ts);
+
+ subpic->i_original_picture_width = fmt_src->i_width;
+ subpic->i_original_picture_height = fmt_src->i_height;
+
+ video_format_t fmt;
+ video_format_Init( &fmt, VLC_CODEC_TEXT);
+ fmt.i_sar_num = 0;
+ fmt.i_sar_den = 1;
+
+ subpicture_region_t *r = subpic->p_region = subpicture_region_New(&fmt);
+ if (!r)
+ return;
+
+ r->psz_text = strdup(sys->text);
+ r->i_align = sys->position;
+ r->i_x = 30 + fmt_src->i_width
+ - fmt_src->i_visible_width
+ - fmt_src->i_x_offset;
+ r->i_y = 20 + fmt_src->i_y_offset;