public static Box newBox(Header header, BoxFactory factory) { Class<? extends Box> claz = factory.toClass(header.getFourcc()); if (claz == null) return new LeafBox(header); try { try { return claz.getConstructor(Header.class).newInstance(header); } catch (NoSuchMethodException e) { return claz.newInstance(); } } catch (Exception e) { throw new RuntimeException(e); } }
public static LeafBox terminatorAtom() { return new LeafBox(new Header(new String(new byte[4])), ByteBuffer.allocate(0)); }
public static Box newBox(Header header, BoxFactory factory) { Class<? extends Box> claz = factory.toClass(header.getFourcc()); if (claz == null) return new LeafBox(header); try { try { return claz.getConstructor(Header.class).newInstance(header); } catch (NoSuchMethodException e) { return claz.newInstance(); } } catch (Exception e) { throw new RuntimeException(e); } }
public static LeafBox terminatorAtom() { return new LeafBox(new Header(new String(new byte[4])), ByteBuffer.allocate(0)); }
public static Box parseBox(ByteBuffer input, Header childAtom, BoxFactory factory) { Box box = newBox(childAtom, factory); if (childAtom.getBodySize() < MAX_BOX_SIZE) { box.parse(input); return box; } else { return new LeafBox(new Header("free", 8)); } }
public static Box parseBox(ByteBuffer input, Header childAtom, BoxFactory factory) { Box box = newBox(childAtom, factory); if (childAtom.getBodySize() < MAX_BOX_SIZE) { box.parse(input); return box; } else { return new LeafBox(new Header("free", 8)); } }
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 }))); } }
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 }))); } }