Skip to content

Commit

Permalink
Merge changes for release 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xchange11 committed Aug 2, 2018
2 parents 114dd07 + bf48fd9 commit 4c02cb3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.txt
@@ -1,3 +1,13 @@
-----------------------------
Version 1.2.1
-----------------------------

STLXML-SplitBlocks
- FIXED #53: User Data TTI blocks not correctly handled

EBU-TT-D2EBU-TT-D-Basic-DE
- FIXED: Remove unneeded xs namespace

-----------------------------
Version 1.2.0
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@ converting XML based subtitle formats. Main target is to build up a
flexible and extensible transformation pipeline to convert EBU STL
formats and EBU-TT subtitle formats.

The SCF is a stable release with the version 1.2.0.
The SCF is a stable release with the version 1.2.1.

## License
The Subtitle Conversion Framework ("SCF") offered by Institut fuer
Expand Down
1 change: 0 additions & 1 deletion misc/ci/test_pipeline_1/5_EBU-TT-D-Basic-DE.xml
Expand Up @@ -4,7 +4,6 @@
xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
xmlns:tts="http://www.w3.org/ns/ttml#styling"
xmlns:ebuttm="urn:ebu:tt:metadata"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
ttp:timeBase="media"
ttp:cellResolution="50 30"
xml:lang="de">
Expand Down
Expand Up @@ -17,8 +17,7 @@ limitations under the License.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:tt="http://www.w3.org/ns/ttml" xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ebuttm="urn:ebu:tt:metadata"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ebuttm="urn:ebu:tt:metadata">

<xsl:output encoding="UTF-8" indent="no"/>
<xsl:template match="/">
Expand Down
6 changes: 6 additions & 0 deletions modules/STLXML-SplitBlocks/README.md
Expand Up @@ -53,6 +53,12 @@ the first of the two TTI blocks (later by the `STLXML2STL` module).
Subsequent characters of the same subtitle are moved towards later TTI
blocks as well, if required, to always comply to the maximum TF size.

Furthermore TTI blocks containing User Data (if present) are always
inserted directly before the last subtitle text TTI block (EBN 0xFF) of
the same subtitle (= same SN value). This way the EBN values of the TTI
blocks of a subtitle are always monotonically increasing, e.g. the order
of the EBN values could be: 0x00, 0x01, 0xFE, 0xFE, 0xFF.

## EXAMPLES
If you use the Saxon parser you could perform a transformation as
follows:
Expand Down
22 changes: 21 additions & 1 deletion modules/STLXML-SplitBlocks/STLXML-SplitBlocks.xslt
Expand Up @@ -57,7 +57,8 @@ limitations under the License.
</xsl:copy>
</xsl:template>

<xsl:template match="TTI">
<xsl:template match="TTI[lower-case(normalize-space(EBN)) ne 'fe']">
<!-- process subtitle text TTI block -->
<xsl:choose>
<xsl:when test="TF/child::node()">
<!-- match first TF child -->
Expand All @@ -76,6 +77,20 @@ limitations under the License.
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="TTI[lower-case(normalize-space(EBN)) eq 'fe']">
<!-- copy User Data TTI block, if no related subtitle text TTI blocks exist -->
<xsl:if test="not(../TTI[normalize-space(SN) eq normalize-space(current()/SN) and lower-case(normalize-space(EBN)) ne 'fe'])">
<xsl:apply-templates select="." mode="copy"/>
</xsl:if>
</xsl:template>

<xsl:template match="TTI" mode="copy">
<!-- 1:1 TTI block copy (except unimportant whitespace text nodes) -->
<TTI>
<xsl:copy-of select="child::node()[not(self::text()[normalize-space(.) eq ''])]"/>
</TTI>
</xsl:template>

<xsl:template match="element()" mode="tf">
<!-- process TF element child -->
Expand Down Expand Up @@ -192,6 +207,11 @@ limitations under the License.
<xsl:param name="ebn_value" as="xs:integer"/>
<xsl:param name="tf_buffer"/>

<!-- insert related User Data TTI blocks, if present -->
<xsl:if test="$ebn_value eq 255">
<xsl:apply-templates select="../TTI[normalize-space(SN) eq normalize-space(current()/SN) and lower-case(normalize-space(EBN)) eq 'fe']" mode="copy"/>
</xsl:if>

<xsl:copy>
<xsl:apply-templates select="@*|node()">
<xsl:with-param name="ebn_value" select="$ebn_value"/>
Expand Down

0 comments on commit 4c02cb3

Please sign in to comment.