GstBase.BitReader¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
bit |
r/w |
Bit position in the current byte |
|
byte |
r/w |
Current byte position |
|
data |
r/w |
Data from which the bit reader will read |
|
size |
r/w |
Size of data in bytes |
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstBase.BitReader¶
GstBase.BitReader
provides a bit reader that can read any number of bits from a memory buffer. It provides functions for reading any number of bits into 8, 16, 32 and 64 bit variables.- free()[source]¶
Frees a
GstBase.BitReader
instance, which was previously allocated by gst_bit_reader_new().
- get_bits_uint16(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint16 to store the result
- Return type:
Read nbits bits into val and update the current position.
- get_bits_uint32(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint32 to store the result
- Return type:
Read nbits bits into val and update the current position.
- get_bits_uint64(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint64 to store the result
- Return type:
Read nbits bits into val and update the current position.
- get_bits_uint8(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint8 to store the result
- Return type:
Read nbits bits into val and update the current position.
- get_pos()[source]¶
- Returns:
The current position of self in bits.
- Return type:
Returns the current position of a
GstBase.BitReader
instance in bits.
- get_remaining()[source]¶
- Returns:
The remaining number of bits of self instance.
- Return type:
Returns the remaining number of bits of a
GstBase.BitReader
instance.
- get_size()[source]¶
- Returns:
The total number of bits of self instance.
- Return type:
Returns the total number of bits of a
GstBase.BitReader
instance.
- init(data)[source]¶
- Parameters:
data (
bytes
) – data from which the bit reader should read
Initializes a
GstBase.BitReader
instance to read from data. This function can be called on already initialized instances.
- peek_bits_uint16(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint16 to store the result
- Return type:
Read nbits bits into val but keep the current position.
- peek_bits_uint32(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint32 to store the result
- Return type:
Read nbits bits into val but keep the current position.
- peek_bits_uint64(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint64 to store the result
- Return type:
Read nbits bits into val but keep the current position.
- peek_bits_uint8(nbits)[source]¶
- Parameters:
nbits (
int
) – number of bits to read- Returns:
True
if successful,False
otherwise.- val:
Pointer to a #guint8 to store the result
- Return type:
Read nbits bits into val but keep the current position.
- set_pos(pos)[source]¶
- Parameters:
pos (
int
) – The new position in bits- Returns:
True
if the position could be set successfully,False
otherwise.- Return type:
Sets the new position of a
GstBase.BitReader
instance to pos in bits.
- skip(nbits)[source]¶
- Parameters:
nbits (
int
) – the number of bits to skip- Returns:
- Return type:
Skips nbits bits of the
GstBase.BitReader
instance.