Skip to content

Commit

Permalink
Merge pull request #30 from Netflix/feature/IMFWorkflowRelatedMods
Browse files Browse the repository at this point in the history
Added a method to return a SequenceTypeEnum for the Essence and an un…
  • Loading branch information
schakrovorthy committed Mar 22, 2016
2 parents 41241dc + cbf6447 commit ae26e1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,23 @@ else if(headerPartition.hasWaveAudioEssenceDescriptor()){
return result;
}

/**
* A method that returns the EssenceType enumeration corresponding to this Essence
* @return a string representing either a MainImageSequence or a MainAudioSequence
* @throws IOException - any I/O related error will be exposed through an IOException
*/
public CompositionPlaylist.SequenceTypeEnum getEssenceTypeEnum() throws IOException{
CompositionPlaylist.SequenceTypeEnum result = CompositionPlaylist.SequenceTypeEnum.Unknown;
HeaderPartition headerPartition = this.getHeaderPartitionIMF().getHeaderPartitionOP1A().getHeaderPartition();
if(headerPartition.hasCDCIPictureEssenceDescriptor() || headerPartition.hasRGBAPictureEssenceDescriptor()){
result = CompositionPlaylist.SequenceTypeEnum.MainImageSequence;
}
else if(headerPartition.hasWaveAudioEssenceDescriptor()){
result = CompositionPlaylist.SequenceTypeEnum.MainAudioSequence;
}
return result;
}

/**
* A method that returns the spoken language within this essence provided it is an Audio Essence
* @return string representing a spoken language as defined in RFC-5646
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ public static enum SequenceTypeEnum
VisuallyImpairedTextSequence("VisuallyImpairedTextSequence"),
CommentarySequence("CommentarySequence"),
KaraokeSequence("KaraokeSequence"),
AncillaryDataSequence("AncillaryDataSequence");
AncillaryDataSequence("AncillaryDataSequence"),
Unknown("Unknown");

private final String name;

Expand All @@ -607,7 +608,7 @@ private SequenceTypeEnum(String name)
this.name = name;
}

private static @Nullable SequenceTypeEnum getSequenceTypeEnum(String name)
private static SequenceTypeEnum getSequenceTypeEnum(String name)
{
switch (name)
{
Expand All @@ -628,7 +629,7 @@ private SequenceTypeEnum(String name)
case "AncillaryDataSequence":
return AncillaryDataSequence;
default:
return null;
return Unknown;
}
}

Expand Down

0 comments on commit ae26e1a

Please sign in to comment.