FileDocCategorySizeDatePackage
Amf0Track.javaAPI Docmp4parser 1.0-RC-173858Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.authoring.tracks

Amf0Track

public class Amf0Track extends com.googlecode.mp4parser.authoring.AbstractTrack

Fields Summary
SortedMap
rawSamples
private com.googlecode.mp4parser.authoring.TrackMetaData
trackMetaData
Constructors Summary
public Amf0Track(Map rawSamples)
Creates a new AMF0 track from

param
rawSamples



                 
        
        this.rawSamples = new TreeMap<Long, byte[]>(rawSamples);
        trackMetaData.setCreationTime(new Date());
        trackMetaData.setModificationTime(new Date());
        trackMetaData.setTimescale(1000); // Text tracks use millieseconds
        trackMetaData.setLanguage("eng");
    
Methods Summary
public java.util.ListgetCompositionTimeEntries()

        // AMF0 tracks do not have Composition Time
        return null;
    
public java.util.ListgetDecodingTimeEntries()

        LinkedList<TimeToSampleBox.Entry> timesToSample = new LinkedList<TimeToSampleBox.Entry>();
        LinkedList<Long> keys = new LinkedList<Long>(rawSamples.keySet());
        Collections.sort(keys);
        long lastTimeStamp = 0;
        for (Long key : keys) {
            long delta = key - lastTimeStamp;
            if (timesToSample.size() > 0 && timesToSample.peek().getDelta() == delta) {
                timesToSample.peek().setCount(timesToSample.peek().getCount() + 1);
            } else {
                timesToSample.add(new TimeToSampleBox.Entry(1, delta));
            }
            lastTimeStamp = key;
        }
        return timesToSample;
    
public java.lang.StringgetHandler()

        return "data";
    
public BoxgetMediaHeaderBox()

        return new NullMediaHeaderBox();
    
public java.util.ListgetSampleDependencies()

        // AMF0 tracks do not have Sample Dependencies
        return null;
    
public SampleDescriptionBoxgetSampleDescriptionBox()

        SampleDescriptionBox stsd = new SampleDescriptionBox();
        ActionMessageFormat0SampleEntryBox amf0 = new ActionMessageFormat0SampleEntryBox();
        amf0.setDataReferenceIndex(1);
        stsd.addBox(amf0);
        return stsd;
    
public java.util.ListgetSamples()

        LinkedList<ByteBuffer> samples = new LinkedList<ByteBuffer>();
        for (byte[] bytes : rawSamples.values()) {
            samples.add(ByteBuffer.wrap(bytes));
        }
        return samples;
    
public SubSampleInformationBoxgetSubsampleInformationBox()

        return null;
    
public long[]getSyncSamples()

        // AMF0 tracks do not have Sync Samples
        return null;
    
public com.googlecode.mp4parser.authoring.TrackMetaDatagetTrackMetaData()

        return trackMetaData;  //To change body of implemented methods use File | Settings | File Templates.