[vlc-commits] Subtitle renderers: Merge RenderText & RenderHTML

Hugo Beauzée-Luyssen git at videolan.org
Tue Jul 28 16:01:58 CEST 2015


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jul 20 13:53:31 2015 +0200| [f2e43bd7ec7bc712f901ac669a154c8573462e42] | committer: Jean-Baptiste Kempf

Subtitle renderers: Merge RenderText & RenderHTML

The current workflow is often parsing a subtitle format, then convert it
in a common HTML and then push it to the renderer as HTML. The renderer
will reparse the HTML and try to render it. Of course, that means that
only one renderer can do that correctly, and so we bloat the freetype
renderer as much as we can.
It also means that we have 2 render callbacks for subtitles, one for
normal text and one for styled text, and we sometimes reparse the HTML
to remove the tags, for the first.

We now only use a text_segment, with new segments at every style change;
an unique render function and the renderer can decide to honor or not
the style.

It's a big commit, so regressions can arise, but it was tested for most
common cases.

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

 include/vlc_filter.h                               |    8 +-
 include/vlc_subpicture.h                           |    2 -
 modules/codec/arib/aribsub.c                       |    1 -
 modules/codec/arib/substext.h                      |   20 +--
 modules/codec/cc.c                                 |   14 +-
 modules/codec/kate.c                               |   18 +-
 modules/codec/subsdec.c                            |   77 +-------
 modules/codec/substext.h                           |  186 ++++----------------
 modules/codec/substtml.c                           |    3 +-
 modules/codec/substx3g.c                           |    3 +-
 modules/codec/subsusf.c                            |   90 ++++------
 modules/codec/zvbi.c                               |    4 +-
 modules/text_renderer/freetype.c                   |  141 ++-------------
 modules/text_renderer/svg.c                        |    5 +-
 modules/text_renderer/tdummy.c                     |    3 +-
 modules/text_renderer/text_layout.c                |   64 ++++++-
 modules/text_renderer/text_layout.h                |    6 +-
 modules/text_renderer/win32text.c                  |   11 +-
 .../video_filter/dynamicoverlay/dynamicoverlay.c   |    2 +-
 modules/video_filter/marq.c                        |    4 +-
 modules/video_filter/rss.c                         |    4 +-
 modules/video_filter/subsdelay.c                   |   37 ++--
 src/misc/subpicture.c                              |    9 -
 src/video_output/video_epg.c                       |   22 ++-
 src/video_output/vout_subpictures.c                |    6 +-
 25 files changed, 219 insertions(+), 521 deletions(-)

Diff:   http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=f2e43bd7ec7bc712f901ac669a154c8573462e42


More information about the vlc-commits mailing list