68 path,
sizeof(path), uri);
73 ff_url_join(buf,
sizeof(buf),
"udp",
NULL, hostname, port + 1,
"%s", path);
100 const char *hostname,
int port,
101 int local_port,
int ttl,
102 int max_packet_size,
int connect)
106 url_add_option(buf, buf_size,
"localport=%d", local_port);
108 url_add_option(buf, buf_size,
"ttl=%d", ttl);
109 if (max_packet_size >=0)
110 url_add_option(buf, buf_size,
"pkt_size=%d", max_packet_size);
112 url_add_option(buf, buf_size,
"connect=1");
113 url_add_option(buf, buf_size,
"fifo_size=0");
136 int rtp_port, rtcp_port,
138 local_rtp_port, local_rtcp_port, max_packet_size;
145 path,
sizeof(path), uri);
148 rtcp_port = rtp_port+1;
150 local_rtcp_port = -1;
151 max_packet_size = -1;
154 p = strchr(uri,
'?');
157 ttl = strtol(buf,
NULL, 10);
160 rtcp_port = strtol(buf,
NULL, 10);
163 local_rtp_port = strtol(buf,
NULL, 10);
166 local_rtp_port = strtol(buf,
NULL, 10);
169 local_rtcp_port = strtol(buf,
NULL, 10);
172 max_packet_size = strtol(buf,
NULL, 10);
175 connect = strtol(buf,
NULL, 10);
180 hostname, rtp_port, local_rtp_port, ttl, max_packet_size,
184 if (local_rtp_port>=0 && local_rtcp_port<0)
188 hostname, rtcp_port, local_rtcp_port, ttl, max_packet_size,
216 struct pollfd p[2] = {{s->
rtp_fd, POLLIN, 0}, {s->
rtcp_fd, POLLIN, 0}};
225 if (p[1].revents & POLLIN) {
226 from_len =
sizeof(
from);
227 len = recvfrom (s->
rtcp_fd, buf, size, 0,
228 (
struct sockaddr *)&from, &from_len);
238 if (p[0].revents & POLLIN) {
239 from_len =
sizeof(
from);
240 len = recvfrom (s->
rtp_fd, buf, size, 0,
241 (
struct sockaddr *)&from, &from_len);
320 int *hs = *handles =
av_malloc(
sizeof(**handles) * 2);