com.mp4parser.streaming.extensions.CompositionTimeSampleExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isoparser Show documentation
Show all versions of isoparser Show documentation
A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)
The newest version!
package com.mp4parser.streaming.extensions;
import com.mp4parser.streaming.SampleExtension;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class CompositionTimeSampleExtension implements SampleExtension {
public static Map pool =
Collections.synchronizedMap(new HashMap());
public static CompositionTimeSampleExtension create(int offset) {
CompositionTimeSampleExtension c = pool.get(offset);
if (c == null) {
c = new CompositionTimeSampleExtension();
c.ctts = offset;
pool.put(offset, c);
}
return c;
}
private int ctts;
/**
* This value provides the offset between decoding time and composition time. The offset is expressed as
* signed long such that CT(n) = DT(n) + CTTS(n). This method is
*
* @return offset between decoding time and composition time.
*/
public int getCompositionTimeOffset() {
return ctts;
}
}