Java Code Examples for com.coremedia.iso.boxes.TimeToSampleBox#Entry

The following examples show how to use com.coremedia.iso.boxes.TimeToSampleBox#Entry . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MP4Builder.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();
    long[] deltas = track.getSampleDurations();

    for (int a = 0; a < deltas.length; a++) {
        long delta = deltas[a];
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 2
Source File: MP4Builder.java    From VideoCompressor with Apache License 2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 3
Source File: MP4Builder.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();
    long[] deltas = track.getSampleDurations();

    for (int a = 0; a < deltas.length; a++) {
        long delta = deltas[a];
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 4
Source File: MP4Builder.java    From react-native-video-helper with MIT License 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 5
Source File: MP4Builder.java    From VideoCompressor with Apache License 2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 6
Source File: MP4Builder.java    From talk-android with MIT License 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 7
Source File: MP4Builder.java    From SiliCompressor with Apache License 2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 8
Source File: MP4Builder.java    From deltachat-android with GNU General Public License v3.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();

    for (long delta : track.getSampleDurations()) {
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 9
Source File: MP4Builder.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();
    long[] deltas = track.getSampleDurations();

    for (int a = 0; a < deltas.length; a++) {
        long delta = deltas[a];
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}
 
Example 10
Source File: MP4Builder.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
protected void createStts(Track track, SampleTableBox stbl) {
    TimeToSampleBox.Entry lastEntry = null;
    List<TimeToSampleBox.Entry> entries = new ArrayList<>();
    long[] deltas = track.getSampleDurations();

    for (int a = 0; a < deltas.length; a++) {
        long delta = deltas[a];
        if (lastEntry != null && lastEntry.getDelta() == delta) {
            lastEntry.setCount(lastEntry.getCount() + 1);
        } else {
            lastEntry = new TimeToSampleBox.Entry(1, delta);
            entries.add(lastEntry);
        }
    }
    TimeToSampleBox stts = new TimeToSampleBox();
    stts.setEntries(entries);
    stbl.addBox(stts);
}