public static DataRefBox createDataRefBox() { return new DataRefBox(new Header(fourcc())); }
protected void addDref(NodeBox minf) { DataInfoBox dinf = DataInfoBox.createDataInfoBox(); minf.add(dinf); DataRefBox dref = DataRefBox.createDataRefBox(); dinf.add(dref); dref.add(LeafBox.createLeafBox(Header.createHeader("alis", 0), ByteBuffer.wrap(new byte[] { 0, 0, 0, 1 }))); }
private static void appendDrefs(TrakBox trakBox1, TrakBox trakBox2) { DataRefBox dref1 = NodeBox.findFirstPath(trakBox1, DataRefBox.class, Box.path("mdia.minf.dinf.dref")); DataRefBox dref2 = NodeBox.findFirstPath(trakBox2, DataRefBox.class, Box.path("mdia.minf.dinf.dref")); dref1.getBoxes().addAll(dref2.getBoxes()); }
private void cleanDrefs(TrakBox trak) { MediaInfoBox minf = trak.getMdia().getMinf(); DataInfoBox dinf = trak.getMdia().getMinf().getDinf(); if (dinf == null) { dinf = new DataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); if (dref == null) { dref = new DataRefBox(); dinf.add(dref); } dref.getBoxes().clear(); dref.add(AliasBox.createSelfRef()); for (SampleEntry entry : NodeBox.findAll(trak, SampleEntry.class, "mdia", "minf", "stbl", "stsd", null)) { entry.setDrefInd((short) 1); } }
protected void addDref(NodeBox minf) { DataInfoBox dinf = new DataInfoBox(); minf.add(dinf); DataRefBox dref = new DataRefBox(); dinf.add(dref); dref.add(new LeafBox(new Header("alis", 0), ByteBuffer.wrap(new byte[] { 0, 0, 0, 1 }))); } }
private void cleanDrefs(TrakBox trak) { MediaInfoBox minf = trak.getMdia().getMinf(); DataInfoBox dinf = trak.getMdia().getMinf().getDinf(); if (dinf == null) { dinf = DataInfoBox.createDataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); if (dref == null) { dref = DataRefBox.createDataRefBox(); dinf.add(dref); } dref.getBoxes().clear(); dref.add(AliasBox.createSelfRef()); SampleEntry[] sampleEntries = trak.getSampleEntries(); for (int i = 0; i < sampleEntries.length; i++) { SampleEntry entry = sampleEntries[i]; entry.setDrefInd((short) 1); } }
public DataRefBox() { this(new Header(fourcc())); }
private void cleanDrefs(TrakBox trak) { MediaInfoBox minf = trak.getMdia().getMinf(); DataInfoBox dinf = trak.getMdia().getMinf().getDinf(); if (dinf == null) { dinf = new DataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); if (dref == null) { dref = new DataRefBox(); dinf.add(dref); } dref.getBoxes().clear(); dref.add(AliasBox.createSelfRef()); for (SampleEntry entry : NodeBox.findAll(trak, SampleEntry.class, "mdia", "minf", "stbl", "stsd", null)) { entry.setDrefInd((short) 1); } }
protected void addDref(NodeBox minf) { DataInfoBox dinf = new DataInfoBox(); minf.add(dinf); DataRefBox dref = new DataRefBox(); dinf.add(dref); dref.add(new LeafBox(new Header("alis", 0), ByteBuffer.wrap(new byte[] { 0, 0, 0, 1 }))); } }
public DataRefBox() { this(new Header(fourcc())); }
public void setDataRef(String url) { MediaInfoBox minf = getMdia().getMinf(); DataInfoBox dinf = minf.getDinf(); if (dinf == null) { dinf = new DataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); UrlBox urlBox = new UrlBox(url); if (dref == null) { dref = new DataRefBox(); dinf.add(dref); dref.add(urlBox); } else { ListIterator<Box> lit = dref.boxes.listIterator(); while (lit.hasNext()) { FullBox box = (FullBox) lit.next(); if ((box.getFlags() & 0x1) != 0) lit.set(urlBox); } } }
mappings.put("skip", NodeBox.class); mappings.put("meta", LeafBox.class); mappings.put(DataRefBox.fourcc(), DataRefBox.class); mappings.put("ipro", NodeBox.class); mappings.put("sinf", NodeBox.class);
public void setDataRef(String url) { MediaInfoBox minf = getMdia().getMinf(); DataInfoBox dinf = minf.getDinf(); if (dinf == null) { dinf = DataInfoBox.createDataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); UrlBox urlBox = UrlBox.createUrlBox(url); if (dref == null) { dref = DataRefBox.createDataRefBox(); dinf.add(dref); dref.add(urlBox); } else { ListIterator<Box> lit = dref.boxes.listIterator(); while (lit.hasNext()) { FullBox box = (FullBox) lit.next(); if ((box.getFlags() & 0x1) != 0) lit.set(urlBox); } } }
protected SeekableByteChannel[][] getInputs(MovieBox movie) throws IOException { TrakBox[] tracks = movie.getTracks(); SeekableByteChannel[][] result = new SeekableByteChannel[tracks.length][]; for (int i = 0; i < tracks.length; i++) { DataRefBox drefs = NodeBox.findFirstPath(tracks[i], DataRefBox.class, Box.path("mdia.minf.dinf.dref")); if (drefs == null) { throw new RuntimeException("No data references"); } List<Box> entries = drefs.getBoxes(); SeekableByteChannel[] e = new SeekableByteChannel[entries.size()]; SeekableByteChannel[] inputs = new SeekableByteChannel[entries.size()]; for (int j = 0; j < e.length; j++) { inputs[j] = resolveDataRef(entries.get(j)); } result[i] = inputs; } return result; }
public void setDataRef(String url) { MediaInfoBox minf = getMdia().getMinf(); DataInfoBox dinf = minf.getDinf(); if (dinf == null) { dinf = new DataInfoBox(); minf.add(dinf); } DataRefBox dref = dinf.getDref(); UrlBox urlBox = new UrlBox(url); if (dref == null) { dref = new DataRefBox(); dinf.add(dref); dref.add(urlBox); } else { ListIterator<Box> lit = dref.boxes.listIterator(); while (lit.hasNext()) { FullBox box = (FullBox) lit.next(); if ((box.getFlags() & 0x1) != 0) lit.set(urlBox); } } }
mappings.put("skip", NodeBox.class); mappings.put("meta", LeafBox.class); mappings.put(DataRefBox.fourcc(), DataRefBox.class); mappings.put("ipro", NodeBox.class); mappings.put("sinf", NodeBox.class);
mappings.put("skip", NodeBox.class); mappings.put(MetaBox.fourcc(), MetaBox.class); mappings.put(DataRefBox.fourcc(), DataRefBox.class); mappings.put("ipro", NodeBox.class); mappings.put("sinf", NodeBox.class);