MT#55283 convert struct stream_fd to typedef

Change-Id: I1435a5f755cb99833535d995871f1e9050f0ec73
pull/1776/head
Richard Fuchs 2 years ago
parent d8a17a269b
commit cd4f6608cd

@ -134,7 +134,7 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) {
unsigned int check;
bool good = false;
struct packet_stream *ps;
struct stream_fd *sfd;
stream_fd *sfd;
int tmp_t_reason = UNKNOWN;
struct call_monologue *ml;
enum call_stream_state css;
@ -684,7 +684,7 @@ static struct endpoint_map *__hunt_endpoint_map(struct call_media *media, unsign
for (__auto_type k = em->intf_sfds.head; k; k = k->next) {
struct sfd_intf_list *il = k->data;
for (__auto_type j = il->list.head; j; j = j->next) {
struct stream_fd *sfd = j->data;
stream_fd *sfd = j->data;
if (sfd->socket.fd == -1)
return NULL;
}
@ -735,7 +735,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media)
struct packet_stream *first_ps = media->streams.head->data;
if (!first_ps->sfds.length)
return NULL;
struct stream_fd *matcher = first_ps->sfds.head->data;
stream_fd *matcher = first_ps->sfds.head->data;
for (GList *l = media->endpoint_maps.tail; l; l = l->prev) {
struct endpoint_map *em = l->data;
@ -744,7 +744,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media)
struct sfd_intf_list *em_il = em->intf_sfds.head->data;
if (!em_il->list.length)
continue;
struct stream_fd *first = em_il->list.head->data;
stream_fd *first = em_il->list.head->data;
if (first == matcher)
return em;
}
@ -753,7 +753,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media)
static struct endpoint_map *__get_endpoint_map(struct call_media *media, unsigned int num_ports,
const struct endpoint *ep, const sdp_ng_flags *flags, bool always_reuse)
{
struct stream_fd *sfd;
stream_fd *sfd;
socket_intf_list_q intf_sockets = TYPED_GQUEUE_INIT;
unsigned int want_interfaces = __media_want_interfaces(media);
@ -835,12 +835,12 @@ static void __assign_stream_fds(struct call_media *media, sfd_intf_list_q *intf_
t_queue_clear(&ps->sfds);
bool sfd_found = false;
struct stream_fd *intf_sfd = NULL;
stream_fd *intf_sfd = NULL;
for (__auto_type l = intf_sfds->head; l; l = l->next) {
struct sfd_intf_list *il = l->data;
struct stream_fd *sfd = t_queue_peek_nth(&il->list, ps->component - 1);
stream_fd *sfd = t_queue_peek_nth(&il->list, ps->component - 1);
if (!sfd)
sfd = ps->selected_sfd;
if (!sfd) {
@ -1059,7 +1059,7 @@ enum call_stream_state call_stream_state_machine(struct packet_stream *ps) {
for (__auto_type l = ps->sfds.head; l; l = l->next) {
static const str fake_rtp = STR_CONST_INIT("\x80\x7f\xff\xff\x00\x00\x00\x00"
"\x00\x00\x00\x00");
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
if (sfd->socket.fd == -1 || ps->endpoint.address.family == NULL)
continue;
socket_sendto(&sfd->socket, fake_rtp.s, fake_rtp.len, &ps->endpoint);
@ -1094,7 +1094,7 @@ int __init_stream(struct packet_stream *ps) {
if (MEDIA_ISSET(media, SDES) && dtls_active == -1) {
for (__auto_type l = ps->sfds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
struct crypto_params_sdes *cps = media->sdes_in.head
? media->sdes_in.head->data : NULL;
crypto_init(&sfd->crypto, cps ? &cps->params : NULL);
@ -1119,7 +1119,7 @@ int __init_stream(struct packet_stream *ps) {
dtls_active = (PS_ISSET(ps, FILLED) && MEDIA_ISSET(media, SETUP_ACTIVE));
dtls_connection_init(&ps->ice_dtls, ps, dtls_active, call->dtls_cert);
for (__auto_type l = ps->sfds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
dtls_connection_init(&sfd->dtls, ps, dtls_active, call->dtls_cert);
}
@ -2018,7 +2018,7 @@ static void __fingerprint_changed(struct call_media *m) {
static void __set_all_tos(call_t *c) {
for (__auto_type l = c->stream_fds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
if (sfd->socket.fd == -1)
continue;
set_tos(&sfd->socket, c->tos);
@ -3587,7 +3587,7 @@ static void __call_cleanup(call_t *c) {
}
while (c->stream_fds.head) {
struct stream_fd *sfd = t_queue_pop_head(&c->stream_fds);
stream_fd *sfd = t_queue_pop_head(&c->stream_fds);
stream_fd_release(sfd);
obj_put(sfd);
}
@ -4247,7 +4247,7 @@ void monologue_destroy(struct call_monologue *monologue) {
ps->last_local_endpoint = ps->selected_sfd->socket.local;
ps->selected_sfd = NULL;
struct stream_fd *sfd;
stream_fd *sfd;
while ((sfd = t_queue_pop_head(&ps->sfds)))
stream_fd_release(sfd);
}

@ -16,6 +16,7 @@
#include "rtcplib.h"
#include "main.h"
#include "ssllib.h"
#include "types.h"

@ -40,7 +40,7 @@
#define CERT_EXPIRY_TIME (60*60*24*30) /* 30 days */
struct dtls_connection *dtls_ptr(struct stream_fd *sfd) {
struct dtls_connection *dtls_ptr(stream_fd *sfd) {
if (!sfd)
return NULL;
struct packet_stream *ps = sfd->stream;
@ -763,7 +763,7 @@ found:
}
// it's possible that ps->selected_sfd is not from ps->sfds list (?)
for (__auto_type l = ps->sfds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
if (d->active) /* we're the client */
crypto_init(&sfd->crypto, &server);
else /* we're the server */
@ -785,7 +785,7 @@ error:
}
/* called with call locked in W or R with ps->in_lock held */
int dtls(struct stream_fd *sfd, const str *s, const endpoint_t *fsin) {
int dtls(stream_fd *sfd, const str *s, const endpoint_t *fsin) {
struct packet_stream *ps = sfd->stream;
int ret;
unsigned char buf[0x10000];
@ -906,7 +906,7 @@ void dtls_shutdown(struct packet_stream *ps) {
dtls_connection_cleanup(&ps->ice_dtls);
}
for (__auto_type l = ps->sfds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
struct dtls_connection *d = &sfd->dtls;
if (!d->init)

@ -321,7 +321,7 @@ static void __tree_coll_callback(void *oo, void *nn) {
}
/* agent must be locked */
static struct ice_candidate_pair *__pair_candidate(struct stream_fd *sfd, struct ice_agent *ag,
static struct ice_candidate_pair *__pair_candidate(stream_fd *sfd, struct ice_agent *ag,
struct ice_candidate *cand)
{
struct ice_candidate_pair *pair;
@ -510,7 +510,7 @@ void ice_update(struct ice_agent *ag, struct stream_params *sp, bool allow_reset
unsigned int comps;
struct packet_stream *components[MAX_COMPONENTS], *ps;
candidate_q *candidates;
struct stream_fd *sfd;
stream_fd *sfd;
if (!ag)
return;
@ -782,7 +782,7 @@ static void __fail_pair(struct ice_candidate_pair *pair) {
/* agent must NOT be locked, but call must be locked in R */
static void __do_ice_check(struct ice_candidate_pair *pair) {
struct stream_fd *sfd = pair->sfd;
stream_fd *sfd = pair->sfd;
struct ice_agent *ag = pair->agent;
uint32_t prio, transact[3];
@ -884,7 +884,7 @@ static void __nominate_pairs(struct ice_agent *ag) {
/* call must be locked R or W, agent must not be locked */
static void __do_ice_checks(struct ice_agent *ag) {
struct ice_candidate_pair *pair, *highest = NULL, *frozen = NULL, *valid;
struct stream_fd *sfd;
stream_fd *sfd;
GQueue retransmits = G_QUEUE_INIT;
struct timeval next_run = {0,0};
int have_more = 0;
@ -1044,7 +1044,7 @@ static void __cand_ice_foundation(call_t *call, struct ice_candidate *cand) {
}
/* agent must be locked */
static struct ice_candidate_pair *__learned_candidate(struct ice_agent *ag, struct stream_fd *sfd,
static struct ice_candidate_pair *__learned_candidate(struct ice_agent *ag, stream_fd *sfd,
const endpoint_t *src, unsigned long priority)
{
struct ice_candidate *cand, *old_cand;
@ -1219,7 +1219,7 @@ static int __check_valid(struct ice_agent *ag) {
candidate_pair_q all_compos;
struct ice_candidate_pair *pair;
// const struct local_intf *ifa;
struct stream_fd *sfd;
stream_fd *sfd;
int is_complete = 1;
if (!ag) {
@ -1292,7 +1292,7 @@ static int __check_valid(struct ice_agent *ag) {
* -1 = generic error, process packet as normal
* -2 = role conflict
*/
int ice_request(struct stream_fd *sfd, const endpoint_t *src,
int ice_request(stream_fd *sfd, const endpoint_t *src,
struct stun_attrs *attrs)
{
struct packet_stream *ps = sfd->stream;
@ -1401,7 +1401,7 @@ static int __check_succeeded_complete(struct ice_agent *ag) {
}
/* call is locked in R */
int ice_response(struct stream_fd *sfd, const endpoint_t *src,
int ice_response(stream_fd *sfd, const endpoint_t *src,
struct stun_attrs *attrs, void *transaction)
{
struct ice_candidate_pair *pair, *opair;

@ -8,14 +8,13 @@
struct stream_fd;
struct ice_agent;
enum log_format;
struct log_info {
union {
call_t *call;
struct stream_fd *stream_fd;
stream_fd *stream_fd;
const str *str;
const char *cstr;
struct ice_agent *ice_agent;

@ -78,7 +78,7 @@ INLINE void log_info_call(call_t *c) {
log_info.e = LOG_INFO_CALL;
log_info.call = obj_get(c);
}
INLINE void log_info_stream_fd(struct stream_fd *sfd) {
INLINE void log_info_stream_fd(stream_fd *sfd) {
if (!sfd)
return;
__log_info_push();

@ -232,7 +232,7 @@ static void send_timer_rtcp(struct send_timer *st, struct ssrc_ctx *ssrc_out) {
static bool __send_timer_send_1(struct rtp_header *rh, struct packet_stream *sink, struct codec_packet *cp) {
struct stream_fd *sink_fd = sink->selected_sfd;
stream_fd *sink_fd = sink->selected_sfd;
if (!sink_fd || sink_fd->socket.fd == -1 || sink->endpoint.address.family == NULL)
return false;

@ -1281,7 +1281,7 @@ void free_release_sfd_intf_list(struct sfd_intf_list *il) {
/* called lock-free */
static void stream_fd_closed(int fd, void *p, uintptr_t u) {
struct stream_fd *sfd = p;
stream_fd *sfd = p;
call_t *c;
int i;
socklen_t j;
@ -3105,7 +3105,7 @@ out:
static void stream_fd_readable(int fd, void *p, uintptr_t u) {
struct stream_fd *sfd = p;
stream_fd *sfd = p;
char buf[RTP_BUFFER_SIZE];
int ret, iters;
bool update = false;
@ -3222,7 +3222,7 @@ done:
static void stream_fd_free(void *p) {
struct stream_fd *f = p;
stream_fd *f = p;
release_port(&f->socket, f->local_intf->spec);
crypto_cleanup(&f->crypto);
dtls_connection_cleanup(&f->dtls);
@ -3230,8 +3230,8 @@ static void stream_fd_free(void *p) {
obj_put(f->call);
}
struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif) {
struct stream_fd *sfd;
stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif) {
stream_fd *sfd;
struct poller_item pi;
struct poller *p = rtpe_poller;
@ -3268,16 +3268,16 @@ struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *l
return sfd;
}
struct stream_fd *stream_fd_lookup(const endpoint_t *ep) {
stream_fd *stream_fd_lookup(const endpoint_t *ep) {
RWLOCK_R(&local_media_socket_endpoints_lock);
struct stream_fd *ret = g_hash_table_lookup(local_media_socket_endpoints, ep);
stream_fd *ret = g_hash_table_lookup(local_media_socket_endpoints, ep);
if (!ret)
return NULL;
obj_hold(ret);
return ret;
}
void stream_fd_release(struct stream_fd *sfd) {
void stream_fd_release(stream_fd *sfd) {
if (!sfd)
return;
if (sfd->socket.fd == -1)
@ -3285,7 +3285,7 @@ void stream_fd_release(struct stream_fd *sfd) {
{
RWLOCK_W(&local_media_socket_endpoints_lock);
struct stream_fd *ent = g_hash_table_lookup(local_media_socket_endpoints, &sfd->socket.local);
stream_fd *ent = g_hash_table_lookup(local_media_socket_endpoints, &sfd->socket.local);
if (ent == sfd)
g_hash_table_remove(local_media_socket_endpoints,
&sfd->socket.local); // releases reference
@ -3433,7 +3433,7 @@ enum thread_looper_action kernel_stats_updater(void) {
while (kl) {
ke = kl->data;
kernel2endpoint(&ep, &ke->target.local);
AUTO_CLEANUP(struct stream_fd *sfd, stream_fd_auto_cleanup) = stream_fd_lookup(&ep);
AUTO_CLEANUP(stream_fd *sfd, stream_fd_auto_cleanup) = stream_fd_lookup(&ep);
if (!sfd)
goto next;

@ -338,7 +338,7 @@ static void mqtt_stream_stats_dir(const struct stream_stats *s, JsonBuilder *jso
static void mqtt_stream_stats(struct packet_stream *ps, JsonBuilder *json) {
mutex_lock(&ps->in_lock);
struct stream_fd *sfd = ps->selected_sfd;
stream_fd *sfd = ps->selected_sfd;
if (sfd) {
json_builder_set_member_name(json, "address");
json_builder_add_string_value(json, sockaddr_print_buf(&sfd->socket.local.address));

@ -1382,7 +1382,7 @@ static int redis_sfds(call_t *c, struct redis_list *sfds) {
struct local_intf *loc;
socket_q q = TYPED_GQUEUE_INIT;
unsigned int loc_uid;
struct stream_fd *sfd;
stream_fd *sfd;
socket_t *sock;
int port, fd;
const char *err;
@ -1649,7 +1649,7 @@ static int redis_maps(call_t *c, struct redis_list *maps) {
static int redis_link_sfds(struct redis_list *sfds, struct redis_list *streams) {
unsigned int i;
struct stream_fd *sfd;
stream_fd *sfd;
for (i = 0; i < sfds->len; i++) {
sfd = sfds->ptrs[i];
@ -2371,7 +2371,7 @@ char* redis_encode_json(call_t *c) {
json_builder_end_object(builder);
for (__auto_type l = c->stream_fds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
snprintf(tmp, sizeof(tmp), "sfd-%u", sfd->unique_id);
json_builder_set_member_name(builder, tmp);
@ -2438,7 +2438,7 @@ char* redis_encode_json(call_t *c) {
json_builder_set_member_name(builder, tmp);
json_builder_begin_array(builder);
for (__auto_type k = ps->sfds.head; k; k = k->next) {
struct stream_fd *sfd = k->data;
stream_fd *sfd = k->data;
JSON_ADD_STRING("%u", sfd->unique_id);
}
json_builder_end_array(builder);
@ -2666,7 +2666,7 @@ char* redis_encode_json(call_t *c) {
struct sfd_intf_list *il = m->data;
JSON_ADD_STRING("loc-%u", il->local_intf->unique_id);
for (__auto_type n = il->list.head; n; n = n->next) {
struct stream_fd *sfd = n->data;
stream_fd *sfd = n->data;
JSON_ADD_STRING("%u", sfd->unique_id);
}
}

@ -2241,7 +2241,7 @@ warn:
return 0;
}
static int insert_ice_address(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) {
static int insert_ice_address(GString *s, stream_fd *sfd, sdp_ng_flags *flags) {
char buf[64];
int len;
@ -2256,7 +2256,7 @@ static int insert_ice_address(GString *s, struct stream_fd *sfd, sdp_ng_flags *f
return 0;
}
static int insert_raddr_rport(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) {
static int insert_raddr_rport(GString *s, stream_fd *sfd, sdp_ng_flags *flags) {
char buf[64];
int len;
@ -2618,7 +2618,7 @@ out:
*lprefp = lpref;
}
static void insert_candidate(GString *s, struct stream_fd *sfd,
static void insert_candidate(GString *s, stream_fd *sfd,
unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type,
sdp_ng_flags *flags, struct sdp_media *sdp_media)
{
@ -2652,7 +2652,7 @@ static void insert_sfd_candidates(GString *s, struct packet_stream *ps,
sdp_ng_flags *flags, struct sdp_media *sdp_media)
{
for (__auto_type l = ps->sfds.head; l; l = l->next) {
struct stream_fd *sfd = l->data;
stream_fd *sfd = l->data;
insert_candidate(s, sfd, type_pref, local_pref, type, flags, sdp_media);
if (local_pref != -1)

@ -361,7 +361,7 @@ void ssrc_sender_report(struct call_media *m, const struct ssrc_sender_report *s
mutex_unlock(&e->lock);
obj_put(e);
}
void ssrc_receiver_report(struct call_media *m, struct stream_fd *sfd, const struct ssrc_receiver_report *rr,
void ssrc_receiver_report(struct call_media *m, stream_fd *sfd, const struct ssrc_receiver_report *rr,
const struct timeval *tv)
{
ilog(LOG_DEBUG, "RR from %s%x%s about %s%x%s: FL %u TL %u HSR %u J %u LSR %u DLSR %u",

@ -395,7 +395,7 @@ static void integrity(struct msghdr *mh, struct msg_integrity *mi, str *pwd) {
hdr->msg_len = ntohs(hdr->msg_len);
}
static void stun_error_len(struct stream_fd *sfd, const endpoint_t *sin,
static void stun_error_len(stream_fd *sfd, const endpoint_t *sin,
struct header *req,
int code, char *reason, int len, uint16_t add_attr, void *attr_cont,
int attr_len)
@ -488,7 +488,7 @@ static int check_auth(const str *msg, struct stun_attrs *attrs, struct call_medi
return memcmp(digest, attrs->msg_integrity.s, 20) ? -1 : 0;
}
static int stun_binding_success(struct stream_fd *sfd, struct header *req, struct stun_attrs *attrs,
static int stun_binding_success(stream_fd *sfd, struct header *req, struct stun_attrs *attrs,
const endpoint_t *sin)
{
struct header hdr;
@ -537,7 +537,7 @@ INLINE int uint16_t_arr_len(uint16_t *arr) {
#define SLF " from %s%s%s"
#define SLP FMT_M(endpoint_print_buf(sin))
static int __stun_request(struct stream_fd *sfd, const endpoint_t *sin,
static int __stun_request(stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
int ret;
@ -557,12 +557,12 @@ static int __stun_request(struct stream_fd *sfd, const endpoint_t *sin,
return ret;
}
static int __stun_success(struct stream_fd *sfd, const endpoint_t *sin,
static int __stun_success(stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
return ice_response(sfd, sin, attrs, req->transaction);
}
static int __stun_error(struct stream_fd *sfd, const endpoint_t *sin,
static int __stun_error(stream_fd *sfd, const endpoint_t *sin,
struct header *req, struct stun_attrs *attrs)
{
return ice_response(sfd, sin, attrs, req->transaction);
@ -576,7 +576,7 @@ static int __stun_error(struct stream_fd *sfd, const endpoint_t *sin,
*
* call is locked in R
*/
int stun(const str *b, struct stream_fd *sfd, const endpoint_t *sin) {
int stun(const str *b, stream_fd *sfd, const endpoint_t *sin) {
struct header *req = (void *) b->s;
int msglen, method, class;
str attr_str;

@ -220,7 +220,7 @@ static int t38_gateway_handler(t38_core_state_t *stat, void *user_data, const ui
ps = tg->t38_media->streams.head->data;
if (ps)
mutex_lock(&ps->out_lock);
struct stream_fd *sfd = NULL;
stream_fd *sfd = NULL;
if (ps)
sfd = ps->selected_sfd;
if (sfd && sfd->socket.fd != -1 && ps->endpoint.address.family != NULL) {

@ -386,7 +386,7 @@ struct packet_stream {
struct recording_stream recording; /* LOCK: call->master_lock */
stream_fd_q sfds; /* LOCK: call->master_lock */
struct stream_fd * selected_sfd;
stream_fd * selected_sfd;
endpoint_t last_local_endpoint;
struct dtls_connection ice_dtls; /* LOCK: in_lock */
sink_handler_q rtp_sinks; /* LOCK: call->master_lock, in_lock for streamhandler */

@ -12,6 +12,7 @@
#include "str.h"
#include "obj.h"
#include "socket.h"
#include "types.h"
@ -23,7 +24,6 @@
struct packet_stream;
struct sockaddr_in6;
struct stream_fd;
@ -70,7 +70,7 @@ struct dtls_cert *dtls_cert(void);
void dtls_cert_free(void);
int dtls_connection_init(struct dtls_connection *, struct packet_stream *, int active, struct dtls_cert *cert);
int dtls(struct stream_fd *, const str *s, const endpoint_t *sin);
int dtls(stream_fd *, const str *s, const endpoint_t *sin);
void dtls_connection_cleanup(struct dtls_connection *);
void dtls_shutdown(struct packet_stream *ps);
@ -116,7 +116,7 @@ INLINE int dtls_is_active(const struct dtls_connection *d) {
}
struct dtls_connection *dtls_ptr(struct stream_fd *sfd);
struct dtls_connection *dtls_ptr(stream_fd *sfd);

@ -94,7 +94,7 @@ struct ice_candidate {
struct ice_candidate_pair {
struct ice_candidate *remote_candidate;
const struct local_intf *local_intf;
struct stream_fd *sfd;
stream_fd *sfd;
volatile unsigned int pair_flags;
uint32_t stun_transaction[3]; /* belongs to transaction_hash, thus agent->lock */
unsigned int retransmit_ms;
@ -170,8 +170,8 @@ void ice_remote_candidates(candidate_q *, struct ice_agent *);
void ice_thread_run(void *);
int ice_request(struct stream_fd *, const endpoint_t *, struct stun_attrs *);
int ice_response(struct stream_fd *, const endpoint_t *src,
int ice_request(stream_fd *, const endpoint_t *, struct stun_attrs *);
int ice_response(stream_fd *, const endpoint_t *src,
struct stun_attrs *attrs, void *transaction);
void dequeue_sdp_fragments(struct call_monologue *);

@ -23,11 +23,10 @@ struct transport_protocol;
struct ssrc_ctx;
struct rtpengine_srtp;
struct jb_packet;
struct stream_fd;
struct poller;
struct media_player_cache_entry;
TYPED_GQUEUE(stream_fd, struct stream_fd)
TYPED_GQUEUE(stream_fd, stream_fd)
typedef int rtcp_filter_func(struct media_packet *, GQueue *);
@ -269,7 +268,7 @@ struct media_packet {
endpoint_t fsin; // source address of received packet
struct timeval tv; // timestamp when packet was received
struct stream_fd *sfd; // fd which received the packet
stream_fd *sfd; // fd which received the packet
call_t *call; // sfd->call
struct packet_stream *stream; // sfd->stream
struct call_media *media; // stream->media
@ -307,9 +306,9 @@ int is_local_endpoint(const struct intf_address *addr, unsigned int port);
int __get_consecutive_ports(socket_q *out, unsigned int num_ports, unsigned int wanted_start_port,
struct intf_spec *spec, const str *);
int get_consecutive_ports(socket_intf_list_q *out, unsigned int num_ports, unsigned int num_intfs, struct call_media *media);
struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif);
struct stream_fd *stream_fd_lookup(const endpoint_t *);
void stream_fd_release(struct stream_fd *);
stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif);
stream_fd *stream_fd_lookup(const endpoint_t *);
void stream_fd_release(stream_fd *);
enum thread_looper_action release_closed_sockets(void);
void append_thread_lpr_to_glob_lpr(void);
@ -362,7 +361,7 @@ INLINE int proto_is(const struct transport_protocol *protocol, enum transport_pr
return 0;
return (protocol->index == idx) ? 1 : 0;
}
INLINE void stream_fd_auto_cleanup(struct stream_fd **sp) {
INLINE void stream_fd_auto_cleanup(stream_fd **sp) {
if (!*sp)
return;
obj_put(*sp);

@ -8,6 +8,7 @@
#include "helpers.h"
#include "obj.h"
#include "codeclib.h"
#include "types.h"
@ -18,7 +19,6 @@ struct rtp_payload_type;
struct ssrc_entry;
struct ssrc_entry_call;
enum ssrc_dir;
struct stream_fd;
@ -230,7 +230,7 @@ struct ssrc_ctx *get_ssrc_ctx(uint32_t, struct ssrc_hash *, enum ssrc_dir, void
void ssrc_sender_report(struct call_media *, const struct ssrc_sender_report *, const struct timeval *);
void ssrc_receiver_report(struct call_media *, struct stream_fd *, const struct ssrc_receiver_report *,
void ssrc_receiver_report(struct call_media *, stream_fd *, const struct ssrc_receiver_report *,
const struct timeval *);
void ssrc_receiver_rr_time(struct call_media *m, const struct ssrc_xr_rr_time *rr,
const struct timeval *);

@ -49,7 +49,7 @@ INLINE int is_stun(const str *s) {
}
int stun(const str *, struct stream_fd *, const endpoint_t *);
int stun(const str *, stream_fd *, const endpoint_t *);
int stun_binding_request(const endpoint_t *dst, uint32_t transaction[3], str *pwd,
str ufrags[2], int controlling, uint64_t tiebreaker, uint32_t priority,

@ -7,6 +7,7 @@ typedef struct sdp_ng_flags sdp_ng_flags;
typedef struct stats_metric stats_metric;
typedef struct ng_buffer ng_buffer;
typedef struct call call_t;
typedef struct stream_fd stream_fd;
#include "containers.h"

@ -5,7 +5,6 @@
#include "str.h"
#include "types.h"
struct stream_fd;
struct ice_agent;
struct call_media;
@ -17,7 +16,7 @@ INLINE void log_info_pop_until(void *p) {
}
INLINE void log_info_call(call_t *c) {
}
INLINE void log_info_stream_fd(struct stream_fd *sfd) {
INLINE void log_info_stream_fd(stream_fd *sfd) {
}
INLINE void log_info_str(const str *s) {
}

@ -246,7 +246,7 @@ static void __packet_seq_ts(const char *file, int line, struct call_media *media
// from media_packet_rtp()
struct local_intf lif = { };
struct stream_fd sfd = {
stream_fd sfd = {
.local_intf = &lif,
};
struct media_packet mp = {

Loading…
Cancel
Save