Skip to content

Commit

Permalink
Merge pull request #177 from Netflix/feature/cplMergeabilityFix
Browse files Browse the repository at this point in the history
Change CPL mergebility failures to errors from warnings
  • Loading branch information
svenkatrav authored Feb 10, 2017
2 parents aba7612 + 2159065 commit a80f814
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public static List<ErrorLogger.ErrorObject> isCPLMergeable(PayloadRecord referen
UUID referenceCPLUUID = applicationCompositions.get(0).getUUID();
for (int i = 1; i < applicationCompositions.size(); i++) {
if (!referenceVideoVirtualTrack.equivalent(applicationCompositions.get(i).getVideoVirtualTrack())) {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.WARNING, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since the video virtual tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceCPLUUID));
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since the video virtual tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceCPLUUID));
}
}

Expand All @@ -501,7 +501,7 @@ public static List<ErrorLogger.ErrorObject> isCPLMergeable(PayloadRecord referen
Map<Set<DOMNodeObjectModel>, ? extends VirtualTrack> referenceAudioVirtualTracksMap = audioVirtualTracksMapList.get(0);
for (int i = 1; i < audioVirtualTracksMapList.size(); i++) {
if (!compareAudioVirtualTrackMaps(Collections.unmodifiableMap(referenceAudioVirtualTracksMap), Collections.unmodifiableMap(audioVirtualTracksMapList.get(i)), imfErrorLogger)) {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.WARNING, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since 2 same language audio tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceCPLUUID));
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since 2 same language audio tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceCPLUUID));
}
}
}
Expand All @@ -513,8 +513,8 @@ public static List<ErrorLogger.ErrorObject> isCPLMergeable(PayloadRecord referen
if (referenceMarkerVirtualTrack != null) {
UUID referenceMarkerCPLUUID = applicationCompositions.get(0).getUUID();
for (int i = 1; i < applicationCompositions.size(); i++) {
if (!referenceVideoVirtualTrack.equivalent(applicationCompositions.get(i).getMarkerVirtualTrack())) {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.WARNING, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since the marker virtual tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceMarkerCPLUUID));
if (!referenceMarkerVirtualTrack.equivalent(applicationCompositions.get(i).getMarkerVirtualTrack())) {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("CPL Id %s can't be merged with Reference CPL Id %s, since the marker virtual tracks do not seem to represent the same timeline.", applicationCompositions.get(i).getUUID(), referenceMarkerCPLUUID));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static IMFCompositionPlaylistType getCompositionPlaylist (@Nonnull org.sm
}

} else {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.WARNING, "Unsupported Resource type in Marker Sequence");
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, "Unsupported Resource type in Marker Sequence");
}

if (baseResource != null) {
Expand All @@ -98,7 +98,7 @@ public static IMFCompositionPlaylistType getCompositionPlaylist (@Nonnull org.sm
details = "Tag: " + element.getTagName() + " URI: " + element.getNamespaceURI();
}
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger
.IMFErrors.ErrorLevels.WARNING, String.format("Unsupported sequence type or schema %s",
.IMFErrors.ErrorLevels.NON_FATAL, String.format("Unsupported sequence type or schema %s",
details));
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static IMFCompositionPlaylistType getCompositionPlaylist (@Nonnull org.sm
imfErrorLogger.addAllErrors(e.getErrors());
}
} else {
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.WARNING, "Unsupported Resource type in Marker Sequence");
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, "Unsupported Resource type in Marker Sequence");
}

if (baseResource != null) {
Expand All @@ -104,7 +104,7 @@ public static IMFCompositionPlaylistType getCompositionPlaylist (@Nonnull org.sm
details = "Tag: " + element.getTagName() + " URI: " + element.getNamespaceURI();
}
imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR, IMFErrorLogger
.IMFErrors.ErrorLevels.WARNING, String.format("Unsupported sequence type or schema %s",
.IMFErrors.ErrorLevels.NON_FATAL, String.format("Unsupported sequence type or schema %s",
details));
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static List checkVirtualTracks(IMFCompositionPlaylistType compositionPlay
List<? extends IMFBaseResourceType> virtualTrackResourceList = virtualTrack.getResourceList();
imfErrorLogger.addAllErrors(checkVirtualTrackResourceList(virtualTrack.getTrackID(), virtualTrackResourceList));

//TODO: Support for subtitle sequence needed
if (!(virtualTrack.getSequenceTypeEnum().equals(Composition.SequenceTypeEnum.MainImageSequence)
|| virtualTrack.getSequenceTypeEnum().equals(Composition.SequenceTypeEnum.MainAudioSequence)
|| virtualTrack.getSequenceTypeEnum().equals(Composition.SequenceTypeEnum.MarkerSequence)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public void cplVirtualTrackConformancePositiveTest()

IMPBuilder.buildIMP_2016("IMP",
"Netflix",
applicationComposition.getVirtualTracks(),
applicationComposition.getEssenceVirtualTracks(),
applicationComposition.getEditRate(),
"http://www.smpte-ra.org/schemas/2067-21/2016",
imfTrackFileMetadataMap,
Expand Down Expand Up @@ -519,7 +519,7 @@ public void cplMergeabilityNegativeTest() throws IOException {
}}));
}

Assert.assertEquals(errors.size(), 1);
Assert.assertEquals(errors.size(), 2);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void impBuilderTest_2016()

IMPBuilder.buildIMP_2016("IMP",
"Netflix",
applicationComposition.getVirtualTracks(),
applicationComposition.getEssenceVirtualTracks(),
applicationComposition.getEditRate(),
"http://www.smpte-ra.org/schemas/2067-21/2016",
imfTrackFileMetadataMap,
Expand Down Expand Up @@ -275,7 +275,7 @@ public void impBuilderTest_2013_1()

IMPBuilder.buildIMP_2013("IMP",
"Netflix",
applicationComposition.getVirtualTracks(),
applicationComposition.getEssenceVirtualTracks(),
applicationComposition.getEditRate(),
"http://www.smpte-ra.org/schemas/2067-21/2016",
imfTrackFileMetadataMap,
Expand Down Expand Up @@ -385,7 +385,7 @@ public void impBuilderTest_2013_2()

IMPBuilder.buildIMP_2013("IMP",
"Netflix",
applicationComposition.getVirtualTracks(),
applicationComposition.getEssenceVirtualTracks(),
applicationComposition.getEditRate(),
"http://www.smpte-ra.org/schemas/2067-21/2016",
imfTrackFileMetadataMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,163 +277,109 @@
<Id>urn:uuid:e9e18479-6116-40f4-a891-9ef999c80f2a</Id>
<Annotation>BLACKL_202_HD_REC709_178_ENG</Annotation>
<SequenceList>
<!--
<cc:MarkerSequence xmlns:cc="http://www.smpte-ra.org/schemas/2067-2/2014">
<Id>urn:uuid:3fe86415-7d9c-49af-bb6b-97af2054c0d4</Id>
<TrackId>urn:uuid:19de6c38-d921-448c-b4e0-ecadc459b36b</TrackId>
<cc:MarkerSequence xmlns:cc="http://www.smpte-ra.org/schemas/2067-3/2013">
<Id>urn:uuid:8d803197-26db-41a8-a256-c25e5b2c0d13</Id>
<TrackId>urn:uuid:9b2b4b55-86ed-4e07-b5ba-7f8da05682e0</TrackId>
<ResourceList>
<Resource xsi:type="MarkerResourceType">
<Id>urn:uuid:a2ddf23e-b87b-48fb-b1bc-0ce5f61346c0</Id>
<IntrinsicDuration>7148</IntrinsicDuration>
<Marker>
<Annotation/>
<Label>FFHS</Label>
<Offset>0</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFHS</Label>
<Offset>95</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFBT</Label>
<Offset>168</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFBT</Label>
<Offset>407</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFSP</Label>
<Offset>480</Offset>
</Marker>
<Id>urn:uuid:41301aa3-2b05-4650-a4d2-9b3a8c618589</Id>
<IntrinsicDuration>7148</IntrinsicDuration>
<Marker>
<Annotation/>
<Label>FFCL</Label>
<Offset>720</Offset>
<Offset>24</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FPCI</Label>
<Offset>720</Offset>
<Offset>24</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFCL</Label>
<Offset>815</Offset>
<Offset>119</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFMC</Label>
<Offset>816</Offset>
<Offset>120</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFMC</Label>
<Offset>1332</Offset>
<Offset>636</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFCB</Label>
<Offset>1333</Offset>
<Offset>637</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFCB</Label>
<Offset>1386</Offset>
<Offset>690</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFMC</Label>
<Offset>1387</Offset>
<Offset>691</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFMC</Label>
<Offset>1943</Offset>
<Offset>1247</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FPCI</Label>
<Offset>1943</Offset>
<Offset>1247</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFOI</Label>
<Offset>1944</Offset>
<Offset>1248</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFOI</Label>
<Offset>2063</Offset>
<Offset>1367</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFEC</Label>
<Offset>2064</Offset>
<Offset>1368</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFEC</Label>
<Offset>3012</Offset>
<Offset>2316</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFMC</Label>
<Offset>3013</Offset>
<Offset>2317</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFMC</Label>
<Offset>6547</Offset>
<Offset>5851</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FPCI</Label>
<Offset>6547</Offset>
<Offset>5852</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFCL</Label>
<Offset>6548</Offset>
<Offset>5852</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFCL</Label>
<Offset>6643</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFSP</Label>
<Offset>6883</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FFTS</Label>
<Offset>6884</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LFTS</Label>
<Offset>6979</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>FTXM</Label>
<Offset>6980</Offset>
</Marker>
<Marker>
<Annotation/>
<Label>LTXM</Label>
<Offset>7099</Offset>
<Offset>5947</Offset>
</Marker>
</Resource>
</ResourceList>
</cc:MarkerSequence>
-->
<!--
<cc:MainImageSequence xmlns:cc="http://www.smpte-ra.org/schemas/2067-2/2014">
-->
Expand Down
Loading

0 comments on commit a80f814

Please sign in to comment.