示例#1
0
 public synchronized void dispose() {
   if (internal == null) return;
   Pointer<AVPacket> pointer = Pointer.getPointer(internal);
   avcodecLibrary.av_free_packet(pointer);
   internal = null;
   // pointer.release();
 }
示例#2
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());
    }
示例#3
0
 public PooledPacket alloc() {
   avcodecLibrary.av_init_packet(Pointer.getPointer(internal));
   bufferSize = internal.size();
   return this;
 }
示例#4
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();
 }