public Avc1ToAvc3TrackImpl(Track parent) throws IOException { super(parent); for (SampleEntry sampleEntry : parent.getSampleEntries()) { if (sampleEntry.getType().equals("avc1")) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { // This creates a copy cause I can't change the original instance sampleEntry.getBox(Channels.newChannel(baos)); VisualSampleEntry avc3SampleEntry = (VisualSampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); avc3SampleEntry.setType("avc3"); avc1toavc3.put(sampleEntry, avc3SampleEntry); } catch (IOException e) { throw new RuntimeException("Dumping sample entry to memory failed"); } } else { avc1toavc3.put(sampleEntry, sampleEntry); } } samples = new ReplaceSyncSamplesList(parent.getSamples()); }
decSe = (SampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); } catch (IOException e) { throw new RuntimeException("Dumping stsd to memory failed");
Movie mEncryptIn = MovieCreator.build(new ByteBufferByteChannel(baos.toByteArray()), new InMemRandomAccessSourceImpl(baos.toByteArray()), "inmem"); Movie mDecrypt = new Movie();
sps.add(nal.slice()); nal.position(1); new SequenceParameterSetRbsp(Channels.newInputStream(new ByteBufferByteChannel(nal.slice()))); System.err.println("Stored SPS"); break;
try { se.getBox(Channels.newChannel(baos)); encSampleEntry= (SampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); } catch (IOException e) { throw new RuntimeException("Dumping stsd to memory failed");
public VideoParameterSet(ByteBuffer vps) throws IOException { this.vps = vps; CAVLCReader r = new CAVLCReader(Channels.newInputStream(new ByteBufferByteChannel((ByteBuffer) vps.position(0)))); vps_parameter_set_id = r.readU(4, "vps_parameter_set_id"); int vps_reserved_three_2bits = r.readU(2, "vps_reserved_three_2bits");
public Avc1ToAvc3TrackImpl(Track parent) throws IOException { super(parent); for (SampleEntry sampleEntry : parent.getSampleEntries()) { if (sampleEntry.getType().equals("avc1")) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { // This creates a copy cause I can't change the original instance sampleEntry.getBox(Channels.newChannel(baos)); VisualSampleEntry avc3SampleEntry = (VisualSampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); avc3SampleEntry.setType("avc3"); avc1toavc3.put(sampleEntry, avc3SampleEntry); } catch (IOException e) { throw new RuntimeException("Dumping sample entry to memory failed"); } } else { avc1toavc3.put(sampleEntry, sampleEntry); } } samples = new ReplaceSyncSamplesList(parent.getSamples()); }
decSe = (SampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); } catch (IOException e) { throw new RuntimeException("Dumping stsd to memory failed");
sps.add(nal.slice()); nal.position(1); new SequenceParameterSetRbsp(Channels.newInputStream(new ByteBufferByteChannel(nal.slice()))); System.err.println("Stored SPS"); break;
try { se.getBox(Channels.newChannel(baos)); encSampleEntry= (SampleEntry) new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray()))).getBoxes().get(0); } catch (IOException e) { throw new RuntimeException("Dumping stsd to memory failed");
public VideoParameterSet(ByteBuffer vps) throws IOException { this.vps = vps; CAVLCReader r = new CAVLCReader(Channels.newInputStream(new ByteBufferByteChannel((ByteBuffer) vps.position(0)))); vps_parameter_set_id = r.readU(4, "vps_parameter_set_id"); int vps_reserved_three_2bits = r.readU(2, "vps_reserved_three_2bits");