Esempio n. 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());
    }
Esempio n. 2
0
 public PooledPacket(AVPacket internal) {
   this.internal = internal;
   this.bufferSize = internal.size();
 }
Esempio n. 3
0
 public PooledPacket alloc() {
   avcodecLibrary.av_init_packet(Pointer.getPointer(internal));
   bufferSize = internal.size();
   return this;
 }
Esempio n. 4
0
 public void setSize(int size) {
   internal.size(size);
 }
Esempio n. 5
0
 public int getSize() {
   return internal.size();
 }
Esempio n. 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();
 }