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