8int32_t read_int(
const char *buf){
10 auto char_ptr =
reinterpret_cast<char *
>(&result);
20void write_int(
char *dst, uint32_t
val){
21 auto src =
reinterpret_cast<char *
>(&
val);
32 hdr->
width = read_int(buf + 0);
33 hdr->
height = read_int(buf + 4);
42 write_int(dst + 0, hdr->
width);
43 write_int(dst + 4, hdr->
height);
50 frame->header.width = 0;
51 frame->header.height = 0;
52 frame->header.data_len = 0;
55 frame->data =
nullptr;
56 frame->alloc_size = 0;
67 if(size <= frame->alloc_size)
70 auto newbuf =
static_cast<char *
>(realloc(
frame->data, size));
74 frame->alloc_size = size;
struct video_frame * frame
bool ipc_frame_parse_header(Ipc_frame_header *hdr, const char *buf)
void ipc_frame_free(Ipc_frame *frame)
void ipc_frame_write_header(const struct Ipc_frame_header *hdr, char *dst)
bool ipc_frame_reserve(Ipc_frame *frame, size_t size)
Ipc_frame * ipc_frame_new()
#define IPC_FRAME_HEADER_LEN