Methods Summary |
---|
private java.nio.ByteBuffer | findNextNal(java.nio.ByteBuffer bb)
byte[] test = new byte[]{-1, -1, -1, -1};
int start = -1;
int c;
while ((c = bb.get()) != -1) {
test[0] = test[1];
test[1] = test[2];
test[2] = test[3];
test[3] = (byte) c;
if (test[0] == 0 && test[1] == 0 && test[2] == 0 && test[3] == 1) {
if (start == -1) {
start = bb.position();
test = new byte[]{-1, -1, -1, -1};
} else {
break;
}
}
}
if (test[0] == 0 && test[1] == 0 && test[2] == 0 && test[3] == 1) {
bb.position(bb.position() - 4);
}
int length = bb.position() - start;
ByteBuffer nu = bb.duplicate();
nu.position(start);
nu.slice();
nu.limit(length);
return nu;
|
public java.util.List | getCompositionTimeEntries()
List<CompositionTimeToSample.Entry> entries = new LinkedList<CompositionTimeToSample.Entry>();
for (IsoFile fragment : fragments) {
TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
for (TrackRunBox.Entry entry : trun.getEntries()) {
entries.add(new CompositionTimeToSample.Entry(entry.getSampleCompositionTimeOffset(), 1));
}
}
return entries;
|
public java.util.List | getDecodingTimeEntries()
List<TimeToSampleBox.Entry> entries = new LinkedList<TimeToSampleBox.Entry>();
for (IsoFile fragment : fragments) {
TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
for (TrackRunBox.Entry entry : trun.getEntries()) {
entries.add(new TimeToSampleBox.Entry(entry.getSampleDuration(), 1));
}
}
return entries;
|
public java.lang.String | getHandler()
if ("avc1".equalsIgnoreCase(fourCC)) {
return "vide";
}
throw new RuntimeException();
|
public Box | getMediaHeaderBox()
if ("avc1".equalsIgnoreCase(fourCC)) {
return new VideoMediaHeaderBox();
}
throw new RuntimeException();
|
public java.util.List | getSampleDependencies()
return null; // no sample dependencies for us
|
public SampleDescriptionBox | getSampleDescriptionBox()
SampleDescriptionBox stsd = new SampleDescriptionBox();
if ("avc1".equalsIgnoreCase(fourCC)) {
VisualSampleEntry vse = new VisualSampleEntry("avc1");
vse.setHorizresolution((int) trackMetaData.getWidth());
vse.setHeight((int) trackMetaData.getHeight());
AvcConfigurationBox avcC = new AvcConfigurationBox();
vse.addBox(avcC);
AvcConfigurationBox.AVCDecoderConfigurationRecord record = new AvcConfigurationBox.AVCDecoderConfigurationRecord();
ByteBuffer spsAndPps = ByteBuffer.wrap(Hex.decodeHex(codecPrivateData));
ByteBuffer allSequenceParameterSets = findNextNal(spsAndPps);
List<byte[]> sequenceParameterSets = new LinkedList<byte[]>();
allSequenceParameterSets.position(0);
while (allSequenceParameterSets.position() <= allSequenceParameterSets.limit()) {
int length = IsoTypeReader.readUInt16(allSequenceParameterSets);
sequenceParameterSets.add((byte[]) allSequenceParameterSets.duplicate().slice().limit(length).array());
allSequenceParameterSets.position(allSequenceParameterSets.position() + length);
}
ByteBuffer allPictureParameterSets = findNextNal(spsAndPps);
List<byte[]> pictureParameterSets = new LinkedList<byte[]>();
allPictureParameterSets.position(0);
while (allPictureParameterSets.position() <= allPictureParameterSets.limit()) {
int length = IsoTypeReader.readUInt16(allPictureParameterSets);
pictureParameterSets.add((byte[]) allPictureParameterSets.duplicate().slice().limit(length).array());
allPictureParameterSets.position(allPictureParameterSets.position() + length);
}
avcC.setSequenceParameterSets(sequenceParameterSets);
avcC.setPictureParameterSets(pictureParameterSets);
stsd.addBox(vse);
}
return stsd;
|
public java.util.List | getSamples()
List<ByteBuffer> samples = new ArrayList<ByteBuffer>();
for (IsoFile fragment : fragments) {
TrackFragmentBox traf = (TrackFragmentBox) Path.getPath(fragment, "/moof[0]/traf[0]");
samples.addAll(new SampleList(traf));
}
return samples;
|
public SubSampleInformationBox | getSubsampleInformationBox()
return null; // no subsamples for us
|
public long[] | getSyncSamples()
int numSyncSamples = 0;
for (IsoFile fragment : fragments) {
TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
for (TrackRunBox.Entry entry : trun.getEntries()) {
if (!entry.getSampleFlags().isSampleIsDifferenceSample()) {
numSyncSamples++;
}
}
}
long[] syncSamples = new long[numSyncSamples];
int sampleNum = 1;
int syncSampleNum = 0;
for (IsoFile fragment : fragments) {
TrackRunBox trun = (TrackRunBox) Path.getPath(fragment, "/moof[0]/traf[0]/trun[0]");
for (TrackRunBox.Entry entry : trun.getEntries()) {
if (!entry.getSampleFlags().isSampleIsDifferenceSample()) {
syncSamples[syncSampleNum++] = sampleNum;
}
sampleNum++;
}
}
return syncSamples;
|
public com.googlecode.mp4parser.authoring.TrackMetaData | getTrackMetaData()
return trackMetaData;
|
public boolean | isEnabled()
return true;
|
public boolean | isInMovie()
return true;
|
public boolean | isInPoster()
return true;
|
public boolean | isInPreview()
return true;
|