com.mp4parser.streaming.AbstractStreamingTrack 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, ...)
package com.mp4parser.streaming;
import com.coremedia.iso.boxes.SampleDescriptionBox;
import com.coremedia.iso.boxes.TrackHeaderBox;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
public abstract class AbstractStreamingTrack implements StreamingTrack {
protected BlockingQueue samples = new ArrayBlockingQueue(1000);
protected TrackHeaderBox tkhd;
protected SampleDescriptionBox stsd;
protected HashMap, TrackExtension> trackExtensions = new HashMap, TrackExtension>();
public AbstractStreamingTrack() {
tkhd = new TrackHeaderBox();
tkhd.setTrackId(1);
}
public BlockingQueue getSamples() {
return samples;
}
public boolean hasMoreSamples() {
return false;
}
public TrackHeaderBox getTrackHeaderBox() {
return tkhd;
}
public SampleDescriptionBox getSampleDescriptionBox() {
return stsd;
}
public T getTrackExtension(Class clazz) {
return (T) trackExtensions.get(clazz);
}
public void addTrackExtension(TrackExtension trackExtension) {
trackExtensions.put(trackExtension.getClass(), trackExtension);
}
public void removeTrackExtension(Class extends TrackExtension> clazz) {
trackExtensions.remove(clazz);
}
}