/** * 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; }
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); }
ResourceByteRangeProvider resourceByteRangeProvider = new ByteArrayByteRangeProvider(imfTrackFileMetadata.getHeaderPartition()); HeaderPartition headerPartition = new HeaderPartition(byteProvider, 0L, (long) imfTrackFileMetadata.getHeaderPartition().length, imfErrorLogger);
()), imfErrorLogger); HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()), 0L, (long) payloadRecord.getPayload().length,
()), imfErrorLogger); HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()), 0L, (long) payloadRecord.getPayload().length,
HeaderPartition headerPartition = null; try { headerPartition = new HeaderPartition(byteProvider, inclusiveRangeStart, inclusiveRangeEnd - inclusiveRangeStart + 1, imfErrorLogger);
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(); }); }
HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()), 0L, (long) payloadRecord.getPayload().length,
continue; headerPartitionTuples.add(new Composition.HeaderPartitionTuple(new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()), 0L, (long) payloadRecord.getPayload().length,
headerPartition = new HeaderPartition(new ByteArrayDataProvider(payloadRecord.getPayload()), 0L, (long)payloadRecord.getPayload().length,
HeaderPartition headerPartition = new HeaderPartition(new ByteArrayDataProvider(headerPartitionPayloadRecord.getPayload()), 0L, (long) headerPartitionPayloadRecord.getPayload().length,