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

com.mp4parser.streaming.extensions.CompositionTimeSampleExtension 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.1.22
Show 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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy