예제 #1
0
    public void clone(AVPacket packet) {
      // growing must be done here (to get the new buffer size)
      int growBy = packet.size() - getSize();
      if (growBy > 0) grow(growBy);

      int res =
          avcodecLibrary.av_packet_copy_props(
              Pointer.getPointer(internal), Pointer.getPointer(packet));
      if (res != 0) throw new LibavRuntimeException(res);

      Pointer<Byte> pData = packet.data();
      if (pData != null) pData.copyTo(getData(), packet.size());
      setSize(packet.size());
    }
예제 #2
0
 public PooledPacket(AVPacket internal) {
   this.internal = internal;
   this.bufferSize = internal.size();
 }
예제 #3
0
 public PooledPacket alloc() {
   avcodecLibrary.av_init_packet(Pointer.getPointer(internal));
   bufferSize = internal.size();
   return this;
 }
예제 #4
0
 public void setSize(int size) {
   internal.size(size);
 }
예제 #5
0
 public int getSize() {
   return internal.size();
 }
예제 #6
0
 public void grow(int growBy) {
   int result = avcodecLibrary.av_grow_packet(Pointer.getPointer(internal), growBy);
   if (result != 0) throw new LibavRuntimeException(result);
   bufferSize = internal.size();
 }