Example #1
0
  @Override
  public void parse(InputStream input) throws IOException {
    StringReader.sureSkip(input, 5);
    int nSPS = input.read() & 0x1f; // 3 bits reserved + 5 bits number of
    // sps
    for (int i = 0; i < nSPS; i++) {
      int spsSize = (int) ReaderBE.readInt16(input);
      byte[] sps = new byte[spsSize];
      input.read(sps);
      spsList.add(SeqParameterSet.read(new ByteArrayInputStream(sps, 1, spsSize - 1)));
    }

    int nPPS = input.read() & 0xff;
    for (int i = 0; i < nPPS; i++) {
      int ppsSize = (int) ReaderBE.readInt16(input);
      byte[] pps = new byte[ppsSize];
      input.read(pps);
      ppsList.add(PictureParameterSet.read(new ByteArrayInputStream(pps, 1, ppsSize - 1)));
    }
  }
Example #2
0
 public void skip(InputStream di) throws IOException {
   StringReader.sureSkip(di, size - headerSize());
 }