
eu.mihosoft.vrl.ext.com.bric.qt.TimeToSampleAtom Maven / Gradle / Ivy
/* * @(#)TimeToSampleAtom.java * * Copyright (c) 2008 Jeremy Wood. All Rights Reserved. * * You have a non-exclusive, royalty free, license to use, * modify and redistribute this software in source and binary code form, * provided that i) this copyright notice and license appear on all copies of * the software; and ii) You do not utilize the software in a manner * which is disparaging to the original author. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. THE AUTHOR SHALL NOT BE * LIABLE FOR ANY DAMAGES SUFFERED AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL THE * AUTHOR BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF * OR INABILITY TO USE SOFTWARE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ package eu.mihosoft.vrl.ext.com.bric.qt; import java.io.*; import eu.mihosoft.vrl.ext.com.bric.io.GuardedOutputStream; /** Time-to-sample atoms store duration information for a media samples. * The times used here are relative to an enclosing time scale. * *
-many consecutive * samples have a duration ofThis is not a public class because I expect to make some significant * changes to this project in the next year. *
Use at your own risk. This class (and its package) may change in future releases. *
Not that I'm promising there will be future releases. There may not be. :) */ class TimeToSampleAtom extends LeafAtom { int version = 0; int flags = 0; TimeToSampleEntry[] table = new TimeToSampleEntry[0]; public TimeToSampleAtom() { super(null); } public TimeToSampleAtom(Atom parent,InputStream in) throws IOException { super(parent); version = in.read(); flags = read24Int(in); int entryCount = (int)read32Int(in); table = new TimeToSampleEntry[entryCount]; for(int a = 0; a
sampleCount sampleDuration
. * (The duration is relative to an enclosing time scale.) */ class TimeToSampleEntry { long sampleCount, sampleDuration; public TimeToSampleEntry(long count,long duration) { this.sampleCount = count; this.sampleDuration = duration; } public TimeToSampleEntry(InputStream in) throws IOException { sampleCount = Atom.read32Int(in); sampleDuration = Atom.read32Int(in); } public String toString() { return "["+sampleCount+", "+sampleDuration+"]"; } protected void write(OutputStream out) throws IOException { Atom.write32Int(out, sampleCount); Atom.write32Int(out, sampleDuration); } }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy