+struct subpicture_updater_sys_t
+{
+ vlc_epg_t *epg;
+};
+
+static int OSDEpgValidate(subpicture_t *subpic,
+ bool has_src_changed, const video_format_t *fmt_src,
+ bool has_dst_changed, const video_format_t *fmt_dst,
+ mtime_t ts)
+{
+ VLC_UNUSED(subpic); VLC_UNUSED(ts);
+ VLC_UNUSED(fmt_src); VLC_UNUSED(has_src_changed);
+ VLC_UNUSED(fmt_dst);
+
+ if (!has_dst_changed)
+ return VLC_SUCCESS;
+ return VLC_EGENERIC;
+}
+
+static void OSDEpgUpdate(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_src); VLC_UNUSED(ts);
+
+ video_format_t fmt = *fmt_dst;
+ fmt.i_width = fmt.i_width * fmt.i_sar_num / fmt.i_sar_den;
+ fmt.i_visible_width = fmt.i_visible_width * fmt.i_sar_num / fmt.i_sar_den;
+ fmt.i_x_offset = fmt.i_x_offset * fmt.i_sar_num / fmt.i_sar_den;
+
+ subpic->i_original_picture_width = fmt.i_width;
+ subpic->i_original_picture_height = fmt.i_height;
+ subpic->p_region = vout_BuildOSDEpg(sys->epg,
+ fmt.i_x_offset,
+ fmt.i_y_offset,
+ fmt.i_visible_width,
+ fmt.i_visible_height);
+}
+
+static void OSDEpgDestroy(subpicture_t *subpic)
+{
+ subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+
+ vlc_epg_Delete(sys->epg);
+ free(sys);
+}