Commit graph

21 commits

Author SHA1 Message Date
Stéphane Cerveau
0b07d970fe ttml: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>
2021-03-23 14:19:17 +00:00
Chris Bass
2863a55a89 ttml: Add support for IMSC 1.0.1 fillLineGap attribute
Strictly speaking, the TTML spec requires that text backgrounds extend
only to the font height of the related text, rather than to the vertical
distance between lines. The result of this is that there will typically
be vertical gaps between line backgrounds through which moving video can
be seen. Since this was unnacceptable to some content providers, v1.0.1
of the IMSC spec (which profiles TTML) adds a new attribute,
itts:fillLineGap[1], that allows content authors to specify that clients
should extend text backgrounds such that there are no gaps between
lines. This attribute is also going to be included in the next release
of EBU-TT-D.

This patch adds support for fillLineGap to ttmlparse and ttmlrender.

[1] https://www.w3.org/TR/ttml-imsc1.0.1/#itts-fillLineGap

https://bugzilla.gnome.org/show_bug.cgi?id=787071
2018-02-27 16:27:47 +02:00
Chris Bass
9e3b63e109 ttmlrender: Fix potential resource leak identified by coverity
Fixes CID #1405133.
2017-04-20 10:40:32 +01:00
Chris Bass
129bee3d02 ttmlrender: Fix potential problem identified by clang
Clang's static analyser found potential code paths in which variables
were being used in comparisons when uninitialised. Fix by properly
handling out-of-range value returned by gst_ttml_get_element_index.
2017-04-19 18:28:31 +01:00
Chris Bass
3fbd12b141 ttmlrender: Fix integer handling issue identified by coverity
Fixes CID #1405132.
2017-04-19 18:28:31 +01:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -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
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
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
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