Skip to content

Commit

Permalink
Adding IMSC 1.1 profile designators (#344)
Browse files Browse the repository at this point in the history
* Adding IMSC 1.1 profile designators
  • Loading branch information
IMFTool authored Oct 25, 2024
1 parent 9042ed9 commit 16933c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/netflix/imflibrary/IMFConstraints.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public final class IMFConstraints
private static final byte[] IMF_CHANNEL_ASSIGNMENT_UL = {0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x0d, 0x04, 0x02, 0x02, 0x10, 0x04, 0x01, 0x00, 0x00};
public static final String IMSC1TextProfileDesignator = "http://www.w3.org/ns/ttml/profile/imsc1/text";
public static final String IMSC1ImageProfileDesignator = "http://www.w3.org/ns/ttml/profile/imsc1/image";
// Timed Text profile designators per SMPTE ST 2067-2:2020, section 5.4.2
private static final String[] IMSC1TextProfileDesignators2020 = {IMSC1TextProfileDesignator, "http://www.w3.org/ns/ttml/profile/imsc1.1/text", "urn:ebu:tt:distribution:2014-01", "urn:ebu:tt:distribution:2018-04", "http://www.w3.org/ns/ttml/profile/sdp-us", "https://www.netflix.com/ns/imsc1.1/text/1"};
private static final String[] IMSC1ImageProfileDesignators2020 = {IMSC1ImageProfileDesignator, "http://www.w3.org/ns/ttml/profile/imsc1.1/image"};
public static final String IMSC1ImageResourceMimeMediaType = "image/png";
public static final String IMSC1FontResourceMimeMediaType = "application/x-font-opentype";
//to prevent instantiation
Expand Down Expand Up @@ -279,11 +282,11 @@ else if (!audioChannelLabelSubDescriptor.getSoundfieldGroupLinkId()
packageID.toString()));
}
//https://www.w3.org/TR/ttml-imsc1/ Section 6.3
if (!timedTextDescriptor.getNamespaceURI().equals(IMSC1TextProfileDesignator) && !timedTextDescriptor.getNamespaceURI().equals(IMSC1ImageProfileDesignator)) {
if (!(Arrays.asList(IMSC1TextProfileDesignators2020).contains(timedTextDescriptor.getNamespaceURI()) || Arrays.asList(IMSC1ImageProfileDesignators2020).contains(timedTextDescriptor.getNamespaceURI()))) {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CORE_CONSTRAINTS_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, IMFConstraints
.IMF_ESSENCE_EXCEPTION_PREFIX + String.format("Invalid NamespaceURI(%s) in TimedTextDescriptor within trackFile represented by ID %s. Valid NamespaceURIs: " +
"{%s}, {%s}",
timedTextDescriptor.getNamespaceURI(), packageID.toString(), IMSC1TextProfileDesignator, IMSC1ImageProfileDesignator));
timedTextDescriptor.getNamespaceURI(), packageID.toString(), Arrays.toString(IMSC1TextProfileDesignators2020), Arrays.toString(IMSC1ImageProfileDesignators2020)));
}
for(TimeTextResourceSubDescriptor textResourceSubDescriptor : timedTextDescriptor.getSubDescriptorList()) {
//Section 5.4.5 and 5.4.6 st2067-2:2016
Expand Down

0 comments on commit 16933c9

Please sign in to comment.