summaryrefslogtreecommitdiff
path: root/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base
diff options
context:
space:
mode:
Diffstat (limited to 'isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base')
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsBox.java.svn-base31
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsHeaderBox.java.svn-base71
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentBox.java.svn-base100
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentHeaderBox.java.svn-base72
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessBox.java.svn-base34
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessOffsetBox.java.svn-base62
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SampleFlags.java.svn-base207
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SegmentTypeBox.java.svn-base143
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackExtendsBox.java.svn-base115
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBaseMediaDecodeTimeBox.java.svn-base76
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBox.java.svn-base43
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentHeaderBox.java.svn-base224
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentRandomAccessBox.java.svn-base294
-rw-r--r--isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackRunBox.java.svn-base355
14 files changed, 0 insertions, 1827 deletions
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsBox.java.svn-base
deleted file mode 100644
index 5ecd642..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsBox.java.svn-base
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.googlecode.mp4parser.AbstractContainerBox;
-
-/**
- * aligned(8) class MovieExtendsBox extends Box('mvex'){
- * }
- */
-public class MovieExtendsBox extends AbstractContainerBox {
- public static final String TYPE = "mvex";
-
- public MovieExtendsBox() {
- super(TYPE);
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsHeaderBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsHeaderBox.java.svn-base
deleted file mode 100644
index 8dd58f9..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieExtendsHeaderBox.java.svn-base
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-/**
- * aligned(8) class MovieExtendsHeaderBox extends FullBox('mehd', version, 0) {
- * if (version==1) {
- * unsigned int(64) fragment_duration;
- * } else { // version==0
- * unsigned int(32) fragment_duration;
- * }
- * }
- */
-public class MovieExtendsHeaderBox extends AbstractFullBox {
- public static final String TYPE = "mehd";
- private long fragmentDuration;
-
- public MovieExtendsHeaderBox() {
- super(TYPE);
- }
-
- @Override
- protected long getContentSize() {
- return getVersion() == 1 ? 12 : 8;
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- fragmentDuration = getVersion() == 1 ? IsoTypeReader.readUInt64(content) : IsoTypeReader.readUInt32(content);
- }
-
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- if (getVersion() == 1) {
- IsoTypeWriter.writeUInt64(byteBuffer, fragmentDuration);
- } else {
- IsoTypeWriter.writeUInt32(byteBuffer, fragmentDuration);
- }
- }
-
- public long getFragmentDuration() {
- return fragmentDuration;
- }
-
- public void setFragmentDuration(long fragmentDuration) {
- this.fragmentDuration = fragmentDuration;
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentBox.java.svn-base
deleted file mode 100644
index e92bd53..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentBox.java.svn-base
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.googlecode.mp4parser.AbstractContainerBox;
-import com.coremedia.iso.boxes.Box;
-import com.coremedia.iso.boxes.SampleDependencyTypeBox;
-import com.googlecode.mp4parser.annotations.DoNotParseDetail;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * aligned(8) class MovieFragmentBox extends Box(moof){
- * }
- */
-
-public class MovieFragmentBox extends AbstractContainerBox {
- public static final String TYPE = "moof";
-
- public MovieFragmentBox() {
- super(TYPE);
- }
-
-
- public List<Long> getSyncSamples(SampleDependencyTypeBox sdtp) {
- List<Long> result = new ArrayList<Long>();
-
- final List<SampleDependencyTypeBox.Entry> sampleEntries = sdtp.getEntries();
- long i = 1;
- for (SampleDependencyTypeBox.Entry sampleEntry : sampleEntries) {
- if (sampleEntry.getSampleDependsOn() == 2) {
- result.add(i);
- }
- i++;
- }
-
- return result;
- }
-
- @DoNotParseDetail
- public long getOffset() {
- Box b = this;
- long offset = 0;
- while (b.getParent() != null) {
- for (Box box : b.getParent().getBoxes()) {
- if (b == box) {
- break;
- }
- offset += box.getSize();
- }
- b = b.getParent();
- }
- return offset;
- }
-
-
- public int getTrackCount() {
- return getBoxes(TrackFragmentBox.class, false).size();
- }
-
- /**
- * Returns the track numbers associated with this <code>MovieBox</code>.
- *
- * @return the tracknumbers (IDs) of the tracks in their order of appearance in the file
- */
-
- public long[] getTrackNumbers() {
-
- List<TrackFragmentBox> trackBoxes = this.getBoxes(TrackFragmentBox.class, false);
- long[] trackNumbers = new long[trackBoxes.size()];
- for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
- TrackFragmentBox trackBoxe = trackBoxes.get(trackCounter);
- trackNumbers[trackCounter] = trackBoxe.getTrackFragmentHeaderBox().getTrackId();
- }
- return trackNumbers;
- }
-
- public List<TrackFragmentHeaderBox> getTrackFragmentHeaderBoxes() {
- return getBoxes(TrackFragmentHeaderBox.class, true);
- }
-
- public List<TrackRunBox> getTrackRunBoxes() {
- return getBoxes(TrackRunBox.class, true);
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentHeaderBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentHeaderBox.java.svn-base
deleted file mode 100644
index e58f7a2..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentHeaderBox.java.svn-base
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-/**
- * aligned(8) class MovieFragmentHeaderBox
- * extends FullBox('mfhd', 0, 0){
- * unsigned int(32) sequence_number;
- * }
- */
-
-public class MovieFragmentHeaderBox extends AbstractFullBox {
- public static final String TYPE = "mfhd";
- private long sequenceNumber;
-
- public MovieFragmentHeaderBox() {
- super(TYPE);
- }
-
- protected long getContentSize() {
- return 8;
- }
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, sequenceNumber);
- }
-
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- sequenceNumber = IsoTypeReader.readUInt32(content);
-
- }
-
- public long getSequenceNumber() {
- return sequenceNumber;
- }
-
- public void setSequenceNumber(long sequenceNumber) {
- this.sequenceNumber = sequenceNumber;
- }
-
- @Override
- public String toString() {
- return "MovieFragmentHeaderBox{" +
- "sequenceNumber=" + sequenceNumber +
- '}';
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessBox.java.svn-base
deleted file mode 100644
index 86e2c9d..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessBox.java.svn-base
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.googlecode.mp4parser.AbstractContainerBox;
-
-/**
- * aligned(8) class MovieFragmentRandomAccessBox
- * extends Box('mfra')
- * {
- * }
- */
-public class MovieFragmentRandomAccessBox extends AbstractContainerBox {
- public static final String TYPE = "mfra";
-
- public MovieFragmentRandomAccessBox() {
- super(TYPE);
- }
-
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessOffsetBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessOffsetBox.java.svn-base
deleted file mode 100644
index edbfd66..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/MovieFragmentRandomAccessOffsetBox.java.svn-base
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-/**
- * aligned(8) class MovieFragmentRandomAccessOffsetBox
- * extends FullBox('mfro', version, 0) {
- * unsigned int(32) size;
- * }
- */
-public class MovieFragmentRandomAccessOffsetBox extends AbstractFullBox {
- public static final String TYPE = "mfro";
- private long mfraSize;
-
- public MovieFragmentRandomAccessOffsetBox() {
- super(TYPE);
- }
-
- protected long getContentSize() {
- return 8;
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- mfraSize = IsoTypeReader.readUInt32(content);
- }
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, mfraSize);
- }
-
- public long getMfraSize() {
- return mfraSize;
- }
-
- public void setMfraSize(long mfraSize) {
- this.mfraSize = mfraSize;
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SampleFlags.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SampleFlags.java.svn-base
deleted file mode 100644
index 6caaf1e..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SampleFlags.java.svn-base
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitReaderBuffer;
-import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitWriterBuffer;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * bit(6) reserved=0;
- * unsigned int(2) sample_depends_on;
- * unsigned int(2) sample_is_depended_on;
- * unsigned int(2) sample_has_redundancy;
- * bit(3) sample_padding_value;
- * bit(1) sample_is_difference_sample;
- * // i.e. when 1 signals a non-key or non-sync sample
- * unsigned int(16) sample_degradation_priority;
- */
-public class SampleFlags {
- private int reserved;
- private int sampleDependsOn;
- private int sampleIsDependedOn;
- private int sampleHasRedundancy;
- private int samplePaddingValue;
- private boolean sampleIsDifferenceSample;
- private int sampleDegradationPriority;
-
- public SampleFlags() {
-
- }
-
- public SampleFlags(ByteBuffer bb) {
- BitReaderBuffer brb = new BitReaderBuffer(bb);
- reserved = brb.readBits(6);
- sampleDependsOn = brb.readBits(2);
- sampleIsDependedOn = brb.readBits(2);
- sampleHasRedundancy = brb.readBits(2);
- samplePaddingValue = brb.readBits(3);
- sampleIsDifferenceSample = brb.readBits(1) == 1;
- sampleDegradationPriority = brb.readBits(16);
- }
-
-
- public void getContent(ByteBuffer os) {
- BitWriterBuffer bitWriterBuffer = new BitWriterBuffer(os);
- bitWriterBuffer.writeBits(reserved, 6);
- bitWriterBuffer.writeBits(sampleDependsOn, 2);
- bitWriterBuffer.writeBits(sampleIsDependedOn, 2);
- bitWriterBuffer.writeBits(sampleHasRedundancy, 2);
- bitWriterBuffer.writeBits(samplePaddingValue, 3);
- bitWriterBuffer.writeBits(this.sampleIsDifferenceSample ? 1 : 0, 1);
- bitWriterBuffer.writeBits(sampleDegradationPriority, 16);
- }
-
- public int getReserved() {
- return reserved;
- }
-
- public void setReserved(int reserved) {
- this.reserved = reserved;
- }
-
- /**
- * @see #setSampleDependsOn(int)
- */
- public int getSampleDependsOn() {
- return sampleDependsOn;
- }
-
- /**
- * sample_depends_on takes one of the following four values:
- * <pre>
- * 0: the dependency of this sample is unknown;
- * 1: this sample does depend on others (not an I picture);
- * 2: this sample does not depend on others (I picture);
- * 3: reserved
- * </pre>
- *
- */
- public void setSampleDependsOn(int sampleDependsOn) {
- this.sampleDependsOn = sampleDependsOn;
- }
-
- /**
- * @see #setSampleIsDependedOn(int)
- */
- public int getSampleIsDependedOn() {
- return sampleIsDependedOn;
- }
-
- /**
- * sample_is_depended_on takes one of the following four values:
- * <pre>
- * 0: the dependency of other samples on this sample is unknown;
- * 1: other samples may depend on this one (not disposable);
- * 2: no other sample depends on this one (disposable);
- * 3: reserved
- * </pre>
- *
- */
- public void setSampleIsDependedOn(int sampleIsDependedOn) {
- this.sampleIsDependedOn = sampleIsDependedOn;
- }
-
- /**
- * @see #setSampleHasRedundancy(int)
- */
- public int getSampleHasRedundancy() {
- return sampleHasRedundancy;
- }
-
- /**
- * sample_has_redundancy takes one of the following four values:
- * <pre>
- * 0: it is unknown whether there is redundant coding in this sample;
- * 1: there is redundant coding in this sample;
- * 2: there is no redundant coding in this sample;
- * 3: reserved
- * </pre>
- */
- public void setSampleHasRedundancy(int sampleHasRedundancy) {
- this.sampleHasRedundancy = sampleHasRedundancy;
- }
-
- public int getSamplePaddingValue() {
- return samplePaddingValue;
- }
-
- public void setSamplePaddingValue(int samplePaddingValue) {
- this.samplePaddingValue = samplePaddingValue;
- }
-
- public boolean isSampleIsDifferenceSample() {
- return sampleIsDifferenceSample;
- }
-
-
- public void setSampleIsDifferenceSample(boolean sampleIsDifferenceSample) {
- this.sampleIsDifferenceSample = sampleIsDifferenceSample;
- }
-
- public int getSampleDegradationPriority() {
- return sampleDegradationPriority;
- }
-
- public void setSampleDegradationPriority(int sampleDegradationPriority) {
- this.sampleDegradationPriority = sampleDegradationPriority;
- }
-
- @Override
- public String toString() {
- return "SampleFlags{" +
- "reserved=" + reserved +
- ", sampleDependsOn=" + sampleDependsOn +
- ", sampleHasRedundancy=" + sampleHasRedundancy +
- ", samplePaddingValue=" + samplePaddingValue +
- ", sampleIsDifferenceSample=" + sampleIsDifferenceSample +
- ", sampleDegradationPriority=" + sampleDegradationPriority +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- SampleFlags that = (SampleFlags) o;
-
- if (reserved != that.reserved) return false;
- if (sampleDegradationPriority != that.sampleDegradationPriority) return false;
- if (sampleDependsOn != that.sampleDependsOn) return false;
- if (sampleHasRedundancy != that.sampleHasRedundancy) return false;
- if (sampleIsDependedOn != that.sampleIsDependedOn) return false;
- if (sampleIsDifferenceSample != that.sampleIsDifferenceSample) return false;
- if (samplePaddingValue != that.samplePaddingValue) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = reserved;
- result = 31 * result + sampleDependsOn;
- result = 31 * result + sampleIsDependedOn;
- result = 31 * result + sampleHasRedundancy;
- result = 31 * result + samplePaddingValue;
- result = 31 * result + (sampleIsDifferenceSample ? 1 : 0);
- result = 31 * result + sampleDegradationPriority;
- return result;
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SegmentTypeBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SegmentTypeBox.java.svn-base
deleted file mode 100644
index 5e0d47b..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/SegmentTypeBox.java.svn-base
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2008 CoreMedia AG, Hamburg
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoFile;
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractBox;
-import com.googlecode.mp4parser.annotations.DoNotParseDetail;
-
-import java.nio.ByteBuffer;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * This box identifies the specifications to which this file complies. <br>
- * Each brand is a printable four-character code, registered with ISO, that
- * identifies a precise specification.
- */
-public class SegmentTypeBox extends AbstractBox {
- public static final String TYPE = "styp";
-
- private String majorBrand;
- private long minorVersion;
- private List<String> compatibleBrands = Collections.emptyList();
-
- public SegmentTypeBox() {
- super(TYPE);
- }
-
- public SegmentTypeBox(String majorBrand, long minorVersion, List<String> compatibleBrands) {
- super(TYPE);
- this.majorBrand = majorBrand;
- this.minorVersion = minorVersion;
- this.compatibleBrands = compatibleBrands;
- }
-
- protected long getContentSize() {
- return 8 + compatibleBrands.size() * 4;
-
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- majorBrand = IsoTypeReader.read4cc(content);
- minorVersion = IsoTypeReader.readUInt32(content);
- int compatibleBrandsCount = content.remaining() / 4;
- compatibleBrands = new LinkedList<String>();
- for (int i = 0; i < compatibleBrandsCount; i++) {
- compatibleBrands.add(IsoTypeReader.read4cc(content));
- }
- }
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- byteBuffer.put(IsoFile.fourCCtoBytes(majorBrand));
- IsoTypeWriter.writeUInt32(byteBuffer, minorVersion);
- for (String compatibleBrand : compatibleBrands) {
- byteBuffer.put(IsoFile.fourCCtoBytes(compatibleBrand));
- }
-
- }
-
- /**
- * Gets the brand identifier.
- *
- * @return the brand identifier
- */
- public String getMajorBrand() {
- return majorBrand;
- }
-
- /**
- * Sets the major brand of the file used to determine an appropriate reader.
- *
- * @param majorBrand the new major brand
- */
- public void setMajorBrand(String majorBrand) {
- this.majorBrand = majorBrand;
- }
-
- /**
- * Sets the "informative integer for the minor version of the major brand".
- *
- * @param minorVersion the version number of the major brand
- */
- public void setMinorVersion(int minorVersion) {
- this.minorVersion = minorVersion;
- }
-
- /**
- * Gets an informative integer for the minor version of the major brand.
- *
- * @return an informative integer
- * @see SegmentTypeBox#getMajorBrand()
- */
- public long getMinorVersion() {
- return minorVersion;
- }
-
- /**
- * Gets an array of 4-cc brands.
- *
- * @return the compatible brands
- */
- public List<String> getCompatibleBrands() {
- return compatibleBrands;
- }
-
- public void setCompatibleBrands(List<String> compatibleBrands) {
- this.compatibleBrands = compatibleBrands;
- }
-
- @DoNotParseDetail
- public String toString() {
- StringBuilder result = new StringBuilder();
- result.append("SegmentTypeBox[");
- result.append("majorBrand=").append(getMajorBrand());
- result.append(";");
- result.append("minorVersion=").append(getMinorVersion());
- for (String compatibleBrand : compatibleBrands) {
- result.append(";");
- result.append("compatibleBrand=").append(compatibleBrand);
- }
- result.append("]");
- return result.toString();
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackExtendsBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackExtendsBox.java.svn-base
deleted file mode 100644
index 8bba7c1..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackExtendsBox.java.svn-base
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-/**
- * aligned(8) class TrackExtendsBox extends FullBox('trex', 0, 0){
- * unsigned int(32) track_ID;
- * unsigned int(32) default_sample_description_index;
- * unsigned int(32) default_sample_duration;
- * unsigned int(32) default_sample_size;
- * unsigned int(32) default_sample_flags
- * }
- */
-public class TrackExtendsBox extends AbstractFullBox {
- public static final String TYPE = "trex";
- private long trackId;
- private long defaultSampleDescriptionIndex;
- private long defaultSampleDuration;
- private long defaultSampleSize;
- private SampleFlags defaultSampleFlags;
-
- public TrackExtendsBox() {
- super(TYPE);
- }
-
- @Override
- protected long getContentSize() {
- return 5 * 4 + 4;
- }
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, trackId);
- IsoTypeWriter.writeUInt32(byteBuffer, defaultSampleDescriptionIndex);
- IsoTypeWriter.writeUInt32(byteBuffer, defaultSampleDuration);
- IsoTypeWriter.writeUInt32(byteBuffer, defaultSampleSize);
- defaultSampleFlags.getContent(byteBuffer);
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- trackId = IsoTypeReader.readUInt32(content);
- defaultSampleDescriptionIndex = IsoTypeReader.readUInt32(content);
- defaultSampleDuration = IsoTypeReader.readUInt32(content);
- defaultSampleSize = IsoTypeReader.readUInt32(content);
- defaultSampleFlags = new SampleFlags(content);
- }
-
- public long getTrackId() {
- return trackId;
- }
-
- public long getDefaultSampleDescriptionIndex() {
- return defaultSampleDescriptionIndex;
- }
-
- public long getDefaultSampleDuration() {
- return defaultSampleDuration;
- }
-
- public long getDefaultSampleSize() {
- return defaultSampleSize;
- }
-
- public SampleFlags getDefaultSampleFlags() {
- return defaultSampleFlags;
- }
-
- public String getDefaultSampleFlagsStr() {
- return defaultSampleFlags.toString();
- }
-
- public void setTrackId(long trackId) {
- this.trackId = trackId;
- }
-
- public void setDefaultSampleDescriptionIndex(long defaultSampleDescriptionIndex) {
- this.defaultSampleDescriptionIndex = defaultSampleDescriptionIndex;
- }
-
- public void setDefaultSampleDuration(long defaultSampleDuration) {
- this.defaultSampleDuration = defaultSampleDuration;
- }
-
- public void setDefaultSampleSize(long defaultSampleSize) {
- this.defaultSampleSize = defaultSampleSize;
- }
-
- public void setDefaultSampleFlags(SampleFlags defaultSampleFlags) {
- this.defaultSampleFlags = defaultSampleFlags;
-
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBaseMediaDecodeTimeBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBaseMediaDecodeTimeBox.java.svn-base
deleted file mode 100644
index 06fcf62..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBaseMediaDecodeTimeBox.java.svn-base
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-public class TrackFragmentBaseMediaDecodeTimeBox extends AbstractFullBox {
- public static final String TYPE = "tfdt";
-
- private long baseMediaDecodeTime;
-
- public TrackFragmentBaseMediaDecodeTimeBox() {
- super(TYPE);
- }
-
- @Override
- protected long getContentSize() {
- return getVersion() == 0 ? 8 : 12;
- }
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- if (getVersion() == 1) {
- IsoTypeWriter.writeUInt64(byteBuffer, baseMediaDecodeTime);
- } else {
- IsoTypeWriter.writeUInt32(byteBuffer, baseMediaDecodeTime);
- }
- }
-
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- if (getVersion() == 1) {
- baseMediaDecodeTime = IsoTypeReader.readUInt64(content);
- } else {
- baseMediaDecodeTime = IsoTypeReader.readUInt32(content);
- }
-
- }
-
-
- public long getBaseMediaDecodeTime() {
- return baseMediaDecodeTime;
- }
-
- public void setBaseMediaDecodeTime(long baseMediaDecodeTime) {
- this.baseMediaDecodeTime = baseMediaDecodeTime;
- }
-
- @Override
- public String toString() {
- return "TrackFragmentBaseMediaDecodeTimeBox{" +
- "baseMediaDecodeTime=" + baseMediaDecodeTime +
- '}';
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBox.java.svn-base
deleted file mode 100644
index fde7da5..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentBox.java.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.googlecode.mp4parser.AbstractContainerBox;
-import com.coremedia.iso.boxes.Box;
-
-/**
- * aligned(8) class TrackFragmentBox extends Box('traf'){
- * }
- */
-public class TrackFragmentBox extends AbstractContainerBox {
- public static final String TYPE = "traf";
-
- public TrackFragmentBox() {
- super(TYPE);
- }
-
-
- public TrackFragmentHeaderBox getTrackFragmentHeaderBox() {
- for (Box box : getBoxes()) {
- if (box instanceof TrackFragmentHeaderBox) {
- return (TrackFragmentHeaderBox) box;
- }
- }
- return null;
- }
-
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentHeaderBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentHeaderBox.java.svn-base
deleted file mode 100644
index fb9509b..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentHeaderBox.java.svn-base
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-
-/**
- * aligned(8) class TrackFragmentHeaderBox
- * extends FullBox('tfhd', 0, tf_flags){
- * unsigned int(32) track_ID;
- * // all the following are optional fields
- * unsigned int(64) base_data_offset;
- * unsigned int(32) sample_description_index;
- * unsigned int(32) default_sample_duration;
- * unsigned int(32) default_sample_size;
- * unsigned int(32) default_sample_flags
- * }
- */
-public class TrackFragmentHeaderBox extends AbstractFullBox {
- public static final String TYPE = "tfhd";
-
- private long trackId;
- private long baseDataOffset = -1;
- private long sampleDescriptionIndex;
- private long defaultSampleDuration = -1;
- private long defaultSampleSize = -1;
- private SampleFlags defaultSampleFlags;
- private boolean durationIsEmpty;
-
- public TrackFragmentHeaderBox() {
- super(TYPE);
- }
-
- protected long getContentSize() {
- long size = 8;
- int flags = getFlags();
- if ((flags & 0x1) == 1) { //baseDataOffsetPresent
- size += 8;
- }
- if ((flags & 0x2) == 0x2) { //sampleDescriptionIndexPresent
- size += 4;
- }
- if ((flags & 0x8) == 0x8) { //defaultSampleDurationPresent
- size += 4;
- }
- if ((flags & 0x10) == 0x10) { //defaultSampleSizePresent
- size += 4;
- }
- if ((flags & 0x20) == 0x20) { //defaultSampleFlagsPresent
- size += 4;
- }
- return size;
- }
-
-
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, trackId);
-
- if ((getFlags() & 0x1) == 1) { //baseDataOffsetPresent
- IsoTypeWriter.writeUInt64(byteBuffer, getBaseDataOffset());
- }
- if ((getFlags() & 0x2) == 0x2) { //sampleDescriptionIndexPresent
- IsoTypeWriter.writeUInt32(byteBuffer, getSampleDescriptionIndex());
- }
- if ((getFlags() & 0x8) == 0x8) { //defaultSampleDurationPresent
- IsoTypeWriter.writeUInt32(byteBuffer, getDefaultSampleDuration());
- }
- if ((getFlags() & 0x10) == 0x10) { //defaultSampleSizePresent
- IsoTypeWriter.writeUInt32(byteBuffer, getDefaultSampleSize());
- }
- if ((getFlags() & 0x20) == 0x20) { //defaultSampleFlagsPresent
- defaultSampleFlags.getContent(byteBuffer);
- }
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- trackId = IsoTypeReader.readUInt32(content);
- if ((getFlags() & 0x1) == 1) { //baseDataOffsetPresent
- baseDataOffset = IsoTypeReader.readUInt64(content);
- }
- if ((getFlags() & 0x2) == 0x2) { //sampleDescriptionIndexPresent
- sampleDescriptionIndex = IsoTypeReader.readUInt32(content);
- }
- if ((getFlags() & 0x8) == 0x8) { //defaultSampleDurationPresent
- defaultSampleDuration = IsoTypeReader.readUInt32(content);
- }
- if ((getFlags() & 0x10) == 0x10) { //defaultSampleSizePresent
- defaultSampleSize = IsoTypeReader.readUInt32(content);
- }
- if ((getFlags() & 0x20) == 0x20) { //defaultSampleFlagsPresent
- defaultSampleFlags = new SampleFlags(content);
- }
- if ((getFlags() & 0x10000) == 0x10000) { //durationIsEmpty
- durationIsEmpty = true;
- }
- }
-
- public boolean hasBaseDataOffset() {
- return (getFlags() & 0x1) != 0;
- }
-
- public boolean hasSampleDescriptionIndex() {
- return (getFlags() & 0x2) != 0;
- }
-
- public boolean hasDefaultSampleDuration() {
- return (getFlags() & 0x8) != 0;
- }
-
- public boolean hasDefaultSampleSize() {
- return (getFlags() & 0x10) != 0;
- }
-
- public boolean hasDefaultSampleFlags() {
- return (getFlags() & 0x20) != 0;
- }
-
- public long getTrackId() {
- return trackId;
- }
-
- public long getBaseDataOffset() {
- return baseDataOffset;
- }
-
- public long getSampleDescriptionIndex() {
- return sampleDescriptionIndex;
- }
-
- public long getDefaultSampleDuration() {
- return defaultSampleDuration;
- }
-
- public long getDefaultSampleSize() {
- return defaultSampleSize;
- }
-
- public SampleFlags getDefaultSampleFlags() {
- return defaultSampleFlags;
- }
-
- public boolean isDurationIsEmpty() {
- return durationIsEmpty;
- }
-
- public void setTrackId(long trackId) {
- this.trackId = trackId;
- }
-
- public void setBaseDataOffset(long baseDataOffset) {
- if (baseDataOffset == -1) {
- setFlags(getFlags() & (Integer.MAX_VALUE ^ 0x1));
- } else {
- setFlags(getFlags() | 0x1); // activate the field
- }
- this.baseDataOffset = baseDataOffset;
- }
-
- public void setSampleDescriptionIndex(long sampleDescriptionIndex) {
- if (sampleDescriptionIndex == -1) {
- setFlags(getFlags() & (Integer.MAX_VALUE ^ 0x2));
- } else {
- setFlags(getFlags() | 0x2); // activate the field
- }
- this.sampleDescriptionIndex = sampleDescriptionIndex;
- }
-
- public void setDefaultSampleDuration(long defaultSampleDuration) {
- setFlags(getFlags() | 0x8); // activate the field
- this.defaultSampleDuration = defaultSampleDuration;
- }
-
- public void setDefaultSampleSize(long defaultSampleSize) {
- setFlags(getFlags() | 0x10); // activate the field
- this.defaultSampleSize = defaultSampleSize;
- }
-
- public void setDefaultSampleFlags(SampleFlags defaultSampleFlags) {
- setFlags(getFlags() | 0x20); // activate the field
- this.defaultSampleFlags = defaultSampleFlags;
- }
-
- public void setDurationIsEmpty(boolean durationIsEmpty) {
- setFlags(getFlags() | 0x10000); // activate the field
- this.durationIsEmpty = durationIsEmpty;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("TrackFragmentHeaderBox");
- sb.append("{trackId=").append(trackId);
- sb.append(", baseDataOffset=").append(baseDataOffset);
- sb.append(", sampleDescriptionIndex=").append(sampleDescriptionIndex);
- sb.append(", defaultSampleDuration=").append(defaultSampleDuration);
- sb.append(", defaultSampleSize=").append(defaultSampleSize);
- sb.append(", defaultSampleFlags=").append(defaultSampleFlags);
- sb.append(", durationIsEmpty=").append(durationIsEmpty);
- sb.append('}');
- return sb.toString();
- }
-
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentRandomAccessBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentRandomAccessBox.java.svn-base
deleted file mode 100644
index 94d24ae..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackFragmentRandomAccessBox.java.svn-base
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeReaderVariable;
-import com.coremedia.iso.IsoTypeWriter;
-import com.coremedia.iso.IsoTypeWriterVariable;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * aligned(8) class TrackFragmentRandomAccessBox
- * extends FullBox('tfra', version, 0) {
- * unsigned int(32) track_ID;
- * const unsigned int(26) reserved = 0;
- * unsigned int(2) length_size_of_traf_num;
- * unsigned int(2) length_size_of_trun_num;
- * unsigned int(2) length_size_of_sample_num;
- * unsigned int(32) number_of_entry;
- * for(i=1; i <= number_of_entry; i++){
- * if(version==1){
- * unsigned int(64) time;
- * unsigned int(64) moof_offset;
- * }else{
- * unsigned int(32) time;
- * unsigned int(32) moof_offset;
- * }
- * unsigned int((length_size_of_traf_num+1) * 8) traf_number;
- * unsigned int((length_size_of_trun_num+1) * 8) trun_number;
- * unsigned int((length_size_of_sample_num+1) * 8) sample_number;
- * }
- * }
- */
-public class TrackFragmentRandomAccessBox extends AbstractFullBox {
- public static final String TYPE = "tfra";
-
- private long trackId;
- private int reserved;
- private int lengthSizeOfTrafNum = 2;
- private int lengthSizeOfTrunNum = 2;
- private int lengthSizeOfSampleNum = 2;
- private List<Entry> entries = Collections.emptyList();
-
- public TrackFragmentRandomAccessBox() {
- super(TYPE);
- }
-
-
- protected long getContentSize() {
- long contentSize = 4;
- contentSize += 4 + 4 /*26 + 2 + 2 + 2 */ + 4;
- if (getVersion() == 1) {
- contentSize += (8 + 8) * entries.size();
- } else {
- contentSize += (4 + 4) * entries.size();
- }
- contentSize += lengthSizeOfTrafNum * entries.size();
- contentSize += lengthSizeOfTrunNum * entries.size();
- contentSize += lengthSizeOfSampleNum * entries.size();
- return contentSize;
- }
-
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- trackId = IsoTypeReader.readUInt32(content);
- long temp = IsoTypeReader.readUInt32(content);
- reserved = (int) (temp >> 6);
- lengthSizeOfTrafNum = ((int) (temp & 0x3F) >> 4) + 1;
- lengthSizeOfTrunNum = ((int) (temp & 0xC) >> 2) + 1;
- lengthSizeOfSampleNum = ((int) (temp & 0x3)) + 1;
- long numberOfEntries = IsoTypeReader.readUInt32(content);
-
- entries = new ArrayList<Entry>();
-
- for (int i = 0; i < numberOfEntries; i++) {
- Entry entry = new Entry();
- if (getVersion() == 1) {
- entry.time = IsoTypeReader.readUInt64(content);
- entry.moofOffset = IsoTypeReader.readUInt64(content);
- } else {
- entry.time = IsoTypeReader.readUInt32(content);
- entry.moofOffset = IsoTypeReader.readUInt32(content);
- }
- entry.trafNumber = IsoTypeReaderVariable.read(content, lengthSizeOfTrafNum);
- entry.trunNumber = IsoTypeReaderVariable.read(content, lengthSizeOfTrunNum);
- entry.sampleNumber = IsoTypeReaderVariable.read(content, lengthSizeOfSampleNum);
-
- entries.add(entry);
- }
-
- }
-
-
- @Override
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, trackId);
- long temp;
- temp = reserved << 6;
- temp = temp | (((lengthSizeOfTrafNum - 1) & 0x3) << 4);
- temp = temp | (((lengthSizeOfTrunNum - 1) & 0x3) << 2);
- temp = temp | ((lengthSizeOfSampleNum - 1) & 0x3);
- IsoTypeWriter.writeUInt32(byteBuffer, temp);
- IsoTypeWriter.writeUInt32(byteBuffer, entries.size());
-
- for (Entry entry : entries) {
- if (getVersion() == 1) {
- IsoTypeWriter.writeUInt64(byteBuffer, entry.time);
- IsoTypeWriter.writeUInt64(byteBuffer, entry.moofOffset);
- } else {
- IsoTypeWriter.writeUInt32(byteBuffer, entry.time);
- IsoTypeWriter.writeUInt32(byteBuffer, entry.moofOffset);
- }
- IsoTypeWriterVariable.write(entry.trafNumber, byteBuffer, lengthSizeOfTrafNum);
- IsoTypeWriterVariable.write(entry.trunNumber, byteBuffer, lengthSizeOfTrunNum);
- IsoTypeWriterVariable.write(entry.sampleNumber, byteBuffer, lengthSizeOfSampleNum);
-
- }
- }
-
-
- public void setTrackId(long trackId) {
- this.trackId = trackId;
- }
-
- public void setLengthSizeOfTrafNum(int lengthSizeOfTrafNum) {
- this.lengthSizeOfTrafNum = lengthSizeOfTrafNum;
- }
-
- public void setLengthSizeOfTrunNum(int lengthSizeOfTrunNum) {
- this.lengthSizeOfTrunNum = lengthSizeOfTrunNum;
- }
-
- public void setLengthSizeOfSampleNum(int lengthSizeOfSampleNum) {
- this.lengthSizeOfSampleNum = lengthSizeOfSampleNum;
- }
-
- public long getTrackId() {
- return trackId;
- }
-
- public int getReserved() {
- return reserved;
- }
-
- public int getLengthSizeOfTrafNum() {
- return lengthSizeOfTrafNum;
- }
-
- public int getLengthSizeOfTrunNum() {
- return lengthSizeOfTrunNum;
- }
-
- public int getLengthSizeOfSampleNum() {
- return lengthSizeOfSampleNum;
- }
-
- public long getNumberOfEntries() {
- return entries.size();
- }
-
- public List<Entry> getEntries() {
- return Collections.unmodifiableList(entries);
- }
-
- public void setEntries(List<Entry> entries) {
- this.entries = entries;
- }
-
- public static class Entry {
- private long time;
- private long moofOffset;
- private long trafNumber;
- private long trunNumber;
- private long sampleNumber;
-
- public Entry() {
- }
-
- public Entry(long time, long moofOffset, long trafNumber, long trunNumber, long sampleNumber) {
- this.moofOffset = moofOffset;
- this.sampleNumber = sampleNumber;
- this.time = time;
- this.trafNumber = trafNumber;
- this.trunNumber = trunNumber;
- }
-
- public long getTime() {
- return time;
- }
-
- public long getMoofOffset() {
- return moofOffset;
- }
-
- public long getTrafNumber() {
- return trafNumber;
- }
-
- public long getTrunNumber() {
- return trunNumber;
- }
-
- public long getSampleNumber() {
- return sampleNumber;
- }
-
- public void setTime(long time) {
- this.time = time;
- }
-
- public void setMoofOffset(long moofOffset) {
- this.moofOffset = moofOffset;
- }
-
- public void setTrafNumber(long trafNumber) {
- this.trafNumber = trafNumber;
- }
-
- public void setTrunNumber(long trunNumber) {
- this.trunNumber = trunNumber;
- }
-
- public void setSampleNumber(long sampleNumber) {
- this.sampleNumber = sampleNumber;
- }
-
- @Override
- public String toString() {
- return "Entry{" +
- "time=" + time +
- ", moofOffset=" + moofOffset +
- ", trafNumber=" + trafNumber +
- ", trunNumber=" + trunNumber +
- ", sampleNumber=" + sampleNumber +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Entry entry = (Entry) o;
-
- if (moofOffset != entry.moofOffset) return false;
- if (sampleNumber != entry.sampleNumber) return false;
- if (time != entry.time) return false;
- if (trafNumber != entry.trafNumber) return false;
- if (trunNumber != entry.trunNumber) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = (int) (time ^ (time >>> 32));
- result = 31 * result + (int) (moofOffset ^ (moofOffset >>> 32));
- result = 31 * result + (int) (trafNumber ^ (trafNumber >>> 32));
- result = 31 * result + (int) (trunNumber ^ (trunNumber >>> 32));
- result = 31 * result + (int) (sampleNumber ^ (sampleNumber >>> 32));
- return result;
- }
- }
-
- @Override
- public String toString() {
- return "TrackFragmentRandomAccessBox{" +
- "trackId=" + trackId +
- ", entries=" + entries +
- '}';
- }
-}
diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackRunBox.java.svn-base b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackRunBox.java.svn-base
deleted file mode 100644
index fc4faac..0000000
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/.svn/text-base/TrackRunBox.java.svn-base
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright 2009 castLabs GmbH, Berlin
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.coremedia.iso.boxes.fragment;
-
-import com.coremedia.iso.IsoTypeReader;
-import com.coremedia.iso.IsoTypeWriter;
-import com.coremedia.iso.boxes.MovieBox;
-import com.googlecode.mp4parser.AbstractFullBox;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-import static com.googlecode.mp4parser.util.CastUtils.l2i;
-
-/**
- * aligned(8) class TrackRunBox
- * extends FullBox('trun', 0, tr_flags) {
- * unsigned int(32) sample_count;
- * // the following are optional fields
- * signed int(32) data_offset;
- * unsigned int(32) first_sample_flags;
- * // all fields in the following array are optional
- * {
- * unsigned int(32) sample_duration;
- * unsigned int(32) sample_size;
- * unsigned int(32) sample_flags
- * unsigned int(32) sample_composition_time_offset;
- * }[ sample_count ]
- * }
- */
-
-public class TrackRunBox extends AbstractFullBox {
- public static final String TYPE = "trun";
- private int dataOffset;
- private SampleFlags firstSampleFlags;
- private List<Entry> entries = new ArrayList<Entry>();
-
-
- public List<Entry> getEntries() {
- return entries;
- }
-
- public static class Entry {
- private long sampleDuration;
- private long sampleSize;
- private SampleFlags sampleFlags;
- private int sampleCompositionTimeOffset;
-
- public Entry() {
- }
-
- public Entry(long sampleDuration, long sampleSize, SampleFlags sampleFlags, int sampleCompositionTimeOffset) {
- this.sampleDuration = sampleDuration;
- this.sampleSize = sampleSize;
- this.sampleFlags = sampleFlags;
- this.sampleCompositionTimeOffset = sampleCompositionTimeOffset;
- }
-
- public long getSampleDuration() {
- return sampleDuration;
- }
-
- public long getSampleSize() {
- return sampleSize;
- }
-
- public SampleFlags getSampleFlags() {
- return sampleFlags;
- }
-
- public int getSampleCompositionTimeOffset() {
- return sampleCompositionTimeOffset;
- }
-
- public void setSampleDuration(long sampleDuration) {
- this.sampleDuration = sampleDuration;
- }
-
- public void setSampleSize(long sampleSize) {
- this.sampleSize = sampleSize;
- }
-
- public void setSampleFlags(SampleFlags sampleFlags) {
- this.sampleFlags = sampleFlags;
- }
-
- public void setSampleCompositionTimeOffset(int sampleCompositionTimeOffset) {
- this.sampleCompositionTimeOffset = sampleCompositionTimeOffset;
- }
-
- @Override
- public String toString() {
- return "Entry{" +
- "sampleDuration=" + sampleDuration +
- ", sampleSize=" + sampleSize +
- ", sampleFlags=" + sampleFlags +
- ", sampleCompositionTimeOffset=" + sampleCompositionTimeOffset +
- '}';
- }
- }
-
- public void setDataOffset(int dataOffset) {
- if (dataOffset == -1) {
- setFlags(getFlags() & (0xFFFFFF ^ 1));
- } else {
- setFlags(getFlags() | 0x1); // turn on dataoffset
- }
- this.dataOffset = dataOffset;
- }
-
- public long[] getSampleCompositionTimeOffsets() {
- if (isSampleCompositionTimeOffsetPresent()) {
- long[] result = new long[entries.size()];
-
- for (int i = 0; i < result.length; i++) {
- result[i] = entries.get(i).getSampleCompositionTimeOffset();
- }
- return result;
- }
- return null;
- }
-
- public TrackExtendsBox getTrackExtendsBox() {
- final TrackFragmentHeaderBox tfhd = ((TrackFragmentBox) getParent()).getTrackFragmentHeaderBox();
- final List<MovieBox> movieBoxes = tfhd.getIsoFile().getBoxes(MovieBox.class);
- if (movieBoxes.size() == 0) {
- return null;
- }
-
- final List<TrackExtendsBox> trexBoxes = movieBoxes.get(0).getBoxes(TrackExtendsBox.class, true);
- TrackExtendsBox trex = null;
- for (TrackExtendsBox aTrex : trexBoxes) {
- if (aTrex.getTrackId() == tfhd.getTrackId()) {
- trex = aTrex;
- }
- }
- return trex;
- }
-
- public TrackRunBox() {
- super(TYPE);
- }
-
- protected long getContentSize() {
- long size = 8;
- int flags = getFlags();
-
- if ((flags & 0x1) == 0x1) { //dataOffsetPresent
- size += 4;
- }
- if ((flags & 0x4) == 0x4) { //firstSampleFlagsPresent
- size += 4;
- }
-
- long entrySize = 0;
- if ((flags & 0x100) == 0x100) { //sampleDurationPresent
- entrySize += 4;
- }
- if ((flags & 0x200) == 0x200) { //sampleSizePresent
- entrySize += 4;
- }
- if ((flags & 0x400) == 0x400) { //sampleFlagsPresent
- entrySize += 4;
- }
- if ((flags & 0x800) == 0x800) { //sampleCompositionTimeOffsetPresent
- entrySize += 4;
- }
- size += entrySize * entries.size();
- return size;
- }
-
- protected void getContent(ByteBuffer byteBuffer) {
- writeVersionAndFlags(byteBuffer);
- IsoTypeWriter.writeUInt32(byteBuffer, entries.size());
- int flags = getFlags();
-
- if ((flags & 0x1) == 1) { //dataOffsetPresent
- IsoTypeWriter.writeUInt32(byteBuffer, dataOffset);
- }
- if ((flags & 0x4) == 0x4) { //firstSampleFlagsPresent
- firstSampleFlags.getContent(byteBuffer);
- }
-
- for (Entry entry : entries) {
- if ((flags & 0x100) == 0x100) { //sampleDurationPresent
- IsoTypeWriter.writeUInt32(byteBuffer, entry.sampleDuration);
- }
- if ((flags & 0x200) == 0x200) { //sampleSizePresent
- IsoTypeWriter.writeUInt32(byteBuffer, entry.sampleSize);
- }
- if ((flags & 0x400) == 0x400) { //sampleFlagsPresent
- entry.sampleFlags.getContent(byteBuffer);
- }
- if ((flags & 0x800) == 0x800) { //sampleCompositionTimeOffsetPresent
- byteBuffer.putInt(entry.sampleCompositionTimeOffset);
- }
- }
- }
-
- @Override
- public void _parseDetails(ByteBuffer content) {
- parseVersionAndFlags(content);
- long sampleCount = IsoTypeReader.readUInt32(content);
-
- if ((getFlags() & 0x1) == 1) { //dataOffsetPresent
- dataOffset = l2i(IsoTypeReader.readUInt32(content));
- } else {
- dataOffset = -1;
- }
- if ((getFlags() & 0x4) == 0x4) { //firstSampleFlagsPresent
- firstSampleFlags = new SampleFlags(content);
- }
-
- for (int i = 0; i < sampleCount; i++) {
- Entry entry = new Entry();
- if ((getFlags() & 0x100) == 0x100) { //sampleDurationPresent
- entry.sampleDuration = IsoTypeReader.readUInt32(content);
- }
- if ((getFlags() & 0x200) == 0x200) { //sampleSizePresent
- entry.sampleSize = IsoTypeReader.readUInt32(content);
- }
- if ((getFlags() & 0x400) == 0x400) { //sampleFlagsPresent
- entry.sampleFlags = new SampleFlags(content);
- }
- if ((getFlags() & 0x800) == 0x800) { //sampleCompositionTimeOffsetPresent
- entry.sampleCompositionTimeOffset = content.getInt();
- }
- entries.add(entry);
- }
-
- }
-
- public long getSampleCount() {
- return entries.size();
- }
-
- public boolean isDataOffsetPresent() {
- return (getFlags() & 0x1) == 1;
- }
-
- public boolean isFirstSampleFlagsPresent() {
- return (getFlags() & 0x4) == 0x4;
- }
-
-
- public boolean isSampleSizePresent() {
- return (getFlags() & 0x200) == 0x200;
- }
-
- public boolean isSampleDurationPresent() {
- return (getFlags() & 0x100) == 0x100;
- }
-
- public boolean isSampleFlagsPresent() {
- return (getFlags() & 0x400) == 0x400;
- }
-
- public boolean isSampleCompositionTimeOffsetPresent() {
- return (getFlags() & 0x800) == 0x800;
- }
-
- public void setDataOffsetPresent(boolean v) {
- if (v) {
- setFlags(getFlags() | 0x01);
- } else {
- setFlags(getFlags() & (0xFFFFFF ^ 0x1));
- }
- }
-
- public void setSampleSizePresent(boolean v) {
- if (v) {
- setFlags(getFlags() | 0x200);
- } else {
- setFlags(getFlags() & (0xFFFFFF ^ 0x200));
- }
- }
-
- public void setSampleDurationPresent(boolean v) {
-
- if (v) {
- setFlags(getFlags() | 0x100);
- } else {
- setFlags(getFlags() & (0xFFFFFF ^ 0x100));
- }
- }
-
- public void setSampleFlagsPresent(boolean v) {
- if (v) {
- setFlags(getFlags() | 0x400);
- } else {
- setFlags(getFlags() & (0xFFFFFF ^ 0x400));
- }
- }
-
- public void setSampleCompositionTimeOffsetPresent(boolean v) {
- if (v) {
- setFlags(getFlags() | 0x800);
- } else {
- setFlags(getFlags() & (0xFFFFFF ^ 0x800));
- }
-
- }
-
- public int getDataOffset() {
- return dataOffset;
- }
-
- public SampleFlags getFirstSampleFlags() {
- return firstSampleFlags;
- }
-
- public void setFirstSampleFlags(SampleFlags firstSampleFlags) {
- if (firstSampleFlags == null) {
- setFlags(getFlags() & (0xFFFFFF ^ 0x4));
- } else {
- setFlags(getFlags() | 0x4);
- }
- this.firstSampleFlags = firstSampleFlags;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("TrackRunBox");
- sb.append("{sampleCount=").append(entries.size());
- sb.append(", dataOffset=").append(dataOffset);
- sb.append(", dataOffsetPresent=").append(isDataOffsetPresent());
- sb.append(", sampleSizePresent=").append(isSampleSizePresent());
- sb.append(", sampleDurationPresent=").append(isSampleDurationPresent());
- sb.append(", sampleFlagsPresentPresent=").append(isSampleFlagsPresent());
- sb.append(", sampleCompositionTimeOffsetPresent=").append(isSampleCompositionTimeOffsetPresent());
- sb.append(", firstSampleFlags=").append(firstSampleFlags);
- sb.append('}');
- return sb.toString();
- }
-
- public void setEntries(List<Entry> entries) {
- this.entries = entries;
- }
-}