diff options
Diffstat (limited to 'isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet')
6 files changed, 469 insertions, 0 deletions
diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/all-wcprops b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/all-wcprops new file mode 100644 index 0000000..4e87a87 --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/!svn/ver/507/trunk/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet +END +BaseLocationBox.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/!svn/ver/507/trunk/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/BaseLocationBox.java +END +AssetInformationBox.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/!svn/ver/505/trunk/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/AssetInformationBox.java +END diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/entries b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/entries new file mode 100644 index 0000000..c7166b8 --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +778 +http://mp4parser.googlecode.com/svn/trunk/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet +http://mp4parser.googlecode.com/svn + + + +2012-04-21T22:05:38.425329Z +507 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + +7decde4b-c250-0410-a0da-51896bc88be6 + +BaseLocationBox.java +file + + + + +2012-09-14T17:27:51.307230Z +40378a4f505496f720804c1f201fc542 +2012-04-21T22:05:38.425329Z +507 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + + + + + + + + +3319 + +AssetInformationBox.java +file + + + + +2012-09-14T17:27:51.307230Z +a43de0d08b7416e7a9034f0840cc2eeb +2012-04-21T21:18:31.685061Z +505 +Sebastian.Annies@gmail.com + + + + + + + + + + + + + + + + + + + + + +2063 + diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/AssetInformationBox.java.svn-base b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/AssetInformationBox.java.svn-base new file mode 100644 index 0000000..a2a9e8a --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/AssetInformationBox.java.svn-base @@ -0,0 +1,75 @@ +/* + * Copyright 2011 castLabs, 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.googlecode.mp4parser.boxes.ultraviolet; + +import com.coremedia.iso.IsoTypeReader; +import com.coremedia.iso.Utf8; +import com.googlecode.mp4parser.AbstractFullBox; + +import java.nio.ByteBuffer; + +/** + * AssetInformationBox as defined Common File Format Spec. + */ +public class AssetInformationBox extends AbstractFullBox { + String apid = ""; + String profileVersion = "0000"; + + public AssetInformationBox() { + super("ainf"); + } + + @Override + protected long getContentSize() { + return Utf8.utf8StringLengthInBytes(apid) + 9; + } + + + @Override + protected void getContent(ByteBuffer byteBuffer) { + writeVersionAndFlags(byteBuffer); + byteBuffer.put(Utf8.convert(profileVersion), 0, 4); + byteBuffer.put(Utf8.convert(apid)); + byteBuffer.put((byte) 0); + } + + + @Override + public void _parseDetails(ByteBuffer content) { + parseVersionAndFlags(content); + profileVersion = IsoTypeReader.readString(content, 4); + apid = IsoTypeReader.readString(content); + content = null; + } + + public String getApid() { + return apid; + } + + public void setApid(String apid) { + this.apid = apid; + } + + public String getProfileVersion() { + return profileVersion; + } + + public void setProfileVersion(String profileVersion) { + assert profileVersion != null && profileVersion.length() == 4; + this.profileVersion = profileVersion; + } +} diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/BaseLocationBox.java.svn-base b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/BaseLocationBox.java.svn-base new file mode 100644 index 0000000..1c63293 --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/.svn/text-base/BaseLocationBox.java.svn-base @@ -0,0 +1,103 @@ +/* + * Copyright 2011 castLabs, 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.googlecode.mp4parser.boxes.ultraviolet; + +import com.coremedia.iso.IsoTypeReader; +import com.coremedia.iso.Utf8; +import com.googlecode.mp4parser.AbstractFullBox; + +import java.nio.ByteBuffer; + +/** + * + */ +public class BaseLocationBox extends AbstractFullBox { + String baseLocation = ""; + String purchaseLocation = ""; + + public BaseLocationBox() { + super("bloc"); + } + + public BaseLocationBox(String baseLocation, String purchaseLocation) { + super("bloc"); + this.baseLocation = baseLocation; + this.purchaseLocation = purchaseLocation; + } + + public String getBaseLocation() { + return baseLocation; + } + + public void setBaseLocation(String baseLocation) { + this.baseLocation = baseLocation; + } + + public String getPurchaseLocation() { + return purchaseLocation; + } + + public void setPurchaseLocation(String purchaseLocation) { + this.purchaseLocation = purchaseLocation; + } + + @Override + protected long getContentSize() { + return 1028; + } + + @Override + public void _parseDetails(ByteBuffer content) { + parseVersionAndFlags(content); + baseLocation = IsoTypeReader.readString(content); + content.get(new byte[256 - Utf8.utf8StringLengthInBytes(baseLocation) - 1]); + purchaseLocation = IsoTypeReader.readString(content); + content.get(new byte[256 - Utf8.utf8StringLengthInBytes(purchaseLocation) - 1]); + content.get(new byte[512]); + } + + @Override + protected void getContent(ByteBuffer byteBuffer) { + writeVersionAndFlags(byteBuffer); + byteBuffer.put(Utf8.convert(baseLocation)); + byteBuffer.put(new byte[256 - Utf8.utf8StringLengthInBytes(baseLocation)]); // string plus term zero + byteBuffer.put(Utf8.convert(purchaseLocation)); + byteBuffer.put(new byte[256 - Utf8.utf8StringLengthInBytes(purchaseLocation)]); // string plus term zero + byteBuffer.put(new byte[512]); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BaseLocationBox that = (BaseLocationBox) o; + + if (baseLocation != null ? !baseLocation.equals(that.baseLocation) : that.baseLocation != null) return false; + if (purchaseLocation != null ? !purchaseLocation.equals(that.purchaseLocation) : that.purchaseLocation != null) + return false; + + return true; + } + + @Override + public int hashCode() { + int result = baseLocation != null ? baseLocation.hashCode() : 0; + result = 31 * result + (purchaseLocation != null ? purchaseLocation.hashCode() : 0); + return result; + } +} diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/AssetInformationBox.java b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/AssetInformationBox.java new file mode 100644 index 0000000..a2a9e8a --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/AssetInformationBox.java @@ -0,0 +1,75 @@ +/* + * Copyright 2011 castLabs, 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.googlecode.mp4parser.boxes.ultraviolet; + +import com.coremedia.iso.IsoTypeReader; +import com.coremedia.iso.Utf8; +import com.googlecode.mp4parser.AbstractFullBox; + +import java.nio.ByteBuffer; + +/** + * AssetInformationBox as defined Common File Format Spec. + */ +public class AssetInformationBox extends AbstractFullBox { + String apid = ""; + String profileVersion = "0000"; + + public AssetInformationBox() { + super("ainf"); + } + + @Override + protected long getContentSize() { + return Utf8.utf8StringLengthInBytes(apid) + 9; + } + + + @Override + protected void getContent(ByteBuffer byteBuffer) { + writeVersionAndFlags(byteBuffer); + byteBuffer.put(Utf8.convert(profileVersion), 0, 4); + byteBuffer.put(Utf8.convert(apid)); + byteBuffer.put((byte) 0); + } + + + @Override + public void _parseDetails(ByteBuffer content) { + parseVersionAndFlags(content); + profileVersion = IsoTypeReader.readString(content, 4); + apid = IsoTypeReader.readString(content); + content = null; + } + + public String getApid() { + return apid; + } + + public void setApid(String apid) { + this.apid = apid; + } + + public String getProfileVersion() { + return profileVersion; + } + + public void setProfileVersion(String profileVersion) { + assert profileVersion != null && profileVersion.length() == 4; + this.profileVersion = profileVersion; + } +} diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/BaseLocationBox.java b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/BaseLocationBox.java new file mode 100644 index 0000000..1c63293 --- /dev/null +++ b/isoparser/src/main/java/com/googlecode/mp4parser/boxes/ultraviolet/BaseLocationBox.java @@ -0,0 +1,103 @@ +/* + * Copyright 2011 castLabs, 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.googlecode.mp4parser.boxes.ultraviolet; + +import com.coremedia.iso.IsoTypeReader; +import com.coremedia.iso.Utf8; +import com.googlecode.mp4parser.AbstractFullBox; + +import java.nio.ByteBuffer; + +/** + * + */ +public class BaseLocationBox extends AbstractFullBox { + String baseLocation = ""; + String purchaseLocation = ""; + + public BaseLocationBox() { + super("bloc"); + } + + public BaseLocationBox(String baseLocation, String purchaseLocation) { + super("bloc"); + this.baseLocation = baseLocation; + this.purchaseLocation = purchaseLocation; + } + + public String getBaseLocation() { + return baseLocation; + } + + public void setBaseLocation(String baseLocation) { + this.baseLocation = baseLocation; + } + + public String getPurchaseLocation() { + return purchaseLocation; + } + + public void setPurchaseLocation(String purchaseLocation) { + this.purchaseLocation = purchaseLocation; + } + + @Override + protected long getContentSize() { + return 1028; + } + + @Override + public void _parseDetails(ByteBuffer content) { + parseVersionAndFlags(content); + baseLocation = IsoTypeReader.readString(content); + content.get(new byte[256 - Utf8.utf8StringLengthInBytes(baseLocation) - 1]); + purchaseLocation = IsoTypeReader.readString(content); + content.get(new byte[256 - Utf8.utf8StringLengthInBytes(purchaseLocation) - 1]); + content.get(new byte[512]); + } + + @Override + protected void getContent(ByteBuffer byteBuffer) { + writeVersionAndFlags(byteBuffer); + byteBuffer.put(Utf8.convert(baseLocation)); + byteBuffer.put(new byte[256 - Utf8.utf8StringLengthInBytes(baseLocation)]); // string plus term zero + byteBuffer.put(Utf8.convert(purchaseLocation)); + byteBuffer.put(new byte[256 - Utf8.utf8StringLengthInBytes(purchaseLocation)]); // string plus term zero + byteBuffer.put(new byte[512]); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BaseLocationBox that = (BaseLocationBox) o; + + if (baseLocation != null ? !baseLocation.equals(that.baseLocation) : that.baseLocation != null) return false; + if (purchaseLocation != null ? !purchaseLocation.equals(that.purchaseLocation) : that.purchaseLocation != null) + return false; + + return true; + } + + @Override + public int hashCode() { + int result = baseLocation != null ? baseLocation.hashCode() : 0; + result = 31 * result + (purchaseLocation != null ? purchaseLocation.hashCode() : 0); + return result; + } +} |