Commit graph

23 commits

Author SHA1 Message Date
Chris Bass
28e0bdb7fe ttmlparse: push segment events downstream
Without this, subtitles will stop after seeking.

https://bugzilla.gnome.org/show_bug.cgi?id=780897
2017-04-09 10:42:26 +03:00
Chris Bass
b4d9d9d9f8 ttmlparse: don't filter out untimed whitespace
Significant whitespace in elements that don't have begin/end values
should inherit timing from its parent, or if no its parents have no
timing, from the document's Root Temporal Extent. Currently, such
whitespace is removed, which is not spec-compliant. Fix this by
retaining whitespace in content nodes, and assigning a Root Temporal
Extent of 24 hours to any significant whitespace whose parents have no
associated timing.

https://bugzilla.gnome.org/show_bug.cgi?id=781027
2017-04-09 10:42:16 +03:00
Chris Bass
89b6b1a760 ttmlparse: don't leak caps.
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
60bcf63a29 ttmlrender: improve function comments/descriptions
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
ada24bd2b6 ttmlrender: relocate type definitions to head of file
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
0288ee24e9 ttml: correctly implement lineHeight behaviour
The specified behaviour in TTML when lineHeight is "normal" is different
from the behaviour when a percentage is given. In the former case, the
line height is a percentage (the TTML spec recommends 125%) of the largest
font size that is applied to the spans within the block; in the latter
case, the line height is the given percentage of the font size that is
applied to the block itself.

The code doesn't correctly implement this behaviour; this patch fixes
that.

https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
f28df30a8b ttmlrender: apply correct line height to blocks with multiple text sizes
In TTML, the height of every line in a block is determined by lineHeight
and fontSize style attributes, and should be the same for each line in
that block, regardless of whether different sized text appears on
different lines. Currently, a single PangoLayout is used to lay out all
the text in a block; however, pango will vary the line height in a
layout depending on the size of text used in each line, which is not
compliant with TTML.

This patch makes ttmlrender lay out the lines in a block itself, rather
than using a PangoLayout to do the work. The code still uses a
PangoLayout to render the text of each element, but the overall layout
of the text in a block is now controlled by ttmlrender itself. By doing
this, ttmlrender is able to ensure that the height of each line in a
block is correct.

https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
2a4a18b2ab ttmlrender: add facility to stitch images in both directions
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
ce532ddcfd ttmlrender: extend UnifiedElement type to include font metrics
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
aec8406fd7 ttmlrender: extend UnifiedBlock type
Include a reference to the GstSubtitleStyleSet of the represented block
and a string containing the concatenated text from all elements.

https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
9f0a06245b ttml: add refcounting to GstSubtitleStlyeSet type
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
4f790d13a6 ttmlrender: rename TextRange type and its fields.
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
ac91886ab7 ttmlrender: store PangoLayout in object state
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
96e07de31d ttmlrender: put all functions in gst_ttml_render namespace
https://bugzilla.gnome.org/show_bug.cgi?id=780402
2017-04-09 10:42:08 +03:00
Chris Bass
4ac2a8d6a6 ttml: Replace assertions
Remove assertions and replace, where necessary, with code that handles
the error cases.

https://bugzilla.gnome.org/show_bug.cgi?id=776436
2017-03-15 13:28:36 +02:00
Sebastian Dröge
9539edd1b5 ttml: Link with -lm for round() 2017-01-12 15:39:13 +02:00
Seungha Yang
a5ce16f739 ttmlrender: Fix segfault on _render_text_region()
Fix invalid memory access

https://bugzilla.gnome.org/show_bug.cgi?id=775965
2016-12-12 11:00:51 +02:00
Seungha Yang
ba1ad5f4cd ttmlparse: Transform caps event
For autoplugging, decodebin/parsebin refers to the caps event.

https://bugzilla.gnome.org/show_bug.cgi?id=775967
2016-12-12 10:57:29 +02:00
Nicolas Dufresne
c03a4829ac meson/ttml: Add missing math library dependency
This code call 'round' which may require linking against the math library
on some compilers.
2016-11-30 22:40:45 -05:00
Sebastian Dröge
a1dc37b22b ttmlrender: Mark pad as needing reconfiguration again if it failed
And return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:22:44 +02:00
Luis de Bethencourt
81d1b207ad ttml: bump needed libxml2 version
ttml was recently added but it won't compile unless libxml2 version 2.9.2
or later is available. In that version the first parameter of xmlGetProp
switched to being a const. In previous versions the compiler complains
about passing a const value to a non const argument.
2016-11-03 17:44:33 +00:00
Sebastian Dröge
8eef23eb38 ttml: Add meson.build 2016-11-02 20:14:39 +02:00
Chris Bass
d82ae6949f ttml: Add plugin that supports TTML subtitles
Add a parser (ttmlparse) and renderer (ttmlrender) element that handle
subtitles that use the EBU-TT-D profile of TTML1.

https://bugzilla.gnome.org/show_bug.cgi?id=758232
2016-11-01 20:46:46 +02:00