FreeCalypso > hg > themwi-rtp-lib
comparison include/endp.h @ 19:b8cb5146e5b4
endp: beginning
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 07 Jul 2024 02:14:01 +0000 |
parents | |
children | 695fdb670d30 |
comparison
equal
deleted
inserted
replaced
18:ec50018cc4ea | 19:b8cb5146e5b4 |
---|---|
1 /* | |
2 * twrtp_endp is the big abstraction provided by libtwrtp: a complete | |
3 * RTP endpoint with RTP & RTCP sockets, sending and receiving both types | |
4 * of packets, and incorporating twjit. | |
5 */ | |
6 | |
7 #pragma once | |
8 | |
9 #include <stdint.h> | |
10 #include <stdbool.h> | |
11 | |
12 #include <osmocom/core/osmo_io.h> | |
13 #include <osmocom/core/socket.h> | |
14 | |
15 #include <themwi/rtp/twjit.h> | |
16 | |
17 struct twrtp_endp_tx { | |
18 uint32_t ssrc; | |
19 uint32_t ts; | |
20 uint16_t seq; | |
21 bool started; | |
22 bool restart; | |
23 }; | |
24 | |
25 struct twrtp_endp_stats { | |
26 uint32_t rx_rtp_pkt; | |
27 uint32_t rx_rtp_badsrc; | |
28 uint32_t rx_rtcp_pkt; | |
29 uint32_t rx_rtcp_badsrc; | |
30 uint32_t tx_rtp_pkt; | |
31 uint32_t tx_rtp_bytes; | |
32 uint32_t tx_rtcp_pkt; | |
33 }; | |
34 | |
35 struct twrtp_endp { | |
36 /* the root of the matter: the two sockets */ | |
37 int rtp_fd; | |
38 int rtcp_fd; | |
39 struct osmo_io_fd *iofd_rtp; | |
40 struct osmo_io_fd *iofd_rtcp; | |
41 struct osmo_sockaddr rtp_remote; | |
42 struct osmo_sockaddr rtcp_remote; | |
43 /* Rx and Tx state */ | |
44 struct twrtp_jibuf_inst *twjit; | |
45 /* RTCP Rx structure to be inserted here */ | |
46 struct twrtp_endp_tx tx; | |
47 /* always have to have stats */ | |
48 struct twrtp_endp_stats stats; | |
49 /* bool flags at the end for structure packing optimization */ | |
50 bool register_done; | |
51 bool remote_set; | |
52 bool rx_enable; | |
53 }; | |
54 | |
55 /* public API functions */ | |
56 | |
57 struct twrtp_endp *twrtp_endp_create(void *ctx, | |
58 struct twrtp_jibuf_config *config); | |
59 | |
60 void twrtp_endp_destroy(struct twrtp_endp *endp); |