public long getSize() { int spsPpsSize = 0; for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { spsPpsSize += len + bytes.limit(); } return orignalSample.getSize() + spsPpsSize; }
public void writeTo(WritableByteChannel channel) throws IOException { for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write(bytes); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write((bytes)); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write((bytes)); } orignalSample.writeTo(channel); }
public ByteBuffer asByteBuffer() { int spsPpsSize = 0; for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { spsPpsSize += len + bytes.limit(); } ByteBuffer data = ByteBuffer.allocate(l2i(orignalSample.getSize()) + spsPpsSize); for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } data.put(orignalSample.asByteBuffer()); return (ByteBuffer) data.rewind(); } };
).getPictureParameterSets().get(0)));
public long getSize() { int spsPpsSize = 0; for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { spsPpsSize += len + bytes.limit(); } return orignalSample.getSize() + spsPpsSize; }
public void writeTo(WritableByteChannel channel) throws IOException { for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write(bytes); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write((bytes)); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), (ByteBuffer) buf.rewind(), len); channel.write((ByteBuffer) buf.rewind()); channel.write((bytes)); } orignalSample.writeTo(channel); }
public ByteBuffer asByteBuffer() { int spsPpsSize = 0; for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { spsPpsSize += len + bytes.limit(); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { spsPpsSize += len + bytes.limit(); } ByteBuffer data = ByteBuffer.allocate(l2i(orignalSample.getSize()) + spsPpsSize); for (ByteBuffer bytes : avcC.getSequenceParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } for (ByteBuffer bytes : avcC.getPictureParameterSets()) { IsoTypeWriterVariable.write(bytes.limit(), data, len); data.put(bytes); } data.put(orignalSample.asByteBuffer()); return (ByteBuffer) data.rewind(); } };