FileDocCategorySizeDatePackage
MediaHeaderBox.javaAPI Docmp4parser 1.0-RC-174561Wed Dec 19 20:10:38 GMT 2012com.coremedia.iso.boxes

MediaHeaderBox

public class MediaHeaderBox extends com.googlecode.mp4parser.AbstractFullBox
This box defines overall information which is media-independent, and relevant to the entire presentation considered as a whole.

Fields Summary
public static final String
TYPE
private long
creationTime
private long
modificationTime
private long
timescale
private long
duration
private String
language
Constructors Summary
public MediaHeaderBox()


      
        super(TYPE);
    
Methods Summary
public void_parseDetails(java.nio.ByteBuffer content)

        parseVersionAndFlags(content);
        if (getVersion() == 1) {
            creationTime = IsoTypeReader.readUInt64(content);
            modificationTime = IsoTypeReader.readUInt64(content);
            timescale = IsoTypeReader.readUInt32(content);
            duration = IsoTypeReader.readUInt64(content);
        } else {
            creationTime = IsoTypeReader.readUInt32(content);
            modificationTime = IsoTypeReader.readUInt32(content);
            timescale = IsoTypeReader.readUInt32(content);
            duration = IsoTypeReader.readUInt32(content);
        }
        language = IsoTypeReader.readIso639(content);
        IsoTypeReader.readUInt16(content);
    
protected voidgetContent(java.nio.ByteBuffer byteBuffer)

        writeVersionAndFlags(byteBuffer);
        if (getVersion() == 1) {
            IsoTypeWriter.writeUInt64(byteBuffer, creationTime);
            IsoTypeWriter.writeUInt64(byteBuffer, modificationTime);
            IsoTypeWriter.writeUInt32(byteBuffer, timescale);
            IsoTypeWriter.writeUInt64(byteBuffer, duration);
        } else {
            IsoTypeWriter.writeUInt32(byteBuffer, creationTime);
            IsoTypeWriter.writeUInt32(byteBuffer, modificationTime);
            IsoTypeWriter.writeUInt32(byteBuffer, timescale);
            IsoTypeWriter.writeUInt32(byteBuffer, duration);
        }
        IsoTypeWriter.writeIso639(byteBuffer, language);
        IsoTypeWriter.writeUInt16(byteBuffer, 0);
    
protected longgetContentSize()

        long contentSize = 4;
        if (getVersion() == 1) {
            contentSize += 8 + 8 + 4 + 8;
        } else {
            contentSize += 4 + 4 + 4 + 4;
        }
        contentSize += 2;
        contentSize += 2;
        return contentSize;

    
public longgetCreationTime()

        return creationTime;
    
public longgetDuration()

        return duration;
    
public java.lang.StringgetLanguage()

        return language;
    
public longgetModificationTime()

        return modificationTime;
    
public longgetTimescale()

        return timescale;
    
public voidsetCreationTime(long creationTime)

        this.creationTime = creationTime;
    
public voidsetDuration(long duration)

        this.duration = duration;
    
public voidsetLanguage(java.lang.String language)

        this.language = language;
    
public voidsetModificationTime(long modificationTime)

        this.modificationTime = modificationTime;
    
public voidsetTimescale(long timescale)

        this.timescale = timescale;
    
public java.lang.StringtoString()

        StringBuilder result = new StringBuilder();
        result.append("MediaHeaderBox[");
        result.append("creationTime=").append(getCreationTime());
        result.append(";");
        result.append("modificationTime=").append(getModificationTime());
        result.append(";");
        result.append("timescale=").append(getTimescale());
        result.append(";");
        result.append("duration=").append(getDuration());
        result.append(";");
        result.append("language=").append(getLanguage());
        result.append("]");
        return result.toString();