72 if (i_total >= i_size)
75 while(i_total >= i_size + i_growth)
87 #define BO_SET_DECL_S(func, handler, type) static inline bool func(bo_t *p_bo, size_t i_offset, type val)\ 89 if (!bo_extend(p_bo, i_offset + sizeof(type)))\ 91 handler(&p_bo->b->p_buffer[i_offset], val);\ 95 #define BO_ADD_DECL_S(func, handler, type) static inline bool func(bo_t *p_bo, type val)\ 97 if(!p_bo->b || !handler(p_bo, p_bo->b->i_buffer, val))\ 99 p_bo->b->i_buffer += sizeof(type);\ 103 #define BO_FUNC_DECL(suffix, handler, type ) \ 104 BO_SET_DECL_S( bo_set_ ## suffix ## be, handler ## BE, type )\ 105 BO_SET_DECL_S( bo_set_ ## suffix ## le, handler ## LE, type )\ 106 BO_ADD_DECL_S( bo_add_ ## suffix ## be, bo_set_ ## suffix ## be, type )\ 107 BO_ADD_DECL_S( bo_add_ ## suffix ## le, bo_set_ ## suffix ## le, type ) 109 static inline bool bo_set_8(
bo_t *p_bo,
size_t i_offset, uint8_t i)
146 if (!p_bo->
b || p_bo->
b->
i_buffer < i_pos + 4)
148 p_bo->
b->
p_buffer[i_pos ] = (i >> 24)&0xff;
149 p_bo->
b->
p_buffer[i_pos + 1] = (i >> 16)&0xff;
150 p_bo->
b->
p_buffer[i_pos + 2] = (i >> 8)&0xff;
151 p_bo->
b->
p_buffer[i_pos + 3] = (i )&0xff;
154 static inline bool bo_add_mem(
bo_t *p_bo,
size_t i_size,
const void *p_mem)
168 #define bo_add_fourcc(p_bo, fcc) bo_add_mem(p_bo, 4, fcc) 170 #endif // VLC_BOXES_H static size_t bo_size(const bo_t *p_bo)
Definition: vlc_boxes.h:164
size_t basesize
Definition: vlc_boxes.h:39
static bool bo_add_24be(bo_t *p_bo, uint32_t i)
Definition: vlc_boxes.h:135
static bool bo_set_8(bo_t *p_bo, size_t i_offset, uint8_t i)
Definition: vlc_boxes.h:110
static void bo_deinit(bo_t *p_bo)
Definition: vlc_boxes.h:54
This file is a collection of common definitions and types.
size_t i_buffer
Payload length.
Definition: vlc_block.h:122
static int bo_extend(bo_t *p_bo, size_t i_total)
Definition: vlc_boxes.h:68
uint8_t * p_start
Buffer start.
Definition: vlc_block.h:123
Data block definition and functions.
block_t * block_Alloc(size_t size)
Allocates a block.
Definition: block.c:108
Definition: vlc_boxes.h:36
void block_Release(block_t *block)
Releases a block.
Definition: block.c:135
static bool bo_init(bo_t *p_bo, int i_size)
Definition: vlc_boxes.h:42
size_t i_size
Buffer total size.
Definition: vlc_block.h:124
#define BO_FUNC_DECL(suffix, handler, type)
Definition: vlc_boxes.h:104
static bool bo_add_8(bo_t *p_bo, uint8_t i)
Definition: vlc_boxes.h:118
static void bo_free(bo_t *p_bo)
Definition: vlc_boxes.h:60
static void bo_swap_32be(bo_t *p_bo, size_t i_pos, uint32_t i)
Definition: vlc_boxes.h:145
static bool bo_add_mem(bo_t *p_bo, size_t i_size, const void *p_mem)
Definition: vlc_boxes.h:155
block_t * block_Realloc(block_t *block, ssize_t prebody, size_t body)
Reallocates a block.
Definition: block.c:235
Definition: vlc_block.h:117
uint8_t * p_buffer
Payload start.
Definition: vlc_block.h:121
block_t * b
Definition: vlc_boxes.h:38