ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
frame_validator.h File Reference

Frame validation utilities for IMAGE_FRAME packets. More...

Go to the source code of this file.

Macros

#define FRAME_HEADER_SIZE_LEGACY   8
 Legacy frame header size (width:4 + height:4)
 
#define FRAME_HEADER_SIZE_NEW   16
 New frame header size (width:4 + height:4 + compressed:4 + size:4)
 
#define FRAME_HEADER_FIELD_SIZE   4
 Size of each header field (uint32_t = 4 bytes)
 

Functions

asciichat_error_t frame_validate_legacy (size_t len, size_t expected_rgb_size)
 Validate legacy frame format.
 
asciichat_error_t frame_validate_new (void *data, size_t len, bool *out_compressed, uint32_t *out_data_size)
 Validate new frame format with optional compression.
 
asciichat_error_t frame_check_size_overflow (size_t header_size, size_t data_size)
 Check for overflow when adding header to data.
 
void frame_extract_dimensions (const void *data, uint32_t *width, uint32_t *height)
 Extract width and height from frame header.
 
void frame_extract_new_header (const void *data, uint32_t *compressed, uint32_t *data_size)
 Extract compressed flag and data size from new format header.
 

Detailed Description

Frame validation utilities for IMAGE_FRAME packets.

Definition in file network/frame_validator.h.

Macro Definition Documentation

◆ FRAME_HEADER_FIELD_SIZE

#define FRAME_HEADER_FIELD_SIZE   4

Size of each header field (uint32_t = 4 bytes)

Definition at line 22 of file network/frame_validator.h.

◆ FRAME_HEADER_SIZE_LEGACY

#define FRAME_HEADER_SIZE_LEGACY   8

Legacy frame header size (width:4 + height:4)

Definition at line 16 of file network/frame_validator.h.

◆ FRAME_HEADER_SIZE_NEW

#define FRAME_HEADER_SIZE_NEW   16

New frame header size (width:4 + height:4 + compressed:4 + size:4)

Definition at line 19 of file network/frame_validator.h.