Codota Logo
HeaderPartition
Code IndexAdd Codota to your IDE (free)

How to use
HeaderPartition
in
com.netflix.imflibrary.st0377

Best Java code snippets using com.netflix.imflibrary.st0377.HeaderPartition (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: Netflix/photon

/**
 * A method that returns an object model of the HeaderPartition in the Essence
 * @return Header partition in the essence
 * @throws IOException - any I/O related error will be exposed through an IOException
 */
public HeaderPartition getHeaderPartition() throws IOException{
  RandomIndexPack randomIndexPack = this.getRandomIndexPack();
  List<Long> allPartitionByteOffsets = randomIndexPack.getAllPartitionByteOffsets();
  long inclusiveRangeStart = allPartitionByteOffsets.get(0);
  long inclusiveRangeEnd = allPartitionByteOffsets.get(1) - 1;
  File fileWithHeaderPartition = this.resourceByteRangeProvider.getByteRange(inclusiveRangeStart, inclusiveRangeEnd, this.workingDirectory);
  ByteProvider byteProvider = this.getByteProvider(fileWithHeaderPartition);
  HeaderPartition headerPartition = new HeaderPartition(byteProvider, inclusiveRangeStart, inclusiveRangeEnd - inclusiveRangeStart + 1, this.imfErrorLogger);
  return headerPartition;
}
origin: Netflix/photon

/**
 * A method that returns the Channel ID to AudioChannelLabelSubDescriptor
 * @return Channel ID to AudioChannelLabelSubDescriptor mapping
 */
@Nullable
public Map<Long, AudioChannelLabelSubDescriptor> getAudioChannelIDToMCASubDescriptorMap() {
  List<InterchangeObject> subDescriptors = getAudioChannelLabelSubDescriptors();
  Map<Long, AudioChannelLabelSubDescriptor> audioChannelLabelSubDescriptorMap = new HashMap<>();
  subDescriptors.stream()
      .map(e -> AudioChannelLabelSubDescriptor.class.cast(e))
      .forEach(e -> audioChannelLabelSubDescriptorMap.put(e.getMCAChannelId() == null? 1 : e.getMCAChannelId(), e));
  return audioChannelLabelSubDescriptorMap;
}
origin: Netflix/photon

/**
 * A getter for the AudioEssence Language
 * @param imfErrorLogger an error logger for recording any errors - cannot be null
 * @return a string representing the language code in the Audio Essence
 * @throws IOException - any I/O related error is exposed through an IOException
 */
String getAudioEssenceLanguage(@Nonnull IMFErrorLogger imfErrorLogger) throws IOException {
  return this.getHeaderPartition(imfErrorLogger).getAudioEssenceSpokenLanguage();
}
origin: Netflix/photon

private static Map<UUID, PayloadRecord> getTrackFileIdToHeaderPartitionPayLoadMap(List<PayloadRecord>
                                      headerPartitionPayloadRecords) throws
    IOException {
  IMFErrorLogger imfErrorLogger = new IMFErrorLoggerImpl();
  Map<UUID, PayloadRecord> trackFileIDMap = new HashMap<>();
  for (PayloadRecord payloadRecord : headerPartitionPayloadRecords) {
    if (payloadRecord.getPayloadAssetType() != PayloadRecord.PayloadAssetType.EssencePartition) {
      imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMP_VALIDATOR_PAYLOAD_ERROR,
          IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,
          String.format("Payload asset type is %s, expected asset type %s", payloadRecord.getPayloadAssetType(),
              PayloadRecord.PayloadAssetType.EssencePartition.toString()));
      continue;
    }
    HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
      0L,
      (long) payloadRecord.getPayload().length,
      imfErrorLogger);
    Preface preface = headerPartition.getPreface();
    GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
    SourcePackage filePackage = (SourcePackage) genericPackage;
    UUID packageUUID = filePackage.getPackageMaterialNumberasUUID();
    trackFileIDMap.put(packageUUID, payloadRecord);
  }
  return Collections.unmodifiableMap(trackFileIDMap);
}
origin: Netflix/photon

Preface preface = headerPartition.getPreface();
GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
SourcePackage filePackage;
          if (headerPartition.getAudioEssenceSpokenLanguage() == null) {
            imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CORE_CONSTRAINTS_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, IMFConstraints.IMF_ESSENCE_EXCEPTION_PREFIX + String.format("WaveAudioEssenceDescriptor in the IMFTrackFile represented by ID %s does not have a RFC5646 spoken language indicated, language code shall be set in the SoundFieldGroupLabelSubDescriptor, unless the AudioEssence does not have a primary spoken language.", packageID.toString()));
          } else {
            if (!IMFConstraints.isSpokenLanguageRFC5646Compliant(headerPartition.getAudioEssenceSpokenLanguage())) {
              List<String> strings = IMFConstraints.getPrimarySpokenLanguageUnicodeString(headerPartition.getAudioEssenceSpokenLanguage());
              imfErrorLogger.addError(new ErrorLogger.ErrorObject(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_ESSENCE_COMPONENT_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, String.format("Language Code (%s) in SoundFieldGroupLabelSubdescriptor in the IMFTrackfile represented by ID %s is not RFC5646 compliant", strings, packageID.toString())));
            imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CORE_CONSTRAINTS_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, IMFConstraints.IMF_ESSENCE_EXCEPTION_PREFIX + String.format("WaveAudioEssenceDescriptor indicates that the Audio Essence within an Audio Track File is not Wave Clip-Wrapped in the IMFTrackFile represented by ID %s.", packageID.toString()));
          List<InterchangeObject.InterchangeObjectBO> subDescriptors = headerPartition.getSubDescriptors();
          } else {
            Map<Long, AudioChannelLabelSubDescriptor> audioChannelLabelSubDescriptorMap = headerPartition.getAudioChannelIDToMCASubDescriptorMap();
            if (waveAudioEssenceDescriptor.getChannelCount() != audioChannelLabelSubDescriptorMap.size()) {
              imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CORE_CONSTRAINTS_ERROR, IMFErrorLogger.IMFErrors.ErrorLevels.NON_FATAL, IMFConstraints.IMF_ESSENCE_EXCEPTION_PREFIX +
                    String.format("WaveAudioEssenceDescriptor in the IMFTrackFile represented by ID %s refers to a SoundFieldGroupLabelSubDescriptor that is missing one/all of MCATitle, MCATitleVersion, MCAAudioContentKind, MCAAudioElementKind, %n%s.", packageID.toString(), soundFieldGroupLabelSubDescriptorBO.toString()));
              SoundFieldGroupLabelSubDescriptor soundFieldGroupLabelSubDescriptor = (SoundFieldGroupLabelSubDescriptor) headerPartition.getSoundFieldGroupLabelSubDescriptors()
                  .get(0);
              List<InterchangeObject> audioChannelLabelSubDescriptors = headerPartition.getAudioChannelLabelSubDescriptors();
origin: Netflix/photon

ResourceByteRangeProvider resourceByteRangeProvider = new ByteArrayByteRangeProvider(imfTrackFileMetadata.getHeaderPartition());
HeaderPartition headerPartition = new HeaderPartition(byteProvider, 0L, (long) imfTrackFileMetadata.getHeaderPartition().length, imfErrorLogger);
List<InterchangeObject.InterchangeObjectBO> essenceDescriptors = headerPartition.getEssenceDescriptors();
for (InterchangeObject.InterchangeObjectBO essenceDescriptor : essenceDescriptors) {
  KLVPacket.Header essenceDescriptorHeader = essenceDescriptor.getHeader();
  List<KLVPacket.Header> subDescriptorHeaders = new ArrayList<>();
  List<InterchangeObject.InterchangeObjectBO> subDescriptors = headerPartition.getSubDescriptors(essenceDescriptor);
  for (InterchangeObject.InterchangeObjectBO subDescriptorBO : subDescriptors) {
    if (subDescriptorBO != null) {
  Document document = docBuilder.newDocument();
  RegXMLLibHelper regXMLLibHelper = new RegXMLLibHelper(headerPartition.getPrimerPack().getHeader(), getByteProvider(resourceByteRangeProvider, headerPartition.getPrimerPack().getHeader()));
origin: Netflix/photon

      InterchangeObject.InterchangeObjectBO interchangeObjectBO = this.constructInterchangeObjectBO(clazz, header, byteProvider, this.primerPack.getLocalTagEntryBatch().getLocalTagToUIDMap(), imfErrorLogger);
      List<InterchangeObject.InterchangeObjectBO> list = this.interchangeObjectBOsMap.get(interchangeObjectBO.getClass().getSimpleName());
      if(list == null){
List<Node> resolvedList = resolve(nodeList);
      && !interchangeObjectBO.getClass().equals(Sequence.SequenceBO.class)
      && !interchangeObjectBO.getClass().equals(TimedTextDescriptor.TimedTextDescriptorBO.class)){
    InterchangeObject interchangeObject = this.constructInterchangeObject(interchangeObjectBO.getClass().getEnclosingClass(), interchangeObjectBO, node);
    this.cacheInterchangeObject(interchangeObject);
    this.uidToMetadataSets.put(interchangeObjectBO.getInstanceUID(), interchangeObject);
    if (interchangeObjectBO instanceof GenericPackage.GenericPackageBO) {
      this.cacheInterchangeObject(sourceClip);
      uidToMetadataSets.put(interchangeObjectBO.getInstanceUID(), sourceClip);
    } else if (interchangeObjectBO.getClass().getEnclosingClass().equals(Sequence.class)) {
      this.cacheInterchangeObject(sequence);
      uidToMetadataSets.put(interchangeObjectBO.getInstanceUID(), sequence);
    } else if (interchangeObjectBO.getClass().getEnclosingClass().equals(TimelineTrack.class)) {
        this.cacheInterchangeObject(timelineTrack);
        uidToMetadataSets.put(interchangeObjectBO.getInstanceUID(), timelineTrack);
      this.cacheInterchangeObject(sourcePackage);
      uidToMetadataSets.put(interchangeObjectBO.getInstanceUID(), sourcePackage);
      uidToMetadataSets.put(((SourcePackage.SourcePackageBO) interchangeObjectBO).getPackageUID(), sourcePackage);
      this.cacheInterchangeObject(materialPackage);
origin: Netflix/photon

Preface preface = headerPartition.getPreface();
String trackFileID_Prefix = "";
if(preface != null) {
  if (headerPartition.getContentStorageList().size() != 1)
        headerPartition.getContentStorageList().size()));
  if (headerPartition.getEssenceContainerDataList().size() != 1)
        headerPartition.getEssenceContainerDataList().size()));
if (headerPartition.getMaterialPackages().size() != 1)
      headerPartition.getMaterialPackages().size()));
  MaterialPackage materialPackage = (MaterialPackage)headerPartition.getMaterialPackages().get(0);
  MaterialPackage materialPackage = (MaterialPackage)headerPartition.getMaterialPackages().get(0);
  for (TimelineTrack timelineTrack : materialPackage.getTimelineTracks())
origin: Netflix/photon

          ()), imfErrorLogger);
HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
  0L,
  (long) payloadRecord.getPayload().length,
  imfErrorLogger);
audioLanguageSet.add(headerPartition.getAudioEssenceSpokenLanguage());
origin: Netflix/photon

/**
 * A method that returns a list of EssenceDescriptor objects referenced by the Source Packages in this HeaderPartition
 * @param imfErrorLogger an error logger for recording any errors - cannot be null
 * @return List<InterchangeObjectBO></> corresponding to every EssenceDescriptor in the underlying resource
 * @throws IOException - any I/O related error will be exposed through an IOException
 */
List<InterchangeObject.InterchangeObjectBO> getEssenceDescriptors(@Nonnull IMFErrorLogger imfErrorLogger) throws IOException {
  return this.getHeaderPartition(imfErrorLogger).getEssenceDescriptors();
}
origin: Netflix/photon

HeaderPartition headerPartition = null;
try {
  headerPartition = new HeaderPartition(byteProvider, inclusiveRangeStart, inclusiveRangeEnd - inclusiveRangeStart + 1, imfErrorLogger);
    Preface preface = headerPartition.getPreface();
    GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
    SourcePackage filePackage = (SourcePackage) genericPackage;
origin: Netflix/photon

/**
 * A method that returns a list of EssenceDescriptor objects referenced by the Source Packages in the Essence
 *
 * @return List of Object model representations corresponding to every EssenceDescriptor in the essence
 * @throws IOException - any I/O related error will be exposed through an IOException
 */
public List<? extends InterchangeObject.InterchangeObjectBO> getEssenceDescriptors() throws IOException{
  return this.getHeaderPartition().getEssenceDescriptors();
}
origin: Netflix/photon

          ()), imfErrorLogger);
HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
    0L,
    (long) payloadRecord.getPayload().length,
    imfErrorLogger);
Preface preface = headerPartition.getPreface();
GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
SourcePackage filePackage = (SourcePackage) genericPackage;
origin: DSRCorporation/imf-conversion

private List<ErrorObject> validateMxf(File mxf) {
  return doValidate(ErrorCodes.IMF_ESSENCE_COMPONENT_ERROR,
      imfErrorLogger -> {
        PayloadRecord headerPartitionPayloadRecord = getHeaderPartition(mxf, imfErrorLogger);
        if (!imfErrorLogger.getErrors().isEmpty() || (headerPartitionPayloadRecord == null)) {
          return imfErrorLogger.getErrors();
        }
        HeaderPartition headerPartition = new HeaderPartition(
            new ByteArrayDataProvider(headerPartitionPayloadRecord.getPayload()),
            0L,
            (long) headerPartitionPayloadRecord.getPayload().length,
            imfErrorLogger);
        MXFOperationalPattern1A.HeaderPartitionOP1A headerPartitionOP1A =
            MXFOperationalPattern1A.checkOperationalPattern1ACompliance(headerPartition);
        IMFConstraints.checkIMFCompliance(headerPartitionOP1A);
        return imfErrorLogger.getErrors();
      });
}
origin: Netflix/photon

/**
 * Returns the EditRate as a list containing the numerator and denominator
 * @param imfErrorLogger an error logger for recording any errors - cannot be null
 * @return editRate of the essence as a List of Long Integers
 */
List<Long> getEssenceEditRateAsList(@Nonnull IMFErrorLogger imfErrorLogger) throws IOException {
  if(!(this.getHeaderPartition(imfErrorLogger).getEssenceDescriptors().size() > 0)){
    throw new MXFException(String.format("No EssenceDescriptors were found in the MXF essence"));
  }
  FileDescriptor.FileDescriptorBO fileDescriptorBO = (FileDescriptor.FileDescriptorBO) this.getHeaderPartition(imfErrorLogger).getEssenceDescriptors().get(0);
  return fileDescriptorBO.getSampleRate();
}
origin: Netflix/photon

/**
 * 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
 * @throws IOException - any I/O related error is exposed through an IOException
 */
public String getAudioEssenceSpokenLanguage() throws IOException {
  return this.getHeaderPartition().getAudioEssenceSpokenLanguage();
}
origin: Netflix/photon

HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
    0L,
    (long) payloadRecord.getPayload().length,
Preface preface = headerPartitionIMF.getHeaderPartitionOP1A().getHeaderPartition().getPreface();
GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
SourcePackage filePackage = (SourcePackage) genericPackage;
origin: Netflix/photon

  continue;
headerPartitionTuples.add(new Composition.HeaderPartitionTuple(new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
    0L,
    (long) payloadRecord.getPayload().length,
origin: Netflix/photon

/**
 * A method that retrieves all the EssenceTypes present in the MXF file
 * @return a list of all essence types present in the MXF file
 */
public List<EssenceTypeEnum> getEssenceTypes() {
  List<EssenceTypeEnum> essenceTypes = new ArrayList<>();
  for(InterchangeObject.InterchangeObjectBO interchangeObjectBO : this.getEssenceDescriptors()){
    if(interchangeObjectBO.getClass().getEnclosingClass().equals(WaveAudioEssenceDescriptor.class)){
      essenceTypes.add(EssenceTypeEnum.MainAudioEssence);
    }
    else if(interchangeObjectBO.getClass().getEnclosingClass().equals(CDCIPictureEssenceDescriptor.class)){
      essenceTypes.add(EssenceTypeEnum.MainImageEssence);
    }
    else if(interchangeObjectBO.getClass().getEnclosingClass().equals(RGBAPictureEssenceDescriptor.class)){
      essenceTypes.add(EssenceTypeEnum.MainImageEssence);
    }
    else if(interchangeObjectBO.getClass().getEnclosingClass().equals(TimedTextDescriptor.class)){
      essenceTypes.add(EssenceTypeEnum.SubtitlesEssence);
    }
  }
  if (essenceTypes.size() == 0){
    List<EssenceTypeEnum> essenceTypeList = new ArrayList<>();
    essenceTypeList.add(EssenceTypeEnum.UnsupportedEssence);
    return Collections.unmodifiableList(essenceTypeList);
  }
  else{
    return Collections.unmodifiableList(essenceTypes);
  }
}
origin: Netflix/photon

headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()),
  0L,
  (long)payloadRecord.getPayload().length,
  Preface preface = headerPartition.getPreface();
  GenericPackage genericPackage = preface.getContentStorage().getEssenceContainerDataList().get(0).getLinkedPackage();
  SourcePackage filePackage = (SourcePackage) genericPackage;
com.netflix.imflibrary.st0377HeaderPartition

Javadoc

This class corresponds to an object model for the Header Partition construct defined in st377-1:2011

Most used methods

  • <init>
    Instantiates a new MXF Header partition.
  • cacheInterchangeObject
    A helper method to cache an InterchangeObject
  • constructInterchangeObject
    A factory method to reflectively construct InterchangeObject types by classname
  • constructInterchangeObjectBO
    A factory method to reflectively construct InterchangeObjectBO types by classname and argument list
  • getAudioChannelIDToMCASubDescriptorMap
    A method that returns the Channel ID to AudioChannelLabelSubDescriptor
  • getAudioChannelLabelSubDescriptors
    Gets all the audio channel label sub descriptors associated with this HeaderPartition object
  • getAudioEssenceSpokenLanguage
    A method that returns the spoken language within this essence provided it is an Audio Essence
  • getContentStorageList
    Gets all of the ContentStorage objects corresponding to this HeaderPartition object
  • getEssenceContainerDataList
    Gets all of the EssenceContainerData objects corresponding to this HeaderPartition object
  • getEssenceDescriptors
    Gets all of the EssenceDescriptor objects corresponding to this HeaderPartition object that are refe
  • getEssenceDuration
    Returns the largest duration of all the TimelineTracks within the first (in parsing order) Material
  • getEssenceTypes
    A method that retrieves all the EssenceTypes present in the MXF file
  • getEssenceDuration,
  • getEssenceTypes,
  • getImagePixelBitDepth,
  • getInterchangeObjectBOs,
  • getInterchangeObjects,
  • getMaterialPackages,
  • getPartitionPack,
  • getPreface,
  • getPrimerPack,
  • getSoundFieldGroupLabelSubDescriptors

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Join (org.hibernate.mapping)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now