org.jcodec.containers.mkv.elements.EBML Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcodec Show documentation
Show all versions of jcodec Show documentation
Pure Java implementation of video/audio codecs and formats
package org.jcodec.containers.mkv.elements;
import java.util.Arrays;
import org.jcodec.containers.mkv.Type;
import org.jcodec.containers.mkv.ebml.Element;
import org.jcodec.containers.mkv.ebml.MasterElement;
import org.jcodec.containers.mkv.ebml.StringElement;
public class EBML extends MasterElement {
public EBML(byte[] typeId) {
super(typeId);
assert Arrays.equals(Type.EBML.id, typeId);
}
@Override
public void addChildElement(Element elem) {
if (elem.isSameMatroskaType(Type.DocType)) {
String DocType = ((StringElement) elem).get();
if (DocType.compareTo("matroska") != 0 && DocType.compareTo("webm") != 0) {
throw new java.lang.RuntimeException("Error: DocType is not matroska, \"" + ((StringElement) elem).get() + "\"");
}
}
super.addChildElement(elem);
}
}