protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("}"); }
protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("\"boxes\": ["); dumpBoxes(sb); sb.append("]"); sb.append("}"); }
protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); collectModel(this.getClass(), fields); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("}"); }
protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); collectModel(this.getClass(), fields); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("}"); }
public ByteOrder getEndian() { EndianBox endianBox = NodeBox.findFirstPath(this, EndianBox.class, new String[] { WaveExtension.fourcc(), EndianBox.fourcc() }); if (endianBox == null) { if ("twos".equals(header.getFourcc())) return ByteOrder.BIG_ENDIAN; else if ("lpcm".equals(header.getFourcc())) return (lpcmFlags & kAudioFormatFlagIsBigEndian) != 0 ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; else if ("sowt".equals(header.getFourcc())) return ByteOrder.LITTLE_ENDIAN; else return ByteOrder.BIG_ENDIAN; } return endianBox.getEndian(); }
private List<Atom> getFragments(SeekableByteChannel f) throws IOException { List<Atom> result = new LinkedList<Atom>(); for (Atom atom : MP4Util.getRootAtoms(f)) { if ("moof".equals(atom.getHeader().getFourcc())) { result.add(atom); } } return result; } }
protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); collectModel(this.getClass(), fields); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("\"boxes\": ["); dumpBoxes(sb); sb.append("]"); sb.append("}"); }
protected void dump(StringBuilder sb) { sb.append("{\"tag\":\"" + header.getFourcc() + "\","); List<String> fields = new ArrayList<String>(0); collectModel(this.getClass(), fields); ToJSON.fieldsToJSON(this, sb, fields.toArray(new String[0])); sb.append("\"boxes\": ["); dumpBoxes(sb); sb.append("]"); sb.append("}"); }
private Atom getMoov(SeekableByteChannel f) throws IOException { for (Atom atom : MP4Util.getRootAtoms(f)) { if ("moov".equals(atom.getHeader().getFourcc())) { return atom; } } return null; }
private Atom getMoov(SeekableByteChannel f) throws IOException { for (Atom atom : MP4Util.getRootAtoms(f)) { if ("moov".equals(atom.getHeader().getFourcc())) { return atom; } } return null; } }
public static Atom findFirstAtom(String fourcc, SeekableByteChannel input) throws IOException { List<Atom> rootAtoms = getRootAtoms(input); for (Atom atom : rootAtoms) { if (fourcc.equals(atom.getHeader().getFourcc())) return atom; } return null; }
public String getFourcc() { SampleEntry[] entries = getSampleEntries(); SampleEntry se = entries == null || entries.length == 0 ? null : entries[0]; String fourcc = se == null ? null : se.getHeader().getFourcc(); return fourcc; }
public static MovieBox parseMovie(SeekableByteChannel input) throws IOException { for (Atom atom : getRootAtoms(input)) { if ("moov".equals(atom.getHeader().getFourcc())) { return (MovieBox) atom.parseBox(input); } } return null; }
public static <T extends Box> void findDeepInner(Box box, Class<T> class1, String name, List<T> storage) { if (box == null) return; if (name.equals(box.getHeader().getFourcc())) { storage.add((T) box); return; } if (box instanceof NodeBox) { NodeBox nb = (NodeBox) box; for (Box candidate : nb.getBoxes()) { findDeepInner(candidate, class1, name, storage); } } }
public static MovieBox parseMovie(SeekableByteChannel input) throws IOException { for (Atom atom : getRootAtoms(input)) { if ("moov".equals(atom.getHeader().getFourcc())) { return (MovieBox) atom.parseBox(input); } } return null; }
public static Movie parseFullMovieChannel(SeekableByteChannel input) throws IOException { FileTypeBox ftyp = null; for (Atom atom : getRootAtoms(input)) { if ("ftyp".equals(atom.getHeader().getFourcc())) { ftyp = (FileTypeBox) atom.parseBox(input); } else if ("moov".equals(atom.getHeader().getFourcc())) { return new Movie(ftyp, (MovieBox) atom.parseBox(input)); } } return null; }
public static MovieBox parseMovieChannel(SeekableByteChannel input) throws IOException { for (Atom atom : getRootAtoms(input)) { if ("moov".equals(atom.getHeader().getFourcc())) { return (MovieBox) atom.parseBox(input); } } return null; }
@Override public Box newBox(Header header) { if (header.getFourcc().equals(UdtaMetaBox.fourcc())) { UdtaMetaBox box = new UdtaMetaBox(header); box.setFactory(_factory); return box; } return _factory.newBox(header); } };