diff --git a/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_decoder/ObjectFactory.java b/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_decoder/ObjectFactory.java index 91e91880..50ca4eda 100644 --- a/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_decoder/ObjectFactory.java +++ b/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_decoder/ObjectFactory.java @@ -14,7 +14,7 @@ /** * This object contains factory methods for each * Java content interface and Java element interface - * generated in the org.smpte_ra.schemas._2067_101._2014.pixel_decoder package. + * generated in the org.smpte_ra.schemas._2067_101._2014.pixelDecoder package. *

An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML @@ -30,7 +30,7 @@ public class ObjectFactory { /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.smpte_ra.schemas._2067_101._2014.pixel_decoder + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.smpte_ra.schemas._2067_101._2014.pixelDecoder * */ public ObjectFactory() { diff --git a/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_encoder/ObjectFactory.java b/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_encoder/ObjectFactory.java index 4cb121d3..9a0d4f8e 100644 --- a/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_encoder/ObjectFactory.java +++ b/generated/org/smpte_ra/schemas/_2067_101/_2014/pixel_encoder/ObjectFactory.java @@ -14,7 +14,7 @@ /** * This object contains factory methods for each * Java content interface and Java element interface - * generated in the org.smpte_ra.schemas._2067_101._2014.pixel_encoder package. + * generated in the org.smpte_ra.schemas._2067_101._2014.pixelEncoder package. *

An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML @@ -30,7 +30,7 @@ public class ObjectFactory { /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.smpte_ra.schemas._2067_101._2014.pixel_encoder + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.smpte_ra.schemas._2067_101._2014.pixelEncoder * */ public ObjectFactory() { diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileList.java b/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileList.java index d0065a0f..7de3bfac 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileList.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileList.java @@ -32,6 +32,7 @@ import com.netflix.imflibrary.st2067_100.handle.VirtualTrackHandle; import com.netflix.imflibrary.st2067_100.macro.Macro; import com.netflix.imflibrary.st2067_100.macro.Sequence; +import com.netflix.imflibrary.st2067_100.macro.preset.PresetMacro; import com.netflix.imflibrary.st2067_2.ApplicationComposition; import com.netflix.imflibrary.st2067_2.Composition; import com.netflix.imflibrary.st2067_2.IMFEssenceComponentVirtualTrack; @@ -127,6 +128,11 @@ public OutputProfileList(String id, for (Map.Entry entry : this.macroMap.entrySet()) { Macro macro = entry.getValue(); if (macro != null) { + if(macro instanceof PresetMacro && this.macroMap.size() != 1) { + imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger + .IMFErrors.ErrorLevels.NON_FATAL, + String.format("OPL with id %s contains Preset Macro with other macro types", id)); + } for (Sequence input : macro.getInputs()) { if(input.getHandle().startsWith("cpl/")) { handleMap.put(input.getHandle(), new VirtualTrackHandle(input.getHandle(), null)); @@ -362,7 +368,7 @@ private void populateMacroHandles(Map handleMap) { for (Map.Entry entry : this.macroMap.entrySet()) { Macro macro = entry.getValue(); /* Check for all the input dependencies for the macro */ - if (macro != null && !handleMap.containsKey(macro.getOutputs().get(0).getHandle())) { + if (macro != null && !macro.getOutputs().isEmpty() && !handleMap.containsKey(macro.getOutputs().get(0).getHandle())) { boolean bDependencyMet = true; for (Sequence input : macro.getInputs()) { Handle handleType = handleMap.get(input.getHandle()); diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileListModel_st2067_100_2014.java b/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileListModel_st2067_100_2014.java index fc6f391b..9aa0f990 100755 --- a/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileListModel_st2067_100_2014.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/OutputProfileListModel_st2067_100_2014.java @@ -1,9 +1,9 @@ package com.netflix.imflibrary.st2067_100; import com.netflix.imflibrary.IMFErrorLogger; -import com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing.AudioRoutingMixingMacro; -import com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing.InputEntity; -import com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing.OutputAudioChannel; +import com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing.AudioRoutingMixingMacro; +import com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing.InputEntity; +import com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing.OutputAudioChannel; import com.netflix.imflibrary.st2067_100.macro.ColorEncoding; import com.netflix.imflibrary.st2067_100.macro.Macro; import com.netflix.imflibrary.st2067_100.macro.crop.CropInputImageSequence; @@ -11,12 +11,13 @@ import com.netflix.imflibrary.st2067_100.macro.crop.CropOutputImageSequence; import com.netflix.imflibrary.st2067_100.macro.crop.MXFRectangle; import com.netflix.imflibrary.st2067_100.macro.crop.RectanglePadding; -import com.netflix.imflibrary.st2067_100.macro.pixel_decoder.PixelDecoderInputImageSequence; -import com.netflix.imflibrary.st2067_100.macro.pixel_decoder.PixelDecoderMacro; -import com.netflix.imflibrary.st2067_100.macro.pixel_decoder.PixelDecoderOutputImageSequence; -import com.netflix.imflibrary.st2067_100.macro.pixel_encoder.PixelEncoderInputImageSequence; -import com.netflix.imflibrary.st2067_100.macro.pixel_encoder.PixelEncoderMacro; -import com.netflix.imflibrary.st2067_100.macro.pixel_encoder.PixelEncoderOutputImageSequence; +import com.netflix.imflibrary.st2067_100.macro.pixelDecoder.PixelDecoderInputImageSequence; +import com.netflix.imflibrary.st2067_100.macro.pixelDecoder.PixelDecoderMacro; +import com.netflix.imflibrary.st2067_100.macro.pixelDecoder.PixelDecoderOutputImageSequence; +import com.netflix.imflibrary.st2067_100.macro.pixelEncoder.PixelEncoderInputImageSequence; +import com.netflix.imflibrary.st2067_100.macro.pixelEncoder.PixelEncoderMacro; +import com.netflix.imflibrary.st2067_100.macro.pixelEncoder.PixelEncoderOutputImageSequence; +import com.netflix.imflibrary.st2067_100.macro.preset.PresetMacro; import com.netflix.imflibrary.st2067_100.macro.scale.Lanczos; import com.netflix.imflibrary.st2067_100.macro.scale.ScaleAlgorithm; import com.netflix.imflibrary.st2067_100.macro.scale.ScaleInputImageSequence; @@ -24,6 +25,7 @@ import com.netflix.imflibrary.st2067_100.macro.scale.ScaleOutputImageSequence; import jdk.nashorn.internal.ir.annotations.Immutable; import org.smpte_ra.schemas._2067_100._2014.OutputProfileListType.AliasList.Alias; +import org.smpte_ra.schemas._2067_100._2014.PresetMacroType; import org.smpte_ra.schemas._2067_101._2014.crop_macro.ImageCropMacroType; import org.smpte_ra.schemas._2067_101._2014.pixel_decoder.PixelDecoderType; import org.smpte_ra.schemas._2067_101._2014.pixel_encoder.PixelEncoderType; @@ -75,7 +77,8 @@ private OutputProfileList createNormalizedOutputProfileList () { aliasMap.put(alias.getValue(), alias.getHandle()); } - OutputProfileList normalizedOutputProfileList = new OutputProfileList( outputProfileListType.getId(), outputProfileListType.getAnnotation().getValue(), + OutputProfileList normalizedOutputProfileList = new OutputProfileList( outputProfileListType.getId(), + outputProfileListType.getAnnotation() != null ? outputProfileListType.getAnnotation().getValue() : null, outputProfileListType.getCompositionPlaylistId(), aliasMap, macroMap); this.imfErrorLogger.addAllErrors(normalizedOutputProfileList.getErrors()); @@ -99,6 +102,9 @@ else if(macroType instanceof PixelEncoderType) { else if(macroType instanceof AudioRoutingMixingMacroType) { return createAudioRoutingMixingMacro((AudioRoutingMixingMacroType) macroType); } + else if(macroType instanceof PresetMacroType) { + return createPresetMacro((PresetMacroType) macroType); + } else { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("Unknown macro type with %s in OPL", macroType.getName())); @@ -120,7 +126,8 @@ private CropMacro createCropMacro(ImageCropMacroType imageCropMacroType) { inputImageSequence.getInset().getTop().intValue(), inputImageSequence.getInset().getBottom().intValue()); - CropInputImageSequence input = new CropInputImageSequence(inputImageSequence.getAnnotation().getValue(), inputImageSequence.getHandle(), mxfRectangleEnum, inset); + CropInputImageSequence input = new CropInputImageSequence(inputImageSequence.getAnnotation() != null ? inputImageSequence.getAnnotation().getValue() : null, + inputImageSequence.getHandle(), mxfRectangleEnum, inset); if(imageCropMacroType.getOutputImageSequence() == null) { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, @@ -134,11 +141,13 @@ private CropMacro createCropMacro(ImageCropMacroType imageCropMacroType) { ColorEncoding colorEncodingEnum = ColorEncoding.fromValue(outputImageSequence.getFillColor().getClass().getName()); - CropOutputImageSequence output = new CropOutputImageSequence( outputImageSequence.getAnnotation().getValue(), + CropOutputImageSequence output = new CropOutputImageSequence( outputImageSequence.getAnnotation() != null ? outputImageSequence.getAnnotation().getValue() : null, "macros/" + imageCropMacroType.getName() + "/outputs/images", padding, colorEncodingEnum); - return new CropMacro( imageCropMacroType.getName(), imageCropMacroType.getAnnotation().getValue(), input, output); + return new CropMacro( imageCropMacroType.getName(), + imageCropMacroType.getAnnotation() != null ? imageCropMacroType.getAnnotation().getValue() : null, + input, output); } private ScaleMacro createScaleMacro(ImageScaleMacroType imageScaleMacroType) { @@ -147,7 +156,8 @@ private ScaleMacro createScaleMacro(ImageScaleMacroType imageScaleMacroType) { String.format("Missing InputImageSequence in %s macro", imageScaleMacroType.getName())); } ImageScaleMacroType.InputImageSequence inputImageSequence = imageScaleMacroType.getInputImageSequence(); - ScaleInputImageSequence input = new ScaleInputImageSequence(inputImageSequence.getAnnotation().getValue(), inputImageSequence.getHandle()); + ScaleInputImageSequence input = new ScaleInputImageSequence(inputImageSequence.getAnnotation() != null ? inputImageSequence.getAnnotation().getValue() : null, + inputImageSequence.getHandle()); if(imageScaleMacroType.getOutputImageSequence() == null) { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, @@ -162,11 +172,13 @@ private ScaleMacro createScaleMacro(ImageScaleMacroType imageScaleMacroType) { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("Unsupported scaling algorithm in %s macro", imageScaleMacroType.getName())); } - ScaleOutputImageSequence output = new ScaleOutputImageSequence( outputImageSequence.getAnnotation().getValue(), + ScaleOutputImageSequence output = new ScaleOutputImageSequence( outputImageSequence.getAnnotation() != null ? outputImageSequence.getAnnotation().getValue() : null, "macros/" + imageScaleMacroType.getName() + "/outputs/images", outputImageSequence.getWidth().intValue(), outputImageSequence.getHeight().intValue(), outputImageSequence.getBoundaryCondition(), scaleAlgorithmType); - return new ScaleMacro( imageScaleMacroType.getName(), imageScaleMacroType.getAnnotation().getValue(), input, output); + return new ScaleMacro( imageScaleMacroType.getName(), + imageScaleMacroType.getAnnotation() != null ? imageScaleMacroType.getAnnotation().getValue() : null, + input, output); } @@ -176,17 +188,20 @@ private PixelDecoderMacro createPixelDecoderMacro(PixelDecoderType pixelDecoderT String.format("Missing InputImageSequence in %s macro", pixelDecoderType.getName())); } PixelDecoderType.InputImageSequence inputImageSequence = pixelDecoderType.getInputImageSequence(); - PixelDecoderInputImageSequence input = new PixelDecoderInputImageSequence(inputImageSequence.getAnnotation().getValue(), inputImageSequence.getHandle()); + PixelDecoderInputImageSequence input = new PixelDecoderInputImageSequence(inputImageSequence.getAnnotation() != null ? inputImageSequence.getAnnotation().getValue() : null, + inputImageSequence.getHandle()); if(pixelDecoderType.getOutputReferenceImageSequence() == null) { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("Missing OutputImageSequence in %s macro", pixelDecoderType.getName())); } PixelDecoderType.OutputReferenceImageSequence outputImageSequence = pixelDecoderType.getOutputReferenceImageSequence(); - PixelDecoderOutputImageSequence output = new PixelDecoderOutputImageSequence( outputImageSequence.getAnnotation().getValue(), + PixelDecoderOutputImageSequence output = new PixelDecoderOutputImageSequence( outputImageSequence.getAnnotation() != null ? outputImageSequence.getAnnotation().getValue() : null, "macros/" + pixelDecoderType.getName() + "/outputs/images"); - return new PixelDecoderMacro(pixelDecoderType.getName(), pixelDecoderType.getAnnotation().getValue(), input, output); + return new PixelDecoderMacro(pixelDecoderType.getName(), + pixelDecoderType.getAnnotation() != null ? pixelDecoderType.getAnnotation().getValue() : null, + input, output); } private PixelEncoderMacro createPixelEncoderMacro(PixelEncoderType pixelEncoderType) { @@ -195,17 +210,20 @@ private PixelEncoderMacro createPixelEncoderMacro(PixelEncoderType pixelEncoderT String.format("Missing InputImageSequence in %s macro", pixelEncoderType.getName())); } PixelEncoderType.InputReferenceImageSequence inputImageSequence = pixelEncoderType.getInputReferenceImageSequence(); - PixelEncoderInputImageSequence input = new PixelEncoderInputImageSequence(inputImageSequence.getAnnotation().getValue(), inputImageSequence.getHandle()); + PixelEncoderInputImageSequence input = new PixelEncoderInputImageSequence(inputImageSequence.getAnnotation() != null ? inputImageSequence.getAnnotation().getValue() : null, + inputImageSequence.getHandle()); if(pixelEncoderType.getOutputImageSequence() == null) { this.imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_OPL_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("Missing OutputImageSequence in %s macro", pixelEncoderType.getName())); } PixelEncoderType.OutputImageSequence outputImageSequence = pixelEncoderType.getOutputImageSequence(); - PixelEncoderOutputImageSequence output = new PixelEncoderOutputImageSequence( outputImageSequence.getAnnotation().getValue(), + PixelEncoderOutputImageSequence output = new PixelEncoderOutputImageSequence( outputImageSequence.getAnnotation() != null ? outputImageSequence.getAnnotation().getValue() : null, "macros/" + pixelEncoderType.getName() + "/outputs/images"); - return new PixelEncoderMacro(pixelEncoderType.getName(), pixelEncoderType.getAnnotation().getValue(), input, output); + return new PixelEncoderMacro(pixelEncoderType.getName(), + pixelEncoderType.getAnnotation() != null ? pixelEncoderType.getAnnotation().getValue() : null, + input, output); } private AudioRoutingMixingMacro createAudioRoutingMixingMacro(AudioRoutingMixingMacroType audioRoutingMixingMacroType) { @@ -218,10 +236,18 @@ private AudioRoutingMixingMacro createAudioRoutingMixingMacro(AudioRoutingMixing List outputAudioChannels = new ArrayList<>(); for(OutputAudioChannelType outputAudioChannelType: outputEntityList.getOutputAudioChannel()) { List inputEntityList = outputAudioChannelType.getInputEntityList().getInputEntity().stream().map(e -> new InputEntity( "", e.getHandle(), e.getGain())).collect(Collectors.toList()); - outputAudioChannels.add(new OutputAudioChannel( outputAudioChannelType.getAnnotation().getValue(), + outputAudioChannels.add(new OutputAudioChannel( outputAudioChannelType.getAnnotation() != null ? outputAudioChannelType.getAnnotation().getValue() : null, "macros/" + audioRoutingMixingMacroType.getName() + "/outputs/" + outputAudioChannelType.getHandle(), inputEntityList)); } - return new AudioRoutingMixingMacro(audioRoutingMixingMacroType.getName(), audioRoutingMixingMacroType.getAnnotation().getValue(), outputAudioChannels); + return new AudioRoutingMixingMacro(audioRoutingMixingMacroType.getName(), + audioRoutingMixingMacroType.getAnnotation() != null ? audioRoutingMixingMacroType.getAnnotation().getValue() : null, + outputAudioChannels); + } + + private PresetMacro createPresetMacro(PresetMacroType presetMacroType) { + return new PresetMacro(presetMacroType.getName(), + presetMacroType.getAnnotation() != null ? presetMacroType.getAnnotation().getValue() : null, + presetMacroType.getPreset()); } } \ No newline at end of file diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/AudioRoutingMixingMacro.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/AudioRoutingMixingMacro.java index 649e3997..e2018bad 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/AudioRoutingMixingMacro.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/AudioRoutingMixingMacro.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing; +package com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing; import com.netflix.imflibrary.st2067_100.macro.Macro; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/InputEntity.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/InputEntity.java index e67ef9ff..c0523d32 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/InputEntity.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/InputEntity.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing; +package com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/OutputAudioChannel.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/OutputAudioChannel.java index 36588fe7..5a022eb2 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/OutputAudioChannel.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/AudioRoutingMixing/OutputAudioChannel.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.AudioRoutingMixing; +package com.netflix.imflibrary.st2067_100.macro.audioRoutingMixing; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderInputImageSequence.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderInputImageSequence.java similarity index 93% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderInputImageSequence.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderInputImageSequence.java index 1afa081b..dbee653c 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderInputImageSequence.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderInputImageSequence.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_decoder; +package com.netflix.imflibrary.st2067_100.macro.pixelDecoder; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderMacro.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderMacro.java similarity index 95% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderMacro.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderMacro.java index 2140c292..0cfde829 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderMacro.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderMacro.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_decoder; +package com.netflix.imflibrary.st2067_100.macro.pixelDecoder; import com.netflix.imflibrary.st2067_100.macro.Macro; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderOutputImageSequence.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderOutputImageSequence.java similarity index 93% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderOutputImageSequence.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderOutputImageSequence.java index be5cce28..1e33760a 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_decoder/PixelDecoderOutputImageSequence.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelDecoder/PixelDecoderOutputImageSequence.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_decoder; +package com.netflix.imflibrary.st2067_100.macro.pixelDecoder; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderInputImageSequence.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderInputImageSequence.java similarity index 93% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderInputImageSequence.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderInputImageSequence.java index 6f8b817b..35dee05e 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderInputImageSequence.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderInputImageSequence.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_encoder; +package com.netflix.imflibrary.st2067_100.macro.pixelEncoder; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderMacro.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderMacro.java similarity index 95% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderMacro.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderMacro.java index 4ecebe77..3cdd567a 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderMacro.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderMacro.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_encoder; +package com.netflix.imflibrary.st2067_100.macro.pixelEncoder; import com.netflix.imflibrary.st2067_100.macro.Macro; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderOutputImageSequence.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderOutputImageSequence.java similarity index 93% rename from src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderOutputImageSequence.java rename to src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderOutputImageSequence.java index 7d12508d..68ab7647 100644 --- a/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixel_encoder/PixelEncoderOutputImageSequence.java +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/pixelEncoder/PixelEncoderOutputImageSequence.java @@ -16,7 +16,7 @@ * */ -package com.netflix.imflibrary.st2067_100.macro.pixel_encoder; +package com.netflix.imflibrary.st2067_100.macro.pixelEncoder; import com.netflix.imflibrary.st2067_100.macro.Sequence; diff --git a/src/main/java/com/netflix/imflibrary/st2067_100/macro/preset/PresetMacro.java b/src/main/java/com/netflix/imflibrary/st2067_100/macro/preset/PresetMacro.java new file mode 100644 index 00000000..73dedaea --- /dev/null +++ b/src/main/java/com/netflix/imflibrary/st2067_100/macro/preset/PresetMacro.java @@ -0,0 +1,39 @@ +/* + * + * Copyright 2016 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.netflix.imflibrary.st2067_100.macro.preset; + +import com.netflix.imflibrary.st2067_100.macro.Macro; +import com.netflix.imflibrary.st2067_100.macro.Sequence; + +import javax.annotation.concurrent.Immutable; +import java.util.ArrayList; + +@Immutable +public class PresetMacro extends Macro { + private final String preset; + + public PresetMacro(String name, String annotaion, String preset) { + super(name, annotaion, new ArrayList(), new ArrayList()); + this.preset = preset; + } + + public String getPreset() { + return preset; + } +} diff --git a/src/test/java/com/netflix/imflibrary/st2067_100/OutputProfileListTest.java b/src/test/java/com/netflix/imflibrary/st2067_100/OutputProfileListTest.java index c6449bb5..220c0c73 100644 --- a/src/test/java/com/netflix/imflibrary/st2067_100/OutputProfileListTest.java +++ b/src/test/java/com/netflix/imflibrary/st2067_100/OutputProfileListTest.java @@ -2,6 +2,7 @@ import com.netflix.imflibrary.IMFErrorLogger; import com.netflix.imflibrary.IMFErrorLoggerImpl; +import com.netflix.imflibrary.st2067_100.macro.preset.PresetMacro; import com.netflix.imflibrary.st2067_2.ApplicationComposition; import com.netflix.imflibrary.st2067_2.ApplicationCompositionFactory; import com.netflix.imflibrary.utils.FileByteRangeProvider; @@ -14,6 +15,22 @@ @Test(groups = "unit") public class OutputProfileListTest { + @Test + public void testSimpleOutputProfileList() throws Exception + { + File inputFile = TestHelper.findResourceByPath("TestIMP/OPL/OPL_8cf83c32-4949-4f00-b081-01e12b18932f_simple.xml"); + IMFErrorLogger imfErrorLogger = new IMFErrorLoggerImpl(); + OutputProfileList outputProfileList = OutputProfileList.getOutputProfileListType(new FileByteRangeProvider(inputFile), imfErrorLogger); + + Assert.assertEquals(outputProfileList.getCompositionPlaylistId().toString(), "0eb3d1b9-b77b-4d3f-bbe5-7c69b15dca85"); + Assert.assertEquals(outputProfileList.getAnnotation().toString(), "OPL Example"); + Assert.assertEquals(outputProfileList.getId().toString(), "8cf83c32-4949-4f00-b081-01e12b18932f"); + Assert.assertEquals(((PresetMacro)outputProfileList.getMacroMap().entrySet().iterator().next().getValue()).getPreset(), "playback_cpl"); + Assert.assertEquals(outputProfileList.getErrors().size(), 0); + + Assert.assertEquals(outputProfileList.getMacroMap().size(), 1); + } + @Test public void testOutputProfileList() throws Exception { diff --git a/src/test/resources/TestIMP/OPL/OPL_8cf83c32-4949-4f00-b081-01e12b18932f_simple.xml b/src/test/resources/TestIMP/OPL/OPL_8cf83c32-4949-4f00-b081-01e12b18932f_simple.xml new file mode 100755 index 00000000..18ff2164 --- /dev/null +++ b/src/test/resources/TestIMP/OPL/OPL_8cf83c32-4949-4f00-b081-01e12b18932f_simple.xml @@ -0,0 +1,27 @@ + + urn:uuid:8cf83c32-4949-4f00-b081-01e12b18932f + OPL Example + 2016-06-14T19:22:37-00:00 + Clipster 5.9.3.7 (build 96012) + Clipster 5.9.3.7 (build 96012) + urn:uuid:0eb3d1b9-b77b-4d3f-bbe5-7c69b15dca85 + + + + preset-macro + playback_cpl + + +