libgpac
Documentation of the core library of GPAC
bitstream.h File Reference

bitstream reading and writing. More...

#include <gpac/tools.h>
+ Include dependency graph for bitstream.h:
+ This graph shows which files directly or indirectly include this file:

Typedefs

typedef struct __tag_bitstream GF_BitStream
 

Enumerations

enum  { GF_BITSTREAM_READ = 0 , GF_BITSTREAM_WRITE , GF_BITSTREAM_WRITE_DYN }
 

Functions

GF_BitStreamgf_bs_new (const u8 *buffer, u64 size, u32 mode)
 bitstream constructor More...
 
GF_Err gf_bs_reassign_buffer (GF_BitStream *bs, const u8 *buffer, u64 size)
 bitstream reassignment More...
 
GF_BitStreamgf_bs_from_file (FILE *f, u32 mode)
 bitstream constructor from file handle More...
 
void gf_bs_del (GF_BitStream *bs)
 bitstream destructor from file handle More...
 
GF_BitStreamgf_bs_new_cbk (GF_Err(*on_block_out)(void *cbk, u8 *data, u32 block_size), void *usr_data, u32 block_size)
 bitstream constructor from callback output More...
 
GF_BitStreamgf_bs_new_cbk_buffer (GF_Err(*on_block_out)(void *cbk, u8 *data, u32 block_size), void *usr_data, u8 *buffer, u32 buffer_size)
 bitstream constructor from callback output and preallocated buffer More...
 
void gf_bs_prevent_dispatch (GF_BitStream *bs, Bool prevent_dispatch)
 prevents block dispatch Prevents byte dispatching in callback mode. This is used when seek operations are used. More...
 
u32 gf_bs_read_int (GF_BitStream *bs, u32 nBits)
 integer reading More...
 
u64 gf_bs_read_long_int (GF_BitStream *bs, u32 nBits)
 large integer reading More...
 
Float gf_bs_read_float (GF_BitStream *bs)
 float reading More...
 
Double gf_bs_read_double (GF_BitStream *bs)
 double reading More...
 
u32 gf_bs_read_data (GF_BitStream *bs, u8 *data, u32 nbBytes)
 data reading More...
 
u32 gf_bs_read_u8 (GF_BitStream *bs)
 align char reading More...
 
u32 gf_bs_read_u16 (GF_BitStream *bs)
 align short reading More...
 
u32 gf_bs_read_u24 (GF_BitStream *bs)
 align 24-bit integer reading More...
 
u32 gf_bs_read_u32 (GF_BitStream *bs)
 align integer reading More...
 
u64 gf_bs_read_u64 (GF_BitStream *bs)
 align large integer reading More...
 
u64 gf_bs_read_u64_le (GF_BitStream *bs)
 little endian integer reading More...
 
u32 gf_bs_read_u32_le (GF_BitStream *bs)
 little endian integer reading More...
 
u16 gf_bs_read_u16_le (GF_BitStream *bs)
 little endian integer reading More...
 
u32 gf_bs_read_vluimsbf5 (GF_BitStream *bs)
 variable length integer reading More...
 
u32 gf_bs_get_bit_offset (GF_BitStream *bs)
 bit position More...
 
u32 gf_bs_get_bit_position (GF_BitStream *bs)
 current bit position More...
 
void gf_bs_write_int (GF_BitStream *bs, s32 value, s32 nBits)
 integer writing More...
 
void gf_bs_write_long_int (GF_BitStream *bs, s64 value, s32 nBits)
 large integer writing More...
 
void gf_bs_write_float (GF_BitStream *bs, Float value)
 float writing More...
 
void gf_bs_write_double (GF_BitStream *bs, Double value)
 double writing More...
 
u32 gf_bs_write_data (GF_BitStream *bs, const u8 *data, u32 nbBytes)
 data writing More...
 
void gf_bs_write_u8 (GF_BitStream *bs, u32 value)
 align char writing More...
 
void gf_bs_write_u16 (GF_BitStream *bs, u32 value)
 align short writing More...
 
void gf_bs_write_u24 (GF_BitStream *bs, u32 value)
 align 24-bits integer writing More...
 
void gf_bs_write_u32 (GF_BitStream *bs, u32 value)
 align integer writing More...
 
void gf_bs_write_u64 (GF_BitStream *bs, u64 value)
 align large integer writing More...
 
void gf_bs_write_u32_le (GF_BitStream *bs, u32 value)
 little endian integer writing More...
 
void gf_bs_write_u64_le (GF_BitStream *bs, u64 value)
 little endian large integer writing More...
 
void gf_bs_write_u16_le (GF_BitStream *bs, u32 value)
 little endian short writing More...
 
u32 gf_bs_write_byte (GF_BitStream *bs, u8 byte, u32 count)
 write byte multiple times More...
 
void gf_bs_set_eos_callback (GF_BitStream *bs, void(*EndOfStream)(void *par), void *par)
 end of bitstream management More...
 
Bool gf_bs_is_align (GF_BitStream *bs)
 bitstream alignment checking More...
 
u8 gf_bs_align (GF_BitStream *bs)
 bitstream alignment More...
 
u64 gf_bs_available (GF_BitStream *bs)
 capacity query More...
 
void gf_bs_get_content (GF_BitStream *bs, u8 **output, u32 *outSize)
 buffer fetching More...
 
void gf_bs_get_content_no_truncate (GF_BitStream *bs, u8 **output, u32 *outSize, u32 *allocSize)
 buffer fetching More...
 
void gf_bs_skip_bytes (GF_BitStream *bs, u64 nbBytes)
 byte skipping More...
 
GF_Err gf_bs_seek (GF_BitStream *bs, u64 offset)
 bitstream seeking More...
 
void gf_bs_truncate (GF_BitStream *bs)
 bitstream truncation More...
 
u32 gf_bs_peek_bits (GF_BitStream *bs, u32 numBits, u64 byte_offset)
 bit peeking More...
 
u8 gf_bs_bits_available (GF_BitStream *bs)
 bit reservoir query More...
 
u64 gf_bs_get_position (GF_BitStream *bs)
 position query More...
 
u64 gf_bs_get_size (GF_BitStream *bs)
 size query More...
 
u64 gf_bs_get_refreshed_size (GF_BitStream *bs)
 file-based size query More...
 
GF_Err gf_bs_transfer (GF_BitStream *dst, GF_BitStream *src, Bool keep_src)
 transfer content from source bitstream to destination bitstream More...
 
void gf_bs_flush (GF_BitStream *bs)
 Flushes bitstream content to disk. More...
 
void gf_bs_enable_emulation_byte_removal (GF_BitStream *bs, Bool do_remove)
 NALU-based Annex B mode, only used for read mode. More...
 
u32 gf_bs_get_emulation_byte_removed (GF_BitStream *bs)
 NALU-based Annex B mode, only used for read mode. More...
 
GF_Err gf_bs_insert_data (GF_BitStream *bs, u8 *data, u32 size, u64 offset)
 Inserts a data block, moving bytes to the end. More...
 
u64 gf_bs_set_cookie (GF_BitStream *bs, u64 cookie)
 Sets cookie. More...
 
u64 gf_bs_get_cookie (GF_BitStream *bs)
 Gets cookie. More...
 
char * gf_bs_read_utf8 (GF_BitStream *bs)
 Reads string. More...
 
GF_Err gf_bs_write_utf8 (GF_BitStream *bs, const char *str)
 Writes string. More...
 
void gf_bs_mark_overflow (GF_BitStream *bs, Bool reset)
 Marks overflow access. More...
 
u32 gf_bs_is_overflow (GF_BitStream *bs)
 Gets overflow state. More...
 

Detailed Description

>