for (PartitionPack partitionPack : allPartitionPacks) if (partitionPack.hasEssenceContainer()) if (bodySIDs.contains(partitionPack.getBodySID())) else if (partitionPack.hasIndexTableSegments()) if (indexSIDs.contains(partitionPack.getIndexSID())) else if(partitionPack.getPartitionPackType() == PartitionPack.PartitionPackType.HeaderPartitionPack || partitionPack.getPartitionPackType() == PartitionPack.PartitionPackType.FooterPartitionPack)
byte[] bytes = partitionPack.getOperationalPattern(); for (int i=0; i< bytes.length; i++) if (partitionPack.getNumberOfEssenceContainerULs() < 1) partitionPack.getNumberOfEssenceContainerULs()));
if (partitionPack.hasHeaderMetadata()) if (partitionPack.hasEssenceContainer() || partitionPack.hasIndexTableSegments()) partitionPack.getPartitionByteOffset(), partitionPack.hasEssenceContainer(), partitionPack.hasIndexTableSegments())); else if (partitionPack.hasEssenceContainer()) if (partitionPack.hasHeaderMetadata() || partitionPack.hasIndexTableSegments()) partitionPack.getPartitionByteOffset(), partitionPack.hasHeaderMetadata(), partitionPack.hasIndexTableSegments())); else if (partitionPack.hasIndexTableSegments()) if (partitionPack.hasEssenceContainer() || partitionPack.hasHeaderMetadata()) partitionPack.getPartitionByteOffset(), partitionPack.hasEssenceContainer(), partitionPack.hasHeaderMetadata()));
/** * Getter for the partition data byte offset. * * @return the partition data byte offset */ public long getPartitionDataByteOffset() { if (this.nextPacketIsKLVFillItem()) { return this.this_partition + this.getSize() + this.nextHeader.getKLSize() + this.nextHeader.getVSize(); } else { return this.this_partition + this.getSize(); } }
this.partitionPack = new PartitionPack(byteProvider, IMF_MXF_HEADER_PARTITION_OFFSET, false, imfErrorLogger); if(!this.partitionPack.isValidHeaderPartition()) numBytesRead += this.partitionPack.getKLVPacketSize(); Long byteOffsetOfNextKLVPacket = byteOffset + numBytesRead;
partitionPack = new PartitionPack(byteProvider, inclusivePartitionStart, false); if (partitionPack.hasIndexTableSegments())
validateHeaderKey(); handleError(imfErrorLogger, errorMessage); handleError(imfErrorLogger, errorMessage); handleError(imfErrorLogger, errorMessage); handleError(imfErrorLogger, errorMessage); handleError(imfErrorLogger, errorMessage); handleError(imfErrorLogger, errorMessage);
private PartitionPack getPartitionPack(long resourceOffset) throws IOException { long archiveFileSize = this.resourceByteRangeProvider.getResourceSize(); KLVPacket.Header header; {//logic to provide as an input stream the portion of the archive that contains PartitionPack KLVPacker Header long rangeEnd = resourceOffset + (KLVPacket.KEY_FIELD_SIZE + KLVPacket.LENGTH_FIELD_SUFFIX_MAX_SIZE) -1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); File fileWithPartitionPackKLVPacketHeader = this.resourceByteRangeProvider.getByteRange(resourceOffset, rangeEnd, this.workingDirectory); ByteProvider byteProvider = this.getByteProvider(fileWithPartitionPackKLVPacketHeader); header = new KLVPacket.Header(byteProvider, resourceOffset); } PartitionPack partitionPack; {//logic to provide as an input stream the portion of the archive that contains a PartitionPack and next KLV header long rangeEnd = resourceOffset + (KLVPacket.KEY_FIELD_SIZE + header.getLSize() + header.getVSize()) + (KLVPacket.KEY_FIELD_SIZE + KLVPacket.LENGTH_FIELD_SUFFIX_MAX_SIZE) + -1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); File fileWithPartitionPack = this.resourceByteRangeProvider.getByteRange(resourceOffset, rangeEnd, this.workingDirectory); ByteProvider byteProvider = this.getByteProvider(fileWithPartitionPack); partitionPack = new PartitionPack(byteProvider, resourceOffset, true); } return partitionPack; }
List<String> getPartitionPacksType(@Nonnull IMFErrorLogger imfErrorLogger) throws IOException { if (this.partitionPacks == null) { setPartitionPacks(imfErrorLogger); } ArrayList<String> partitionPackTypeString = new ArrayList<String>(); for(PartitionPack partitionPack : this.partitionPacks){ partitionPackTypeString.add(partitionPack.getPartitionPackType().getPartitionTypeString()); } return Collections.unmodifiableList(partitionPackTypeString); }
PartitionPack partitionPack = new PartitionPack(new ByteArrayDataProvider(payloadRecord.getPayload())); if (partitionPack.hasIndexTableSegments())
private PartitionPack getPartitionPack(long resourceOffset) throws IOException { long archiveFileSize = this.resourceByteRangeProvider.getResourceSize(); KLVPacket.Header header; {//logic to provide as an input stream the portion of the archive that contains PartitionPack KLVPacker Header long rangeEnd = resourceOffset + (KLVPacket.KEY_FIELD_SIZE + KLVPacket.LENGTH_FIELD_SUFFIX_MAX_SIZE) -1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); File fileWithPartitionPackKLVPacketHeader = this.resourceByteRangeProvider.getByteRange(resourceOffset, rangeEnd, this.workingDirectory); ByteProvider byteProvider = this.getByteProvider(fileWithPartitionPackKLVPacketHeader); header = new KLVPacket.Header(byteProvider, resourceOffset); } PartitionPack partitionPack; {//logic to provide as an input stream the portion of the archive that contains a PartitionPack and next KLV header long rangeEnd = resourceOffset + (KLVPacket.KEY_FIELD_SIZE + header.getLSize() + header.getVSize()) + (KLVPacket.KEY_FIELD_SIZE + KLVPacket.LENGTH_FIELD_SUFFIX_MAX_SIZE) + -1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); File fileWithPartitionPack = this.resourceByteRangeProvider.getByteRange(resourceOffset, rangeEnd, this.workingDirectory); ByteProvider byteProvider = this.getByteProvider(fileWithPartitionPack); partitionPack = new PartitionPack(byteProvider, resourceOffset, true); } return partitionPack; }
private static PartitionPack getPartitionPack(ResourceByteRangeProvider resourceByteRangeProvider, long resourceOffset) throws IOException { long archiveFileSize = resourceByteRangeProvider.getResourceSize(); KLVPacket.Header header; {//logic to provide as an input stream the portion of the archive that contains PartitionPack KLVPacker Header long rangeStart = resourceOffset; long rangeEnd = resourceOffset + (KLVPacket.KEY_FIELD_SIZE + KLVPacket.LENGTH_FIELD_SUFFIX_MAX_SIZE) -1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); byte[] bytesWithPartitionPackKLVPacketHeader = resourceByteRangeProvider.getByteRangeAsBytes(rangeStart, rangeEnd); ByteProvider imfEssenceComponentByteProvider = new ByteArrayDataProvider(bytesWithPartitionPackKLVPacketHeader); header = new KLVPacket.Header(imfEssenceComponentByteProvider, rangeStart); } PartitionPack partitionPack; long rangeStart = resourceOffset; long rangeEnd = resourceOffset + header.getKLSize() + header.getVSize() - 1; rangeEnd = rangeEnd < (archiveFileSize - 1) ? rangeEnd : (archiveFileSize - 1); byte[] partitionBytes = resourceByteRangeProvider.getByteRangeAsBytes(rangeStart, rangeEnd); partitionPack = new PartitionPack(new ByteArrayDataProvider(partitionBytes)); return partitionPack; }