public String getUnixPath() { ExtraField extraField = getExtra(AliasBox.UNIXAbsolutePath); return extraField == null ? null : "/" + extraField.toString(); } }
public DataBoxes() { mappings.put(UrlBox.fourcc(), UrlBox.class); mappings.put(AliasBox.fourcc(), AliasBox.class); mappings.put("cios", AliasBox.class); } }
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); } }
public SeekableByteChannel resolveDataRef(Box box) throws IOException { if (box instanceof UrlBox) { String url = ((UrlBox) box).getUrl(); if (!url.startsWith("file://")) throw new RuntimeException("Only file:// urls are supported in data reference"); return readableChannel(new File(url.substring(7))); } else if (box instanceof AliasBox) { String uxPath = ((AliasBox) box).getUnixPath(); if (uxPath == null) throw new RuntimeException("Could not resolve alias"); return readableChannel(new File(uxPath)); } else { throw new RuntimeException(box.getHeader().getFourcc() + " dataref type is not supported"); } }
public AliasBox() { super(new Header(fourcc(), 0)); }
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); } }
public AliasBox() { super(new Header(fourcc(), 0)); }
public String getUnixPath() { ExtraField extraField = getExtra(AliasBox.UNIXAbsolutePath); return extraField == null ? null : "/" + extraField.toString(); } }
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 MyFactory() { mappings.put(UrlBox.fourcc(), UrlBox.class); mappings.put(AliasBox.fourcc(), AliasBox.class); mappings.put("cios", AliasBox.class); }
public String getUnixPath() { ExtraField extraField = getExtra(AliasBox.UNIXAbsolutePath); return extraField == null ? null : "/" + extraField.toString(); } }
public MyFactory() { mappings.put(UrlBox.fourcc(), UrlBox.class); mappings.put(AliasBox.fourcc(), AliasBox.class); mappings.put("cios", AliasBox.class); }