ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
packet_parsing.h File Reference

Shared packet parsing utilities to eliminate duplication between server and client handlers. More...

Go to the source code of this file.

Functions

Frame Decoding Functions

Unified frame data decoding for both compressed and uncompressed formats

char * packet_decode_frame_data_malloc (const char *frame_data_ptr, size_t frame_data_len, bool is_compressed, uint32_t original_size, uint32_t compressed_size)
 Decode frame data (malloc version for client handlers)
 
asciichat_error_t packet_decode_frame_data_buffer (const char *frame_data_ptr, size_t frame_data_len, bool is_compressed, void *output_buffer, size_t output_size, uint32_t original_size, uint32_t compressed_size)
 Decode frame data (fixed buffer version for server handlers)
 
Frame Dimension Validation

Validation helpers for frame dimensions with overflow checking

asciichat_error_t packet_validate_frame_dimensions (uint32_t width, uint32_t height, size_t *out_rgb_size)
 Validate frame dimensions and calculate RGB buffer size.
 
Audio Batch Header Parsing

Helpers for parsing audio batch packet headers

Note
audio_batch_info_t is defined in audio/audio.h
Generic Payload Validation

Generic helpers for common payload validation patterns

Opus Audio Batch Parsing

Helpers for parsing Opus audio batch packets

asciichat_error_t packet_parse_opus_batch (const void *packet_data, size_t packet_len, const uint8_t **out_opus_data, size_t *out_opus_size, const uint16_t **out_frame_sizes, int *out_sample_rate, int *out_frame_duration, int *out_frame_count)
 Parse Opus audio batch packet header and extract frame data.
 

Detailed Description

Shared packet parsing utilities to eliminate duplication between server and client handlers.

Definition in file packet_parsing.h.