Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TSP App 2121-1 #263

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/main/java/com/netflix/imflibrary/Colorimetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum Colorimetry {
Color6(ColorPrimaries.P3D65, TransferCharacteristic.SMPTEST2084, CodingEquation.None),
Color7(ColorPrimaries.ITU2020, TransferCharacteristic.SMPTEST2084, CodingEquation.ITU2020NCL),
Color_App5_AP0(ColorPrimaries.ACES, TransferCharacteristic.Linear, CodingEquation.None),
Color8(ColorPrimaries.ITU2020, TransferCharacteristic.ITU2020HLG, CodingEquation.ITU2020NCL),
Unknown(ColorPrimaries.Unknown, TransferCharacteristic.Unknown, CodingEquation.Unknown);


Expand Down Expand Up @@ -87,6 +88,7 @@ public static enum TransferCharacteristic {
ITU2020(UL.fromULAsURNStringToUL("urn:smpte:ul:06.0E.2B.34.04.01.01.0E.04.01.01.01.01.09.00.00")),
SMPTEST2084(UL.fromULAsURNStringToUL("urn:smpte:ul:06.0E.2B.34.04.01.01.0D.04.01.01.01.01.0A.00.00")),
Linear(UL.fromULAsURNStringToUL("urn:smpte:ul:06.0e.2b.34.04.01.01.06.04.01.01.01.01.06.00.00")),
ITU2020HLG(UL.fromULAsURNStringToUL("urn:smpte:ul:06.0E.2B.34.04.01.01.0D.04.01.01.01.01.0B.00.00")),
Unknown(null);

private final UL transferCharacteristicUL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ Map<UUID, DOMNodeObjectModel> getEssenceDescriptorListMap(Set<String> ignoreSet)
*
* @return a HashMap mapping the UUID to its corresponding EssenceDescriptor in the Composition
*/
Map<UUID, DOMNodeObjectModel> getEssenceDescriptorListMap() {
protected Map<UUID, DOMNodeObjectModel> getEssenceDescriptorListMap() {
return getEssenceDescriptorListMap(new HashSet<>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

import com.netflix.imflibrary.IMFErrorLogger;
import com.netflix.imflibrary.exceptions.IMFException;
import com.netflix.imflibrary.tsp_2121.ApplicationTsp2121Composition;
import com.netflix.imflibrary.utils.FileByteRangeProvider;
import com.netflix.imflibrary.utils.ResourceByteRangeProvider;

import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
Expand All @@ -50,10 +50,15 @@ public class ApplicationCompositionFactory {
add("http://www.smpte-ra.org/ns/2067-50/2017");
}});

private static final Set<String> namespacesApplicationTsp2121Composition = Collections.unmodifiableSet(new HashSet<String>() {{
add("http://www.digitalproductionpartnership.co.uk/schema/imf/TSP2121-1/2018");
}});

public enum ApplicationCompositionType {
APPLICATION_2_COMPOSITION_TYPE(Application2Composition.class, namespacesApplication2Composition),
APPLICATION_2E_COMPOSITION_TYPE(Application2ExtendedComposition.class, namespacesApplication2EComposition),
APPLICATION_5_COMPOSITION_TYPE(Application5Composition.class, namespacesApplication5Composition),
APPLICATION_TSP_2121_COMPOSITION_TYPE(ApplicationTsp2121Composition.class, namespacesApplicationTsp2121Composition),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSP 2121 has many parts. ApplicationTsp2121 could be replaced by ApplicationTsp2121Part1 or ApplicationDPPProRes.

APPLICATION_UNSUPPORTED_COMPOSITION_TYPE(ApplicationUnsupportedComposition.class, Collections.unmodifiableSet(new HashSet<>()));
private Set<String> nameSpaceSet;
private Class<?> clazz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Created by svenkatrav on 11/2/16.
*/
public final class CompositionImageEssenceDescriptorModel {
public class CompositionImageEssenceDescriptorModel {
private final UUID imageEssencedescriptorID;
private final DOMNodeObjectModel imageEssencedescriptorDOMNode;
private final RegXMLLibDictionary regXMLLibDictionary;
Expand Down Expand Up @@ -199,6 +199,18 @@ public CompositionImageEssenceDescriptorModel(@Nonnull UUID imageEssencedescript
return imageEssencedescriptorID;
}

protected @Nonnull IMFErrorLogger getImfErrorLogger() {
return imfErrorLogger;
}

protected @Nonnull DOMNodeObjectModel getImageEssenceDescriptorDOMNode() {
return imageEssencedescriptorDOMNode;
}

protected @Nonnull RegXMLLibDictionary getRegXMLLibDictionary() {
return regXMLLibDictionary;
}

public @Nonnull FrameLayoutType getFrameLayoutType() {
return frameLayoutType;
}
Expand Down Expand Up @@ -380,7 +392,7 @@ public TransferCharacteristic getTransferCharacteristic() {
return paletteLayout;
}

private @Nonnull Integer parsePixelBitDepth(@Nonnull ColorModel colorModel) {
protected @Nonnull Integer parsePixelBitDepth(@Nonnull ColorModel colorModel) {
Integer refPixelBitDepth = null;
DOMNodeObjectModel subDescriptors = imageEssencedescriptorDOMNode.getDOMNode(regXMLLibDictionary.getSymbolNameFromURN(subdescriptorsUL));
if (subDescriptors == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* A class that models an IMF Composition Playlist structure.
*/
@Immutable
final class IMFCompositionPlaylistType {
public final class IMFCompositionPlaylistType {
private final UUID id;
private final Composition.EditRate editRate;
private final String annotation;
Expand Down
Loading