GstBase.ByteWriter¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
alloc_size |
r/w |
Allocation size of the data |
|
fixed |
r/w |
If |
|
owned |
r/w |
If |
|
parent |
r/w |
|
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstBase.ByteWriter¶
GstBase.ByteWriter
provides a byte writer and reader that can write/read different integer and floating point types to/from a memory buffer. It provides functions for writing/reading signed/unsigned, little/big endian integers of 8, 16, 24, 32 and 64 bits and functions for reading little/big endian floating points numbers of 32 and 64 bits. It also provides functions to write/read NUL-terminated strings in various character encodings.- ensure_free_space(size)[source]¶
- Parameters:
size (
int
) – Number of bytes that should be available- Returns:
True
if at least size bytes are still available- Return type:
Checks if enough free space from the current write cursor is available and reallocates if necessary.
- fill(value, size)[source]¶
- Parameters:
- Returns:
True
if the value could be written- Return type:
Writes size bytes containing value to self.
- free_and_get_buffer()[source]¶
- Returns:
the current data as buffer. gst_buffer_unref() after usage.
- Return type:
Frees self and all memory allocated by it except the current data, which is returned as
Gst.Buffer
.Free-function: gst_buffer_unref
- free_and_get_data()[source]¶
-
Frees self and all memory allocated by it except the current data, which is returned.
Free-function:
GLib.free
- get_remaining()[source]¶
- Returns:
the remaining size of data that can still be written
- Return type:
Returns the remaining size of data that can still be written. If -1 is returned the remaining size is only limited by system resources.
- init_with_data(data, initialized)[source]¶
- Parameters:
Initializes self with the given memory area. If initialized is
True
it is possible to read size bytes from theGstBase.ByteWriter
from the beginning.
- put_buffer(buffer, offset, size)¶
- Parameters:
buffer (
Gst.Buffer
) – sourceGst.Buffer
offset (
int
) – offset to copy fromsize (
int
) – total size to copy. If -1, all data is copied
- Returns:
True
if the data could be written- Return type:
Writes size bytes of data to self.
- put_data(data)[source]¶
-
Writes size bytes of data to self.
- put_float32_be(val)[source]¶
-
Writes a big endian 32 bit float to self.
- put_float32_le(val)[source]¶
-
Writes a little endian 32 bit float to self.
- put_float64_be(val)[source]¶
-
Writes a big endian 64 bit float to self.
- put_float64_le(val)[source]¶
-
Writes a little endian 64 bit float to self.
- put_int16_be(val)[source]¶
-
Writes a signed big endian 16 bit integer to self.
- put_int16_le(val)[source]¶
-
Writes a signed little endian 16 bit integer to self.
- put_int24_be(val)[source]¶
-
Writes a signed big endian 24 bit integer to self.
- put_int24_le(val)[source]¶
-
Writes a signed little endian 24 bit integer to self.
- put_int32_be(val)[source]¶
-
Writes a signed big endian 32 bit integer to self.
- put_int32_le(val)[source]¶
-
Writes a signed little endian 32 bit integer to self.
- put_int64_be(val)[source]¶
-
Writes a signed big endian 64 bit integer to self.
- put_int64_le(val)[source]¶
-
Writes a signed little endian 64 bit integer to self.
- put_int8(val)[source]¶
-
Writes a signed 8 bit integer to self.
- put_string_utf16(data)[source]¶
- Parameters:
data ([
int
]) – UTF16 string to write- Returns:
True
if the value could be written- Return type:
Writes a NUL-terminated UTF16 string to self (including the terminator).
- put_string_utf32(data)[source]¶
- Parameters:
data ([
int
]) – UTF32 string to write- Returns:
True
if the value could be written- Return type:
Writes a NUL-terminated UTF32 string to self (including the terminator).
- put_string_utf8(data)[source]¶
- Parameters:
data (
str
) – UTF8 string to write- Returns:
True
if the value could be written- Return type:
Writes a NUL-terminated UTF8 string to self (including the terminator).
- put_uint16_be(val)[source]¶
-
Writes a unsigned big endian 16 bit integer to self.
- put_uint16_le(val)[source]¶
-
Writes a unsigned little endian 16 bit integer to self.
- put_uint24_be(val)[source]¶
-
Writes a unsigned big endian 24 bit integer to self.
- put_uint24_le(val)[source]¶
-
Writes a unsigned little endian 24 bit integer to self.
- put_uint32_be(val)[source]¶
-
Writes a unsigned big endian 32 bit integer to self.
- put_uint32_le(val)[source]¶
-
Writes a unsigned little endian 32 bit integer to self.
- put_uint64_be(val)[source]¶
-
Writes a unsigned big endian 64 bit integer to self.
- put_uint64_le(val)[source]¶
-
Writes a unsigned little endian 64 bit integer to self.
- put_uint8(val)[source]¶
-
Writes a unsigned 8 bit integer to self.