private static <T extends Box> List<T> getPaths(AbstractContainerBox container, String path, boolean singleResult) { return getPaths((Object) container, path, singleResult); }
private static <T extends Box> List<T> getPaths(Box box, String path, boolean singleResult) { return getPaths((Object) box, path, singleResult); }
public static <T extends Box> List<T> getPaths(Container container, String path) { return getPaths(container, path, false); }
private static <T extends Box> List<T> getPaths(Container container, String path, boolean singleResult) { return getPaths((Object) container, path, singleResult); }
public static <T extends Box> List<T> getPaths(Box box, String path) { return getPaths(box, path, false); }
public static boolean isContained(Box box, String path) { assert path.startsWith("/") : "Absolute path required"; return getPaths(box, path).contains(box); } }
public static Box getPath(Box box, String path) { List<Box> all = getPaths(box, path); return all.isEmpty() ? null : all.get(0); }
public static boolean isContained(Box box, String path) { assert path.startsWith("/") : "Absolute path required"; return getPaths(box, path).contains(box); } }
public static Box getPath(Box box, String path) { List<Box> all = getPaths(box, path); return all.isEmpty() ? null : all.get(0); }
public static <T extends Box> T getPath(AbstractContainerBox containerBox, String path) { List<T> all = getPaths(containerBox, path, true); return all.isEmpty() ? null : all.get(0); }
public static boolean isContained(Box box, String path) { assert path.startsWith("/") : "Absolute path required"; return getPaths(box, path).contains(box); } }
public static <T extends Box> T getPath(Box box, String path) { List<T> all = getPaths(box, path, true); return all.isEmpty() ? null : all.get(0); }
public static <T extends Box> T getPath(Container container, String path) { List<T> all = getPaths(container, path, true); return all.isEmpty() ? null : all.get(0); }
if ("..".equals(type)) { if (thing instanceof Box) { return Path.getPaths(((Box) thing).getParent(), later, singleResult); } else { return Collections.emptyList(); if (box1.getType().matches(type)) { if (index == -1 || index == currentIndex) { children.addAll(Path.<T>getPaths(box1, later, singleResult));
return getPaths(isoFile, path.substring(1)); } else if (path.isEmpty()) { return Collections.singletonList(box); String type = m.group(1); if ("..".equals(type)) { return getPaths(box.getParent(), later); } else { int index = -1; if (box1.getType().matches(type)) { if (index == -1 || index == currentIndex) { children.addAll(getPaths(box1, later));
return getPaths(isoFile, path.substring(1)); } else if (path.isEmpty()) { return Collections.singletonList(box); String type = m.group(1); if ("..".equals(type)) { return getPaths(box.getParent(), later); } else { int index = -1; if (box1.getType().matches(type)) { if (index == -1 || index == currentIndex) { children.addAll(getPaths(box1, later));
public FragmentedMp4SampleList(long track, Container topLevel, IsoFile... fragments) { this.topLevel = topLevel; this.fragments = fragments; List<TrackBox> tbs = Path.getPaths(topLevel, "moov[0]/trak"); for (TrackBox tb : tbs) { if (tb.getTrackHeaderBox().getTrackId() == track) { trackBox = tb; } } if (trackBox == null) { throw new RuntimeException("This MP4 does not contain track " + track); } List<TrackExtendsBox> trexs = Path.getPaths(topLevel, "moov[0]/mvex[0]/trex"); for (TrackExtendsBox box : trexs) { if (box.getTrackId() == trackBox.getTrackHeaderBox().getTrackId()) { trex = box; } } sampleCache = (SoftReference<Sample>[]) Array.newInstance(SoftReference.class, size()); initAllFragments(); }
private void correctChunkOffsets(Container container, long correction) { List<Box> chunkOffsetBoxes = Path.getPaths(container, "/moov[0]/trak/mdia[0]/minf[0]/stbl[0]/stco[0]"); for (Box chunkOffsetBox : chunkOffsetBoxes) { LinkedList<Box> stblChildren = new LinkedList<>(chunkOffsetBox.getParent().getBoxes()); stblChildren.remove(chunkOffsetBox); long[] cOffsets = ((ChunkOffsetBox) chunkOffsetBox).getChunkOffsets(); for (int i = 0; i < cOffsets.length; i++) { cOffsets[i] += correction; } StaticChunkOffsetBox cob = new StaticChunkOffsetBox(); cob.setChunkOffsets(cOffsets); stblChildren.add(cob); chunkOffsetBox.getParent().setBoxes(stblChildren); } }
content.get(kid); } else { List<Box> tkhds = Path.getPaths(this, "/moov[0]/trak/tkhd"); for (Box tkhd : tkhds) { if (((TrackHeaderBox) tkhd).getTrackId() == this.getParent().getBoxes(TrackFragmentHeaderBox.class).get(0).getTrackId()) {
content.get(kid); } else { List<Box> tkhds = Path.getPaths(this, "/moov[0]/trak/tkhd"); for (Box tkhd : tkhds) { if (((TrackHeaderBox) tkhd).getTrackId() == this.getParent().getBoxes(TrackFragmentHeaderBox.class).get(0).getTrackId()) {