+ +
2da5fe7 OpenAVX v0.2.0 - High-performance open-standard IP audio and video transport suite
saifmukhtar · 2026-11-24
main
| 1 | /* |
| 2 | * SPDX-License-Identifier: AGPL-3.0-or-later WITH Classpath-exception-2.0 |
| 3 | * Copyright (c) 2026 Saif Mukhtar |
| 4 | * |
| 5 | * OpenAVX - Open Audio-Video eXchange |
| 6 | * include/avx_send_internal.h - Internal declarations for OpenAVX transmission engine |
| 7 | */ |
| 8 | |
| 9 | #ifndef AVX_SEND_INTERNAL_H |
| 10 | #define AVX_SEND_INTERNAL_H |
| 11 | |
| 12 | #include "avx_internal.h" |
| 13 | #include "avx_audio.h" |
| 14 | #include "avx_speedhq.h" |
| 15 | #include "avx_discovery_server.h" |
| 16 | #include "avx_wire.h" |
| 17 | #include "avx_rtsp.h" |
| 18 | #include "avx_web.h" |
| 19 | #include "avx_rate_control.h" |
| 20 | |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
| 25 | /* Networking & Client Helpers */ |
| 26 | bool avx_socket_send_all(avx_socket_t fd, const void* buf, size_t len); |
| 27 | void avx_send_recalculate_tally_locked(avx_send_ctx_t* slot); |
| 28 | void avx_send_remove_client_locked(avx_send_ctx_t* slot, int index); |
| 29 | void avx_client_queue_drain(avx_send_ctx_t* slot, avx_client_slot_t* client); |
| 30 | bool avx_send_video_datagram(avx_send_ctx_t *slot, avx_client_slot_t *client, const avx_tx_video_slot_t *vslot, bool use_rudp); |
| 31 | |
| 32 | /* Listener & Worker Lifecycle */ |
| 33 | bool avx_send_start_listener(avx_send_ctx_t* send_ctx); |
| 34 | OPENAVX_API void avx_send_stop_listener(avx_send_ctx_t* send_ctx); |
| 35 | void* avx_send_client_tx_worker(void* arg); |
| 36 | void* avx_send_client_rx_worker(void* arg); |
| 37 | void* avx_send_listen_worker(void* arg); |
| 38 | void* avx_send_nack_service_worker(void* arg); |
| 39 | |
| 40 | /* Auxiliary RTSP & Web Preview Server helpers */ |
| 41 | bool avx_send_detect_hx_keyframe(uint32_t fourcc, const uint8_t *data, size_t size); |
| 42 | void avx_send_feed_aux_servers(void *rtsp_srv, void *web_srv, uint32_t fourcc, const uint8_t *payload, size_t payload_size, int64_t pts_ns); |
| 43 | |
| 44 | /* Profiles & Rate Control Evaluators */ |
| 45 | uint32_t avx_send_evaluate_client_congestion( |
| 46 | avx_client_slot_t *client, |
| 47 | int64_t now_ns, |
| 48 | size_t wire_bytes, |
| 49 | float target_fps, |
| 50 | uint32_t *out_cadence |
| 51 | ); |
| 52 | void avx_send_profiles_tick(avx_send_ctx_t *slot, int64_t now_ms); |
| 53 | OPENAVX_API bool avx_is_lan_sockaddr(const struct sockaddr_storage *addr); |
| 54 | OPENAVX_API uint32_t avx_negotiate_best_codec(const char *codecs_str); |
| 55 | |
| 56 | #ifdef __cplusplus |
| 57 | } |
| 58 | #endif |
| 59 | |
| 60 | #endif /* AVX_SEND_INTERNAL_H */ |