@Properties(inherit=avutil.class) public class ff_pad_helper_AVBPrint extends Pointer
char buf[512]
.
The length of the string can go beyond the allocated size: the buffer is
then truncated, but the functions still keep account of the actual total
length.
In other words, AVBPrint.len can be greater than AVBPrint.size and records
the total length of what would have been to the buffer if there had been
enough memory.
Append operations do not need to be tested for failure: if a memory
allocation fails, data stop being appended to the buffer, but the length
is still updated. This situation can be tested with
av_bprint_is_complete().
The AVBPrint.size_max field determines several possible behaviours:
- size_max = -1
(= UINT_MAX
) or any large value will let the buffer be
reallocated as necessary, with an amortized linear cost.
- size_max = 0
prevents writing anything to the buffer: only the total
length is computed. The write operations can then possibly be repeated in
a buffer with exactly the necessary size
(using size_init = size_max = len + 1
).
- size_max = 1
is automatically replaced by the exact size available in the
structure itself, thus ensuring no dynamic memory allocation. The
internal buffer is large enough to hold a reasonable paragraph of text,
such as the current paragraph.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
ff_pad_helper_AVBPrint()
Default native constructor.
|
ff_pad_helper_AVBPrint(long size)
Native array allocator.
|
ff_pad_helper_AVBPrint(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
ff_pad_helper_AVBPrint |
getPointer(long i) |
int |
len()
length so far
|
ff_pad_helper_AVBPrint |
len(int setter) |
ff_pad_helper_AVBPrint |
position(long position) |
BytePointer |
reserved_internal_buffer() |
byte |
reserved_internal_buffer(int i) |
ff_pad_helper_AVBPrint |
reserved_internal_buffer(int i,
byte setter) |
int |
size_max()
maximum allocated memory
|
ff_pad_helper_AVBPrint |
size_max(int setter) |
int |
size()
allocated memory
|
ff_pad_helper_AVBPrint |
size(int setter) |
BytePointer |
str()
string so far
|
ff_pad_helper_AVBPrint |
str(BytePointer setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public ff_pad_helper_AVBPrint()
public ff_pad_helper_AVBPrint(long size)
Pointer.position(long)
.public ff_pad_helper_AVBPrint(Pointer p)
Pointer(Pointer)
.public ff_pad_helper_AVBPrint position(long position)
public ff_pad_helper_AVBPrint getPointer(long i)
getPointer
in class Pointer
@Cast(value="char*") public BytePointer str()
public ff_pad_helper_AVBPrint str(BytePointer setter)
public ff_pad_helper_AVBPrint len(int setter)
public ff_pad_helper_AVBPrint size(int setter)
public ff_pad_helper_AVBPrint size_max(int setter)
public ff_pad_helper_AVBPrint reserved_internal_buffer(int i, byte setter)
@MemberGetter @Cast(value="char*") public BytePointer reserved_internal_buffer()
Copyright © 2024. All rights reserved.