All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mp4parser.boxes.iso14496.part12.CompositionToDecodeBox Maven / Gradle / Ivy

Go to download

A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)

There is a newer version: 1.9.56
Show newest version
package org.mp4parser.boxes.iso14496.part12;

import org.mp4parser.support.AbstractFullBox;

import java.nio.ByteBuffer;

/**
 * 

4cc = "{@value #TYPE}"

*

* The optional composition shift least greatest atom summarizes the calculated * minimum and maximum offsets between decode and composition time, as well as * the start and end times, for all samples. This allows a reader to determine * the minimum required time for decode to obtain proper presentation order without * needing to scan the sample table for the range of offsets. The type of the * composition shift least greatest atom is ‘cslg’.

*/ public class CompositionToDecodeBox extends AbstractFullBox { public static final String TYPE = "cslg"; // A 32-bit unsigned integer that specifies the calculated value. int compositionOffsetToDisplayOffsetShift; // A 32-bit signed integer that specifies the calculated value. int leastDisplayOffset; // A 32-bit signed integer that specifies the calculated value. int greatestDisplayOffset; //A 32-bit signed integer that specifies the calculated value. int displayStartTime; //A 32-bit signed integer that specifies the calculated value. int displayEndTime; public CompositionToDecodeBox() { super(TYPE); } @Override protected long getContentSize() { return 24; } @Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); compositionOffsetToDisplayOffsetShift = content.getInt(); leastDisplayOffset = content.getInt(); greatestDisplayOffset = content.getInt(); displayStartTime = content.getInt(); displayEndTime = content.getInt(); } @Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); byteBuffer.putInt(compositionOffsetToDisplayOffsetShift); byteBuffer.putInt(leastDisplayOffset); byteBuffer.putInt(greatestDisplayOffset); byteBuffer.putInt(displayStartTime); byteBuffer.putInt(displayEndTime); } public int getCompositionOffsetToDisplayOffsetShift() { return compositionOffsetToDisplayOffsetShift; } public void setCompositionOffsetToDisplayOffsetShift(int compositionOffsetToDisplayOffsetShift) { this.compositionOffsetToDisplayOffsetShift = compositionOffsetToDisplayOffsetShift; } public int getLeastDisplayOffset() { return leastDisplayOffset; } public void setLeastDisplayOffset(int leastDisplayOffset) { this.leastDisplayOffset = leastDisplayOffset; } public int getGreatestDisplayOffset() { return greatestDisplayOffset; } public void setGreatestDisplayOffset(int greatestDisplayOffset) { this.greatestDisplayOffset = greatestDisplayOffset; } public int getDisplayStartTime() { return displayStartTime; } public void setDisplayStartTime(int displayStartTime) { this.displayStartTime = displayStartTime; } public int getDisplayEndTime() { return displayEndTime; } public void setDisplayEndTime(int displayEndTime) { this.displayEndTime = displayEndTime; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy