GstBitWriter
GstBitWriter provides a bit writer that can write any number of bits into a memory buffer. It provides functions for writing any number of bits into 8, 16, 32 and 64 bit variables.
GstBitWriter
A bit writer instance.
Members
data
(guint8 *)
–
Allocated data for bit writer to write
bit_size
(guint)
–
Size of written data in bits
Since : 1.16
Methods
gst_bit_writer_align_bytes
gboolean gst_bit_writer_align_bytes (GstBitWriter * bitwriter, guint8 trailing_bit)
Write trailing bit to align last byte of data. trailing_bit can only be 1 or 0.
GstBase.BitWriter.prototype.align_bytes
function GstBase.BitWriter.prototype.align_bytes(trailing_bit: Number): {
// javascript wrapper for 'gst_bit_writer_align_bytes'
}
Write trailing bit to align last byte of data. trailing_bit can only be 1 or 0.
GstBase.BitWriter.align_bytes
def GstBase.BitWriter.align_bytes (self, trailing_bit):
#python wrapper for 'gst_bit_writer_align_bytes'
Write trailing bit to align last byte of data. trailing_bit can only be 1 or 0.
gst_bit_writer_free
gst_bit_writer_free (GstBitWriter * bitwriter)
Frees bitwriter and the allocated data inside.
Parameters:
bitwriter
(
[in][transfer: full])
–
GstBitWriter instance
GstBase.BitWriter.prototype.free
function GstBase.BitWriter.prototype.free(): {
// javascript wrapper for 'gst_bit_writer_free'
}
Frees bitwriter and the allocated data inside.
Parameters:
GstBase.BitWriter instance
GstBase.BitWriter.free
def GstBase.BitWriter.free (self):
#python wrapper for 'gst_bit_writer_free'
Frees bitwriter and the allocated data inside.
Parameters:
GstBase.BitWriter instance
gst_bit_writer_free_and_get_buffer
GstBuffer * gst_bit_writer_free_and_get_buffer (GstBitWriter * bitwriter)
Frees bitwriter without destroying the internal data, which is returned as GstBuffer.
Free-function: gst_buffer_unref
Parameters:
bitwriter
(
[in][transfer: full])
–
GstBitWriter instance
a new allocated GstBuffer wrapping the data inside. gst_buffer_unref after usage.
GstBase.BitWriter.prototype.free_and_get_buffer
function GstBase.BitWriter.prototype.free_and_get_buffer(): {
// javascript wrapper for 'gst_bit_writer_free_and_get_buffer'
}
Frees bitwriter without destroying the internal data, which is returned as Gst.Buffer.
Free-function: gst_buffer_unref
Parameters:
GstBase.BitWriter instance
a new allocated Gst.Buffer wrapping the data inside. gst_buffer_unref (not introspectable) after usage.
GstBase.BitWriter.free_and_get_buffer
def GstBase.BitWriter.free_and_get_buffer (self):
#python wrapper for 'gst_bit_writer_free_and_get_buffer'
Frees bitwriter without destroying the internal data, which is returned as Gst.Buffer.
Free-function: gst_buffer_unref
Parameters:
GstBase.BitWriter instance
a new allocated Gst.Buffer wrapping the data inside. gst_buffer_unref (not introspectable) after usage.
gst_bit_writer_free_and_get_data
guint8 * gst_bit_writer_free_and_get_data (GstBitWriter * bitwriter)
Frees bitwriter without destroying the internal data, which is returned.
Free-function: g_free
Parameters:
bitwriter
(
[in][transfer: full])
–
GstBitWriter instance
the current data. g_free after usage.
GstBase.BitWriter.prototype.free_and_get_data
function GstBase.BitWriter.prototype.free_and_get_data(): {
// javascript wrapper for 'gst_bit_writer_free_and_get_data'
}
Frees bitwriter without destroying the internal data, which is returned.
Free-function: g_free
Parameters:
GstBase.BitWriter instance
the current data. GLib.prototype.free after usage.
GstBase.BitWriter.free_and_get_data
def GstBase.BitWriter.free_and_get_data (self):
#python wrapper for 'gst_bit_writer_free_and_get_data'
Frees bitwriter without destroying the internal data, which is returned.
Free-function: g_free
Parameters:
GstBase.BitWriter instance
gst_bit_writer_get_data
guint8 * gst_bit_writer_get_data (const GstBitWriter * bitwriter)
Get written data pointer
Parameters:
bitwriter
–
a GstBitWriter instance
data pointer
GstBase.BitWriter.prototype.get_data
function GstBase.BitWriter.prototype.get_data(): {
// javascript wrapper for 'gst_bit_writer_get_data'
}
Get written data pointer
Parameters:
a GstBase.BitWriter instance
data pointer
GstBase.BitWriter.get_data
def GstBase.BitWriter.get_data (self):
#python wrapper for 'gst_bit_writer_get_data'
Get written data pointer
Parameters:
a GstBase.BitWriter instance
data pointer
gst_bit_writer_get_remaining
guint gst_bit_writer_get_remaining (const GstBitWriter * bitwriter)
Parameters:
bitwriter
–
GstBase.BitWriter.prototype.get_remaining
function GstBase.BitWriter.prototype.get_remaining(): {
// javascript wrapper for 'gst_bit_writer_get_remaining'
}
Parameters:
GstBase.BitWriter.get_remaining
def GstBase.BitWriter.get_remaining (self):
#python wrapper for 'gst_bit_writer_get_remaining'
Parameters:
gst_bit_writer_get_size
guint gst_bit_writer_get_size (const GstBitWriter * bitwriter)
Get size of written data
Parameters:
bitwriter
–
a GstBitWriter instance
size of bits written in data
GstBase.BitWriter.prototype.get_size
function GstBase.BitWriter.prototype.get_size(): {
// javascript wrapper for 'gst_bit_writer_get_size'
}
Get size of written data
Parameters:
a GstBase.BitWriter instance
size of bits written in data
GstBase.BitWriter.get_size
def GstBase.BitWriter.get_size (self):
#python wrapper for 'gst_bit_writer_get_size'
Get size of written data
Parameters:
a GstBase.BitWriter instance
size of bits written in data
gst_bit_writer_init
gst_bit_writer_init (GstBitWriter * bitwriter)
Initializes bitwriter to an empty instance.
Parameters:
bitwriter
–
GstBitWriter instance
gst_bit_writer_init_with_data
gst_bit_writer_init_with_data (GstBitWriter * bitwriter, guint8 * data, guint size, gboolean initialized)
Initializes bitwriter with the given memory area data. IF initialized is TRUE it is possible to read size bits from the GstBitWriter from the beginning.
Parameters:
bitwriter
–
GstBitWriter instance
data
(
[arraylength=size][transfer: none])
–
Memory area for writing
size
–
Size of data in bytes
initialized
–
If TRUE the complete data can be read from the beginning
gst_bit_writer_init_with_size
gst_bit_writer_init_with_size (GstBitWriter * bitwriter, guint32 size, gboolean fixed)
Initializes a GstBitWriter instance and allocates the given data size.
Parameters:
bitwriter
–
GstBitWriter instance
size
–
the size on bytes to allocate for data
fixed
–
If TRUE the data can't be reallocated
gst_bit_writer_put_bits_uint16
gboolean gst_bit_writer_put_bits_uint16 (GstBitWriter * bitwriter, guint16 value, guint nbits)
Write nbits bits of value to GstBitWriter.
Parameters:
bitwriter
–
a GstBitWriter instance
value
–
value of guint16 to write
nbits
–
number of bits to write
GstBase.BitWriter.prototype.put_bits_uint16
function GstBase.BitWriter.prototype.put_bits_uint16(value: Number, nbits: Number): {
// javascript wrapper for 'gst_bit_writer_put_bits_uint16'
}
Write nbits bits of value to GstBase.BitWriter.
GstBase.BitWriter.put_bits_uint16
def GstBase.BitWriter.put_bits_uint16 (self, value, nbits):
#python wrapper for 'gst_bit_writer_put_bits_uint16'
Write nbits bits of value to GstBase.BitWriter.
gst_bit_writer_put_bits_uint32
gboolean gst_bit_writer_put_bits_uint32 (GstBitWriter * bitwriter, guint32 value, guint nbits)
Write nbits bits of value to GstBitWriter.
Parameters:
bitwriter
–
a GstBitWriter instance
value
–
value of guint32 to write
nbits
–
number of bits to write
GstBase.BitWriter.prototype.put_bits_uint32
function GstBase.BitWriter.prototype.put_bits_uint32(value: Number, nbits: Number): {
// javascript wrapper for 'gst_bit_writer_put_bits_uint32'
}
Write nbits bits of value to GstBase.BitWriter.
GstBase.BitWriter.put_bits_uint32
def GstBase.BitWriter.put_bits_uint32 (self, value, nbits):
#python wrapper for 'gst_bit_writer_put_bits_uint32'
Write nbits bits of value to GstBase.BitWriter.
gst_bit_writer_put_bits_uint64
gboolean gst_bit_writer_put_bits_uint64 (GstBitWriter * bitwriter, guint64 value, guint nbits)
Write nbits bits of value to GstBitWriter.
Parameters:
bitwriter
–
a GstBitWriter instance
value
–
value of guint64 to write
nbits
–
number of bits to write
GstBase.BitWriter.prototype.put_bits_uint64
function GstBase.BitWriter.prototype.put_bits_uint64(value: Number, nbits: Number): {
// javascript wrapper for 'gst_bit_writer_put_bits_uint64'
}
Write nbits bits of value to GstBase.BitWriter.
GstBase.BitWriter.put_bits_uint64
def GstBase.BitWriter.put_bits_uint64 (self, value, nbits):
#python wrapper for 'gst_bit_writer_put_bits_uint64'
Write nbits bits of value to GstBase.BitWriter.
gst_bit_writer_put_bits_uint8
gboolean gst_bit_writer_put_bits_uint8 (GstBitWriter * bitwriter, guint8 value, guint nbits)
Write nbits bits of value to GstBitWriter.
Parameters:
bitwriter
–
a GstBitWriter instance
value
–
value of guint8 to write
nbits
–
number of bits to write
GstBase.BitWriter.prototype.put_bits_uint8
function GstBase.BitWriter.prototype.put_bits_uint8(value: Number, nbits: Number): {
// javascript wrapper for 'gst_bit_writer_put_bits_uint8'
}
Write nbits bits of value to GstBase.BitWriter.
GstBase.BitWriter.put_bits_uint8
def GstBase.BitWriter.put_bits_uint8 (self, value, nbits):
#python wrapper for 'gst_bit_writer_put_bits_uint8'
Write nbits bits of value to GstBase.BitWriter.
gst_bit_writer_put_bytes
gboolean gst_bit_writer_put_bytes (GstBitWriter * bitwriter, const guint8 * data, guint nbytes)
Write nbytes bytes of data to GstBitWriter.
Parameters:
bitwriter
–
a GstBitWriter instance
data
(
[array])
–
pointer of data to write
nbytes
–
number of bytes to write
GstBase.BitWriter.prototype.put_bytes
function GstBase.BitWriter.prototype.put_bytes(data: [ Number ], nbytes: Number): {
// javascript wrapper for 'gst_bit_writer_put_bytes'
}
Write nbytes bytes of data to GstBase.BitWriter.
GstBase.BitWriter.put_bytes
def GstBase.BitWriter.put_bytes (self, data, nbytes):
#python wrapper for 'gst_bit_writer_put_bytes'
Write nbytes bytes of data to GstBase.BitWriter.
gst_bit_writer_reset
gst_bit_writer_reset (GstBitWriter * bitwriter)
Resets bitwriter and frees the data if it's owned by bitwriter.
Parameters:
bitwriter
–
GstBitWriter instance
GstBase.BitWriter.prototype.reset
function GstBase.BitWriter.prototype.reset(): {
// javascript wrapper for 'gst_bit_writer_reset'
}
Resets bitwriter and frees the data if it's owned by bitwriter.
Parameters:
GstBase.BitWriter instance
GstBase.BitWriter.reset
def GstBase.BitWriter.reset (self):
#python wrapper for 'gst_bit_writer_reset'
Resets bitwriter and frees the data if it's owned by bitwriter.
Parameters:
GstBase.BitWriter instance
gst_bit_writer_reset_and_get_buffer
GstBuffer * gst_bit_writer_reset_and_get_buffer (GstBitWriter * bitwriter)
Resets bitwriter and returns the current data as GstBuffer.
Free-function: gst_buffer_unref
Parameters:
bitwriter
–
a GstBitWriter instance
a new allocated GstBuffer wrapping the current data. gst_buffer_unref after usage.
GstBase.BitWriter.prototype.reset_and_get_buffer
function GstBase.BitWriter.prototype.reset_and_get_buffer(): {
// javascript wrapper for 'gst_bit_writer_reset_and_get_buffer'
}
Resets bitwriter and returns the current data as Gst.Buffer.
Free-function: gst_buffer_unref
Parameters:
a GstBase.BitWriter instance
a new allocated Gst.Buffer wrapping the current data. gst_buffer_unref (not introspectable) after usage.
GstBase.BitWriter.reset_and_get_buffer
def GstBase.BitWriter.reset_and_get_buffer (self):
#python wrapper for 'gst_bit_writer_reset_and_get_buffer'
Resets bitwriter and returns the current data as Gst.Buffer.
Free-function: gst_buffer_unref
Parameters:
a GstBase.BitWriter instance
a new allocated Gst.Buffer wrapping the current data. gst_buffer_unref (not introspectable) after usage.
gst_bit_writer_reset_and_get_data
guint8 * gst_bit_writer_reset_and_get_data (GstBitWriter * bitwriter)
Resets bitwriter and returns the current data.
Free-function: g_free
Parameters:
bitwriter
–
a GstBitWriter instance
the current data. g_free after usage.
GstBase.BitWriter.prototype.reset_and_get_data
function GstBase.BitWriter.prototype.reset_and_get_data(): {
// javascript wrapper for 'gst_bit_writer_reset_and_get_data'
}
Resets bitwriter and returns the current data.
Free-function: g_free
Parameters:
a GstBase.BitWriter instance
the current data. GLib.prototype.free after usage.
GstBase.BitWriter.reset_and_get_data
def GstBase.BitWriter.reset_and_get_data (self):
#python wrapper for 'gst_bit_writer_reset_and_get_data'
Resets bitwriter and returns the current data.
Free-function: g_free
Parameters:
a GstBase.BitWriter instance
gst_bit_writer_set_pos
gboolean gst_bit_writer_set_pos (GstBitWriter * bitwriter, guint pos)
Parameters:
bitwriter
–
pos
–
GstBase.BitWriter.prototype.set_pos
function GstBase.BitWriter.prototype.set_pos(pos: Number): {
// javascript wrapper for 'gst_bit_writer_set_pos'
}
Parameters:
GstBase.BitWriter.set_pos
def GstBase.BitWriter.set_pos (self, pos):
#python wrapper for 'gst_bit_writer_set_pos'
Parameters:
Functions
gst_bit_writer_new
GstBitWriter * gst_bit_writer_new ()
Creates a new, empty GstBitWriter instance.
Free-function: gst_bit_writer_free
a new, empty GstByteWriter instance
gst_bit_writer_new_with_data
GstBitWriter * gst_bit_writer_new_with_data (guint8 * data, guint size, gboolean initialized)
Creates a new GstBitWriter instance with the given memory area. If initialized is TRUE it is possible to read size bits from the GstBitWriter from the beginning.
Free-function: gst_bit_writer_free
Parameters:
data
(
[arraylength=size][transfer: none])
–
Memory area for writing
size
–
Size of data in bytes
initialized
–
if TRUE the complete data can be read from the beginning
a new GstBitWriter instance
gst_bit_writer_new_with_size
GstBitWriter * gst_bit_writer_new_with_size (guint32 size, gboolean fixed)
Creates a GstBitWriter instance with the given initial data size.
Free-function: gst_bit_writer_free
a new GstBitWriter instance
Function Macros
GST_BIT_WRITER_BIT_SIZE
#define GST_BIT_WRITER_BIT_SIZE(writer) ((writer)->bit_size)
GST_BIT_WRITER_DATA
#define GST_BIT_WRITER_DATA(writer) ((writer)->data)
__GST_BITS_WRITER_ALIGNED
#define __GST_BITS_WRITER_ALIGNED(bitsize) \ (((bitsize) + __GST_BITS_WRITER_ALIGNMENT_MASK)&(~__GST_BITS_WRITER_ALIGNMENT_MASK))
__GST_BIT_WRITER_WRITE_BITS_INLINE
#define __GST_BIT_WRITER_WRITE_BITS_INLINE(bits) \ static inline gboolean \ _gst_bit_writer_put_bits_uint##bits##_inline( \ GstBitWriter *bitwriter, \ guint##bits value, \ guint nbits \ ) \ { \ g_return_val_if_fail(bitwriter != NULL, FALSE); \ g_return_val_if_fail(nbits != 0, FALSE); \ g_return_val_if_fail(nbits <= bits, FALSE); \ \ if (!_gst_bit_writer_check_remaining(bitwriter, nbits)) \ return FALSE; \ gst_bit_writer_put_bits_uint##bits##_unchecked(bitwriter, value, nbits); \ return TRUE; \ }
__GST_BIT_WRITER_WRITE_BITS_UNCHECKED
#define __GST_BIT_WRITER_WRITE_BITS_UNCHECKED(bits) \ static inline void \ gst_bit_writer_put_bits_uint##bits##_unchecked( \ GstBitWriter *bitwriter, \ guint##bits value, \ guint nbits \ ) \ { \ guint byte_pos, bit_offset; \ guint8 *cur_byte; \ guint fill_bits; \ \ byte_pos = (bitwriter->bit_size >> 3); \ bit_offset = (bitwriter->bit_size & 0x07); \ cur_byte = bitwriter->data + byte_pos; \ g_assert (nbits <= bits); \ g_assert( bit_offset < 8 && \ bitwriter->bit_size <= bitwriter->bit_capacity); \ \ while (nbits) { \ fill_bits = ((8 - bit_offset) < nbits ? (8 - bit_offset) : nbits); \ nbits -= fill_bits; \ bitwriter->bit_size += fill_bits; \ \ *cur_byte |= (((value >> nbits) & _gst_bit_writer_bit_filling_mask[fill_bits]) \ << (8 - bit_offset - fill_bits)); \ ++cur_byte; \ bit_offset = 0; \ } \ g_assert(cur_byte <= \ (bitwriter->data + (bitwriter->bit_capacity >> 3))); \ }
Constants
__GST_BITS_WRITER_ALIGNMENT_MASK
#define __GST_BITS_WRITER_ALIGNMENT_MASK 2047
The results of the search are