public void push(int id) { this.add(id); }
public void push(int id) { this.add(id); }
public void push(int id) { this.add(id); }
@Override public void parse(ByteBuffer buf) { super.parse(buf); while (buf.remaining() >= 4) { languageCodes.add(buf.getInt()); } }
public void add(long value) { if (lastValue == Long.MIN_VALUE || lastValue != value) { if (lastValue != Long.MIN_VALUE) { values.add(lastValue); counts.add(count); count = 0; } lastValue = value; } ++count; }
protected void finish() { if (lastValue != Long.MIN_VALUE) { values.add(lastValue); counts.add(count); lastValue = Long.MIN_VALUE; count = 0; } }
@Override public void parse(ByteBuffer buf) { super.parse(buf); formatIdentifier = buf.getInt(); while(buf.hasRemaining()) { additionalFormatIdentifiers.add(buf.get() & 0xff); } }
public static RunLength.Long parse(ByteBuffer bb) { RunLength.Long rl = new RunLength.Long(); int recCount = bb.getInt(); for (int i = 0; i < recCount; i++) { int count = (bb.get() & 0xff) + 1; long value = bb.getLong(); rl.counts.add(count); rl.values.add(value); } return rl; }
private int[] parseSystem(ByteBuffer pesBuffer) { NIOUtils.skip(pesBuffer, 12); IntArrayList result = IntArrayList.createIntArrayList(); while (pesBuffer.remaining() >= 3 && (pesBuffer.get(pesBuffer.position()) & 0x80) == 0x80) { result.add(pesBuffer.get() & 0xff); pesBuffer.getShort(); } return result.toArray(); }
/** * @param arguments * vlc codes * @return */ public static VLC createVLC(String... arguments) { IntArrayList _codes = IntArrayList.createIntArrayList(); IntArrayList _codeSizes = IntArrayList.createIntArrayList(); for (int i = 0; i < arguments.length; i++) { String string = arguments[i]; _codes.add(Integer.parseInt(string, 2) << (32 - string.length())); _codeSizes.add(string.length()); } VLC vlc = new VLC(_codes.toArray(), _codeSizes.toArray()); return vlc; }
private static int[][] readReorderingEntries(BitReader _in) { IntArrayList ops = IntArrayList.createIntArrayList(); IntArrayList args = IntArrayList.createIntArrayList(); do { int idc = readUEtrace(_in, "SH: reordering_of_pic_nums_idc"); if (idc == 3) break; ops.add(idc); args.add(readUEtrace(_in, "SH: abs_diff_pic_num_minus1")); } while (true); return new int[][] { ops.toArray(), args.toArray() }; } }
public static PATSection parsePAT(ByteBuffer data) { PSISection psi = PSISection.parsePSI(data); IntArrayList networkPids = IntArrayList.createIntArrayList(); IntIntMap programs = new IntIntMap(); while (data.remaining() > 4) { int programNum = data.getShort() & 0xffff; int w = data.getShort(); int pid = w & 0x1fff; if (programNum == 0) networkPids.add(pid); else programs.put(programNum, pid); } return new PATSection(psi, networkPids.toArray(), programs); } }
private static int[] filterMediaPids(PMTStream[] programs) { IntArrayList result = IntArrayList.createIntArrayList(); for (PMTStream stream : programs) { if (stream.getStreamType().isVideo() || stream.getStreamType().isAudio()) result.add(stream.getPid()); } return result.toArray(); } }