|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
ACIP protocol packet sending functions (transport-agnostic) More...
Go to the source code of this file.
Macros | |
| #define | MAX_REASONABLE_PACKET_SIZE (25 * 1024 * 1024) |
Functions | |
| asciichat_error_t | packet_send_via_transport (acip_transport_t *transport, packet_type_t type, const void *payload, size_t payload_len, uint32_t client_id) |
| Send packet via transport with proper header (exported for generic wrappers) | |
| asciichat_error_t | acip_send_audio_batch (acip_transport_t *transport, const float *samples, uint32_t num_samples, uint32_t batch_count) |
| asciichat_error_t | acip_send_audio_opus (acip_transport_t *transport, const void *opus_data, size_t opus_len) |
| asciichat_error_t | acip_send_audio_opus_batch (acip_transport_t *transport, const void *opus_data, size_t opus_len, const uint16_t *frame_sizes, uint32_t frame_count, uint32_t sample_rate, uint32_t frame_duration) |
| asciichat_error_t | acip_send_ping (acip_transport_t *transport) |
| asciichat_error_t | acip_send_pong (acip_transport_t *transport) |
| asciichat_error_t | acip_send_error (acip_transport_t *transport, uint32_t error_code, const char *message) |
| asciichat_error_t | acip_send_remote_log (acip_transport_t *transport, uint8_t log_level, uint8_t direction, const char *message) |
| asciichat_error_t | acip_send_session_created (acip_transport_t *transport, const acip_session_created_t *response) |
| asciichat_error_t | acip_send_session_info (acip_transport_t *transport, const acip_session_info_t *info) |
| asciichat_error_t | acip_send_session_joined (acip_transport_t *transport, const acip_session_joined_t *response) |
ACIP protocol packet sending functions (transport-agnostic)
Implementation of send functions that work with any transport. Refactored from lib/network/av.c to use transport abstraction.
Definition in file send.c.
| #define MAX_REASONABLE_PACKET_SIZE (25 * 1024 * 1024) |
| asciichat_error_t acip_send_audio_batch | ( | acip_transport_t * | transport, |
| const float * | samples, | ||
| uint32_t | num_samples, | ||
| uint32_t | batch_count | ||
| ) |
Definition at line 115 of file send.c.
References buffer_pool_alloc(), buffer_pool_free(), and packet_send_via_transport().
Referenced by client_send_thread_func(), and threaded_send_audio_batch_packet().
| asciichat_error_t acip_send_audio_opus | ( | acip_transport_t * | transport, |
| const void * | opus_data, | ||
| size_t | opus_len | ||
| ) |
Definition at line 147 of file send.c.
References acip_send_audio_opus_batch().
| asciichat_error_t acip_send_audio_opus_batch | ( | acip_transport_t * | transport, |
| const void * | opus_data, | ||
| size_t | opus_len, | ||
| const uint16_t * | frame_sizes, | ||
| uint32_t | frame_count, | ||
| uint32_t | sample_rate, | ||
| uint32_t | frame_duration | ||
| ) |
Definition at line 158 of file send.c.
References buffer_pool_alloc(), buffer_pool_free(), and packet_send_via_transport().
Referenced by acip_send_audio_opus(), client_send_thread_func(), and threaded_send_audio_opus_batch().
| asciichat_error_t acip_send_error | ( | acip_transport_t * | transport, |
| uint32_t | error_code, | ||
| const char * | message | ||
| ) |
Definition at line 233 of file send.c.
References buffer_pool_alloc(), buffer_pool_free(), error_code, and packet_send_via_transport().
Referenced by acds_client_handler(), and disconnect_client_for_bad_data().
| asciichat_error_t acip_send_ping | ( | acip_transport_t * | transport | ) |
Definition at line 203 of file send.c.
References packet_send_via_transport().
| asciichat_error_t acip_send_pong | ( | acip_transport_t * | transport | ) |
Definition at line 212 of file send.c.
References packet_send_via_transport().
Referenced by handle_ping_packet().
| asciichat_error_t acip_send_remote_log | ( | acip_transport_t * | transport, |
| uint8_t | log_level, | ||
| uint8_t | direction, | ||
| const char * | message | ||
| ) |
Definition at line 270 of file send.c.
References buffer_pool_alloc(), buffer_pool_free(), and packet_send_via_transport().
| asciichat_error_t acip_send_session_created | ( | acip_transport_t * | transport, |
| const acip_session_created_t * | response | ||
| ) |
Definition at line 305 of file send.c.
References packet_send_via_transport().
| asciichat_error_t acip_send_session_info | ( | acip_transport_t * | transport, |
| const acip_session_info_t * | info | ||
| ) |
Definition at line 313 of file send.c.
References packet_send_via_transport().
| asciichat_error_t acip_send_session_joined | ( | acip_transport_t * | transport, |
| const acip_session_joined_t * | response | ||
| ) |
Definition at line 321 of file send.c.
References packet_send_via_transport().
| asciichat_error_t packet_send_via_transport | ( | acip_transport_t * | transport, |
| packet_type_t | type, | ||
| const void * | payload, | ||
| size_t | payload_len, | ||
| uint32_t | client_id | ||
| ) |
Send packet via transport with proper header (exported for generic wrappers)
Wraps payload in ACIP packet header and sends via transport. Handles CRC32 calculation and network byte order conversion.
| transport | Transport instance |
| type | Packet type |
| payload | Payload data (may be NULL if payload_len is 0) |
| payload_len | Payload length |
| client_id | Client ID to include in packet header |
Definition at line 41 of file send.c.
References MAX_REASONABLE_PACKET_SIZE.
Referenced by acip_send_ascii_frame(), acip_send_audio_batch(), acip_send_audio_opus_batch(), acip_send_capabilities(), acip_send_clear_console(), acip_send_client_join(), acip_send_client_leave(), acip_send_error(), acip_send_image_frame(), acip_send_ping(), acip_send_pong(), acip_send_protocol_version(), acip_send_remote_log(), acip_send_server_state(), acip_send_session_created(), acip_send_session_info(), acip_send_session_joined(), acip_send_stream_start(), acip_send_stream_stop(), client_send_thread_func(), crypto_handshake_client_key_exchange(), crypto_handshake_server_auth_challenge(), crypto_handshake_server_complete(), crypto_handshake_server_start(), threaded_send_audio_opus(), and threaded_send_packet().