Go to the documentation of this file.
22 #include "config_components.h"
58 #define READ_PACKET_TIMEOUT_S 10
59 #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
60 #define DEFAULT_REORDERING_DELAY 100000
62 #define OFFSET(x) offsetof(RTSPState, x)
63 #define DEC AV_OPT_FLAG_DECODING_PARAM
64 #define ENC AV_OPT_FLAG_ENCODING_PARAM
66 #define RTSP_FLAG_OPTS(name, longname) \
67 { name, longname, OFFSET(rtsp_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtsp_flags" }, \
68 { "filter_src", "only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }
70 #define RTSP_MEDIATYPE_OPTS(name, longname) \
71 { name, longname, OFFSET(media_type_mask), AV_OPT_TYPE_FLAGS, { .i64 = (1 << (AVMEDIA_TYPE_SUBTITLE+1)) - 1 }, INT_MIN, INT_MAX, DEC, "allowed_media_types" }, \
72 { "video", "Video", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_VIDEO}, 0, 0, DEC, "allowed_media_types" }, \
73 { "audio", "Audio", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_AUDIO}, 0, 0, DEC, "allowed_media_types" }, \
74 { "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }, \
75 { "subtitle", "Subtitle", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_SUBTITLE}, 0, 0, DEC, "allowed_media_types" }
77 #define COMMON_OPTS() \
78 { "reorder_queue_size", "set number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }, \
79 { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \
80 { "pkt_size", "Underlying protocol send packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = 1472 }, -1, INT_MAX, ENC } \
84 {
"initial_pause",
"do not start playing the stream immediately",
OFFSET(initial_pause),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
DEC },
86 {
"rtsp_transport",
"set RTSP transport protocols",
OFFSET(lower_transport_mask),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
DEC|
ENC,
"rtsp_transport" }, \
94 {
"prefer_tcp",
"try RTP via TCP first, if available", 0,
AV_OPT_TYPE_CONST, {.i64 =
RTSP_FLAG_PREFER_TCP}, 0, 0,
DEC|
ENC,
"rtsp_flags" },
99 {
"listen_timeout",
"set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen)",
OFFSET(initial_timeout),
AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX,
DEC },
100 {
"timeout",
"set timeout (in microseconds) of socket I/O operations",
OFFSET(stimeout),
AV_OPT_TYPE_INT64, {.i64 = 0}, INT_MIN, INT64_MAX,
DEC },
112 RTSP_MEDIATYPE_OPTS(
"allowed_media_types",
"set media types to accept from the server"),
121 RTSP_MEDIATYPE_OPTS(
"allowed_media_types",
"set media types to accept from the server"),
140 const char *sep,
const char **pp)
148 while (!strchr(sep, *p) && *p !=
'\0') {
149 if ((q - buf) < buf_size - 1)
161 if (**pp ==
'/') (*pp)++;
165 static void get_word(
char *buf,
int buf_size,
const char **pp)
209 memcpy(sock, ai->ai_addr,
FFMIN(
sizeof(*sock), ai->ai_addrlen));
252 #if CONFIG_RTSP_DEMUXER
277 finalize_rtp_handler_init(
s, rtsp_st,
NULL);
286 int payload_type,
const char *p)
308 init_rtp_handler(
handler, rtsp_st, st);
351 finalize_rtp_handler_init(
s, rtsp_st, st);
359 char *
value,
int value_size)
374 typedef struct SDPParseState {
379 int nb_default_include_source_addrs;
380 struct RTSPSource **default_include_source_addrs;
381 int nb_default_exclude_source_addrs;
382 struct RTSPSource **default_exclude_source_addrs;
385 char delayed_fmtp[2048];
388 static void copy_default_source_addrs(
struct RTSPSource **addrs,
int count,
393 for (
i = 0;
i < count;
i++) {
395 rtsp_src2 =
av_memdup(rtsp_src,
sizeof(*rtsp_src));
403 int payload_type,
const char *
line)
419 int letter,
const char *buf)
422 char buf1[64], st_type[64];
435 if (
s1->skip_media && letter !=
'm')
440 if (strcmp(buf1,
"IN") != 0)
443 if (strcmp(buf1,
"IP4") && strcmp(buf1,
"IP6"))
454 if (
s->nb_streams == 0) {
455 s1->default_ip = sdp_ip;
456 s1->default_ttl = ttl;
467 if (
s->nb_streams == 0) {
478 get_word(st_type,
sizeof(st_type), &p);
479 if (!strcmp(st_type,
"audio")) {
481 }
else if (!strcmp(st_type,
"video")) {
483 }
else if (!strcmp(st_type,
"application")) {
485 }
else if (!strcmp(st_type,
"text")) {
504 copy_default_source_addrs(
s1->default_include_source_addrs,
505 s1->nb_default_include_source_addrs,
508 copy_default_source_addrs(
s1->default_exclude_source_addrs,
509 s1->nb_default_exclude_source_addrs,
517 if (!strcmp(buf1,
"udp"))
519 else if (strstr(buf1,
"/AVPF") || strstr(buf1,
"/SAVPF"))
529 if (CONFIG_RTPDEC && !rt->
ts)
536 finalize_rtp_handler_init(
s, rtsp_st,
NULL);
559 init_rtp_handler(
handler, rtsp_st, st);
560 finalize_rtp_handler_init(
s, rtsp_st, st);
572 if (!strncmp(p,
"rtsp://", 7))
583 if (proto[0] ==
'\0') {
594 }
else if (
av_strstart(p,
"rtpmap:", &p) &&
s->nb_streams > 0) {
597 payload_type = atoi(buf1);
601 sdp_parse_rtpmap(
s, st, rtsp_st, payload_type, p);
611 payload_type = atoi(buf1);
612 if (
s1->seen_rtpmap) {
618 }
else if (
av_strstart(p,
"ssrc:", &p) &&
s->nb_streams > 0) {
621 rtsp_st->
ssrc = strtoll(buf1,
NULL, 10);
627 s->start_time = start;
632 if (
s->nb_streams > 0) {
641 }
else if (
av_strstart(p,
"IsRealDataType:integer;",&p)) {
644 }
else if (
av_strstart(p,
"SampleRate:integer;", &p) &&
646 st =
s->streams[
s->nb_streams - 1];
648 }
else if (
av_strstart(p,
"crypto:", &p) &&
s->nb_streams > 0) {
659 if (strcmp(buf1,
"incl") && strcmp(buf1,
"excl"))
661 exclude = !strcmp(buf1,
"excl");
664 if (strcmp(buf1,
"IN") != 0)
667 if (strcmp(buf1,
"IP4") && strcmp(buf1,
"IP6") && strcmp(buf1,
"*"))
678 if (
s->nb_streams == 0) {
679 dynarray_add(&
s1->default_exclude_source_addrs, &
s1->nb_default_exclude_source_addrs, rtsp_src);
685 if (
s->nb_streams == 0) {
686 dynarray_add(&
s1->default_include_source_addrs, &
s1->nb_default_include_source_addrs, rtsp_src);
696 if (
s->nb_streams > 0) {
718 SDPParseState sdp_parse_state = { { 0 } }, *
s1 = &sdp_parse_state;
732 while (*p !=
'\n' && *p !=
'\r' && *p !=
'\0') {
733 if ((q - buf) <
sizeof(buf) - 1)
738 sdp_parse_line(
s,
s1, letter, buf);
740 while (*p !=
'\n' && *p !=
'\0')
746 for (
i = 0;
i <
s1->nb_default_include_source_addrs;
i++)
749 for (
i = 0;
i <
s1->nb_default_exclude_source_addrs;
i++)
771 if (CONFIG_RTSP_MUXER && rtpctx->
pb && send_packets)
819 if (CONFIG_RTPDEC && rt->
ts)
830 if (reordering_queue_size < 0) {
832 reordering_queue_size = 0;
843 if (CONFIG_RTSP_MUXER &&
s->oformat && st) {
859 else if (CONFIG_RTPDEC)
862 reordering_queue_size);
884 #if CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER
885 static void rtsp_parse_range(
int *min_ptr,
int *max_ptr,
const char **pp)
893 v = strtol(q, &p, 10);
897 v = strtol(p, &p, 10);
910 char transport_protocol[16];
912 char lower_transport[16];
926 get_word_sep(transport_protocol,
sizeof(transport_protocol),
930 lower_transport[0] =
'\0';
937 }
else if (!
av_strcasecmp (transport_protocol,
"x-pn-tng") ||
940 get_word_sep(lower_transport,
sizeof(lower_transport),
"/;,", &p);
945 lower_transport[0] =
'\0';
963 while (*p !=
'\0' && *p !=
',') {
965 if (!strcmp(parameter,
"port")) {
968 rtsp_parse_range(&
th->port_min, &
th->port_max, &p);
970 }
else if (!strcmp(parameter,
"client_port")) {
973 rtsp_parse_range(&
th->client_port_min,
974 &
th->client_port_max, &p);
976 }
else if (!strcmp(parameter,
"server_port")) {
979 rtsp_parse_range(&
th->server_port_min,
980 &
th->server_port_max, &p);
982 }
else if (!strcmp(parameter,
"interleaved")) {
985 rtsp_parse_range(&
th->interleaved_min,
986 &
th->interleaved_max, &p);
988 }
else if (!strcmp(parameter,
"multicast")) {
991 }
else if (!strcmp(parameter,
"ttl")) {
995 th->ttl = strtol(p, &end, 10);
998 }
else if (!strcmp(parameter,
"destination")) {
1004 }
else if (!strcmp(parameter,
"source")) {
1010 }
else if (!strcmp(parameter,
"mode")) {
1014 if (!strcmp(buf,
"record") ||
1015 !strcmp(buf,
"receive"))
1016 th->mode_record = 1;
1020 while (*p !=
';' && *p !=
'\0' && *p !=
',')
1034 static void handle_rtp_info(
RTSPState *rt,
const char *url,
1035 uint32_t seq, uint32_t rtptime)
1038 if (!rtptime || !url[0])
1054 static void rtsp_parse_rtp_info(
RTSPState *rt,
const char *p)
1058 uint32_t seq = 0, rtptime = 0;
1070 if (!strcmp(
key,
"url"))
1072 else if (!strcmp(
key,
"seq"))
1074 else if (!strcmp(
key,
"rtptime"))
1077 handle_rtp_info(rt, url, seq, rtptime);
1086 handle_rtp_info(rt, url, seq, rtptime);
1101 (t = strtol(p,
NULL, 10)) > 0) {
1107 rtsp_parse_transport(
s, reply, p);
1109 reply->
seq = strtol(p,
NULL, 10);
1124 }
else if (
av_stristart(p,
"WWW-Authenticate:", &p) && rt) {
1127 }
else if (
av_stristart(p,
"Authentication-Info:", &p) && rt) {
1130 }
else if (
av_stristart(p,
"Content-Base:", &p) && rt) {
1132 if (method && !strcmp(method,
"DESCRIBE"))
1136 if (method && !strcmp(method,
"PLAY"))
1137 rtsp_parse_rtp_info(rt, p);
1139 if (strstr(p,
"GET_PARAMETER") &&
1140 method && !strcmp(method,
"OPTIONS"))
1142 }
else if (
av_stristart(p,
"x-Accept-Dynamic-Rate:", &p) && rt) {
1171 if (len1 >
sizeof(buf))
1183 unsigned char **content_ptr,
1184 int return_on_interleaved_data,
const char *method)
1190 int ret, content_length, line_count, request;
1191 unsigned char *content;
1197 memset(reply, 0,
sizeof(*reply));
1210 if (ch ==
'$' && q == buf) {
1211 if (return_on_interleaved_data) {
1218 }
else if (ch !=
'\r') {
1219 if ((q - buf) <
sizeof(buf) - 1)
1231 if (line_count == 0) {
1234 if (!strncmp(buf1,
"RTSP/", 5)) {
1255 if (content_length > 0) {
1257 content =
av_malloc(content_length + 1);
1264 content[content_length] =
'\0';
1267 *content_ptr = content;
1274 const char* ptr = buf;
1276 if (!strcmp(reply->
reason,
"OPTIONS") ||
1277 !strcmp(reply->
reason,
"GET_PARAMETER")) {
1278 snprintf(buf,
sizeof(buf),
"RTSP/1.0 200 OK\r\n");
1285 snprintf(buf,
sizeof(buf),
"RTSP/1.0 501 Not Implemented\r\n");
1310 if (rt->
seq != reply->
seq) {
1316 if (reply->
notice == 2101 ||
1318 reply->
notice == 2306 ) {
1320 }
else if (reply->
notice >= 4400 && reply->
notice < 5500) {
1322 }
else if (reply->
notice == 2401 ||
1343 const char *method,
const char *url,
1345 const unsigned char *send_content,
1346 int send_content_length)
1358 snprintf(buf,
sizeof(buf),
"%s %s RTSP/1.0\r\n", method, url);
1364 !strstr(
headers,
"\nIf-Match:"))) {
1369 rt->
auth, url, method);
1374 if (send_content_length > 0 && send_content)
1375 av_strlcatf(buf,
sizeof(buf),
"Content-Length: %d\r\n", send_content_length);
1381 out_buf = base64buf;
1387 if (send_content_length > 0 && send_content) {
1400 const char *url,
const char *
headers)
1402 return rtsp_send_cmd_with_content_async(
s, method, url,
headers,
NULL, 0);
1407 unsigned char **content_ptr)
1410 content_ptr,
NULL, 0);
1414 const char *method,
const char *url,
1417 unsigned char **content_ptr,
1418 const unsigned char *send_content,
1419 int send_content_length)
1423 int ret, attempts = 0;
1427 if ((
ret = rtsp_send_cmd_with_content_async(
s, method, url,
header,
1429 send_content_length)))
1453 int lower_transport,
const char *real_challenge)
1456 int rtx = 0, j,
i, err,
interleave = 0, port_off = 0;
1460 const char *trans_pref;
1463 trans_pref =
"x-pn-tng";
1465 trans_pref =
"RAW/RAW";
1467 trans_pref =
"RTP/AVP";
1478 port_off -= port_off & 0x01;
1481 for (j = rt->
rtp_port_min + port_off,
i = 0; i < rt->nb_rtsp_streams; ++
i) {
1522 "?localport=%d", j);
1526 &
s->interrupt_callback, &
opts,
s->protocol_whitelist,
s->protocol_blacklist,
NULL);
1540 av_strlcpy(transport, trans_pref,
sizeof(transport));
1545 av_strlcat(transport,
"unicast;",
sizeof(transport));
1547 "client_port=%d", port);
1550 av_strlcatf(transport,
sizeof(transport),
"-%d", port + 1);
1563 snprintf(transport,
sizeof(transport) - 1,
1564 "%s/TCP;", trans_pref);
1566 av_strlcat(transport,
"unicast;",
sizeof(transport));
1568 "interleaved=%d-%d",
1574 snprintf(transport,
sizeof(transport) - 1,
1575 "%s/UDP;multicast", trans_pref);
1578 av_strlcat(transport,
";mode=record",
sizeof(transport));
1581 av_strlcat(transport,
";mode=play",
sizeof(transport));
1583 "Transport: %s\r\n",
1586 av_strlcat(cmd,
"x-Dynamic-Rate: 0\r\n",
sizeof(cmd));
1588 char real_res[41], real_csum[9];
1593 "RealChallenge2: %s, sd=%s\r\n",
1607 char proto[128], host[128], path[512], auth[128];
1609 av_url_split(proto,
sizeof(proto), auth,
sizeof(auth), host,
sizeof(host),
1643 const char *peer = host;
1675 snprintf(optbuf,
sizeof(optbuf),
"?ttl=%d", ttl);
1676 getnameinfo((
struct sockaddr*) &addr,
sizeof(addr),
1679 port,
"%s", optbuf);
1681 &
s->interrupt_callback, &
opts,
s->protocol_whitelist,
s->protocol_blacklist,
NULL);
1721 char proto[128], host[1024], path[1024];
1723 const char *lower_rtsp_proto =
"tcp";
1724 int port, err, tcp_fd;
1726 int lower_transport_mask = 0;
1728 int https_tunnel = 0;
1729 char real_challenge[64] =
"";
1731 socklen_t peer_len =
sizeof(peer);
1743 if (
s->max_delay < 0)
1757 memset(&reply1, 0,
sizeof(reply1));
1760 host,
sizeof(host), &port, path,
sizeof(path),
s->url);
1762 if (!strcmp(proto,
"rtsps")) {
1763 lower_rtsp_proto =
"tls";
1766 }
else if (!strcmp(proto,
"satip")) {
1775 port = default_port;
1779 if (!lower_transport_mask)
1788 "only UDP and TCP are supported for output.\n");
1798 host, port,
"%s", path);
1802 char httpname[1024];
1803 char sessioncookie[17];
1809 ff_url_join(httpname,
sizeof(httpname), https_tunnel ?
"https" :
"http", auth, host, port,
"%s", path);
1810 snprintf(sessioncookie,
sizeof(sessioncookie),
"%08x%08x",
1815 &
s->interrupt_callback) < 0) {
1822 "x-sessioncookie: %s\r\n"
1823 "Accept: application/x-rtsp-tunnelled\r\n"
1824 "Pragma: no-cache\r\n"
1825 "Cache-Control: no-cache\r\n",
1846 &
s->interrupt_callback) < 0 ) {
1853 "x-sessioncookie: %s\r\n"
1854 "Content-Type: application/x-rtsp-tunnelled\r\n"
1855 "Pragma: no-cache\r\n"
1856 "Cache-Control: no-cache\r\n"
1857 "Content-Length: 32767\r\n"
1858 "Expires: Sun, 9 Jan 1972 00:00:00 GMT\r\n",
1896 &
s->interrupt_callback,
NULL,
s->protocol_whitelist,
s->protocol_blacklist,
NULL)) < 0) {
1909 if (!getpeername(tcp_fd, (
struct sockaddr*) &peer, &peer_len)) {
1910 getnameinfo((
struct sockaddr*) &peer, peer_len, host,
sizeof(host),
1931 "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"
1932 "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n"
1933 "CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n"
1934 "GUID: 00000000-0000-0000-0000-000000000000\r\n",
1953 #if CONFIG_RTSP_DEMUXER
1956 err = init_satip_stream(
s);
1961 if (CONFIG_RTSP_MUXER)
1969 int lower_transport =
ff_log2_tab[lower_transport_mask &
1970 ~(lower_transport_mask - 1)];
1978 real_challenge :
NULL);
1981 lower_transport_mask &= ~(1 << lower_transport);
1982 if (lower_transport_mask == 0 && err == 1) {
1983 err =
AVERROR(EPROTONOSUPPORT);
2016 #if CONFIG_RTSP_DEMUXER
2042 uint8_t *buf,
int buf_size, int64_t wait_end)
2047 struct pollfd *p = rt->
p;
2048 int *fds =
NULL, fdsnum, fdsidx;
2058 p[rt->
max_p++].events = POLLIN;
2070 "Number of fds %d not supported\n", fdsnum);
2073 for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) {
2074 p[rt->
max_p].fd = fds[fdsidx];
2075 p[rt->
max_p++].events = POLLIN;
2093 if (p[j].revents & POLLIN || p[j+1].revents & POLLIN) {
2096 *prtsp_st = rtsp_st;
2103 #if CONFIG_RTSP_DEMUXER
2104 if (rt->
rtsp_hd && p[0].revents & POLLIN) {
2105 if ((
ret = parse_rtsp_message(
s)) < 0) {
2110 }
else if (n == 0 && rt->
stimeout > 0 && --runs <= 0) {
2112 }
else if (n < 0 && errno != EINTR)
2118 const uint8_t *buf,
int len)
2144 "Unable to pick stream for packet - SSRC not known for "
2170 #if CONFIG_RTSP_DEMUXER
2204 int64_t wait_end = 0;
2215 }
else if (CONFIG_RTPDEC && rt->
ts) {
2226 }
else if (
ret == 1) {
2235 int64_t first_queue_time = 0;
2242 if (queue_time && (queue_time - first_queue_time < 0 ||
2243 !first_queue_time)) {
2244 first_queue_time = queue_time;
2248 if (first_queue_time) {
2249 wait_end = first_queue_time +
s->max_delay;
2252 first_queue_st =
NULL;
2264 if (
len ==
AVERROR(EAGAIN) && first_queue_st &&
2267 "max delay reached. need to consume packet\n");
2268 rtsp_st = first_queue_st;
2303 if (rtpctx2 && st && st2 &&
2315 s->start_time_realtime -=
2330 }
else if (CONFIG_RTPDEC && rt->
ts) {
2356 #if CONFIG_SDP_DEMUXER
2362 while (p < p_end && *p !=
'\0') {
2363 if (
sizeof(
"c=IN IP") - 1 < p_end - p &&
2367 while (p < p_end - 1 && *p !=
'\n') p++;
2376 static void append_source_addrs(
char *buf,
int size,
const char *
name,
2383 for (
i = 1;
i < count;
i++)
2398 if (
s->max_delay < 0)
2436 "?localport=%d&ttl=%d&connect=%d&write_to_source=%d",
2441 p = strchr(
s->url,
'?');
2443 av_strlcatf(url,
sizeof(url),
"&localaddr=%s", buf);
2446 append_source_addrs(url,
sizeof(url),
"sources",
2449 append_source_addrs(url,
sizeof(url),
"block",
2453 &
s->interrupt_callback, &
opts,
s->protocol_whitelist,
s->protocol_blacklist,
NULL);
2479 static const AVClass sdp_demuxer_class = {
2494 .priv_class = &sdp_demuxer_class,
2498 #if CONFIG_RTP_DEMUXER
2509 char host[500], filters_buf[1000];
2516 socklen_t addrlen =
sizeof(addr);
2527 &
s->interrupt_callback, &
opts,
s->protocol_whitelist,
s->protocol_blacklist,
NULL);
2543 if ((recvbuf[0] & 0xc0) != 0x80) {
2552 payload_type = recvbuf[1] & 0x7f;
2566 "without an SDP file describing it\n",
2573 "properly you need an SDP file "
2582 addr.ss_family == AF_INET ? 4 : 6, host);
2584 p = strchr(
s->url,
'?');
2586 static const char filters[][2][8] = { {
"sources",
"incl" },
2587 {
"block",
"excl" } };
2593 while ((q = strchr(q,
',')) !=
NULL)
2595 av_bprintf(&sdp,
"a=source-filter:%s IN IP%d %s %s\r\n",
2597 addr.ss_family == AF_INET ? 4 : 6, host,
2606 port, payload_type);
2622 ret = sdp_read_header(
s);
2638 static const AVClass rtp_demuxer_class = {
2654 .priv_class = &rtp_demuxer_class,
int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, unsigned char **content_ptr, int return_on_interleaved_data, const char *method)
Read a RTSP message from the server, or prepare to read data packets if we're reading data interleave...
int64_t last_cmd_time
timestamp of the last RTSP command that we sent to the RTSP server.
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_BPRINT_SIZE_UNLIMITED
void ff_rtsp_close_streams(AVFormatContext *s)
Close and free all streams within the RTSP (de)muxer.
int(* init)(AVFormatContext *s, int st_index, PayloadContext *priv_data)
Initialize dynamic protocol handler, called after the full rtpmap line is parsed, may be null.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)
Attempt to find a specific tag in a URL.
void * transport_priv
RTP/RDT parse context if input, RTP AVFormatContext if output.
enum AVMediaType codec_type
General type of the encoded data.
int ff_rtsp_send_cmd_with_content(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr, const unsigned char *send_content, int send_content_length)
Send a command to the RTSP server and wait for the reply.
int(* parse_sdp_a_line)(AVFormatContext *s, int st_index, PayloadContext *priv_data, const char *line)
Parse the a= line from the sdp field.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
URLContext * rtp_handle
RTP stream handle (if UDP)
enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type)
Return the codec id for the given encoding name and codec type.
int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd, AVIOContext *avio)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
@ RTSP_SERVER_RTP
Standards-compliant RTP-server.
This struct describes the properties of an encoded stream.
int ff_rtsp_send_cmd(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr)
Send a command to the RTSP server and wait for the reply.
enum RTSPControlTransport control_transport
RTSP transport mode, such as plain or tunneled.
#define AVERROR_EOF
End of file.
int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len)
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
@ RTSP_MODE_PLAIN
Normal RTSP.
static int parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value)
@ RTSP_TRANSPORT_RTP
Standards-compliant RTP.
char source[INET6_ADDRSTRLEN+1]
source IP address
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static const AVOption sdp_options[]
int get_parameter_supported
Whether the server supports the GET_PARAMETER method.
static int ff_rtsp_averror(enum RTSPStatusCode status_code, int default_averror)
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define RTSP_DEFAULT_AUDIO_SAMPLERATE
int nb_include_source_addrs
Number of source-specific multicast include source IP addresses (from SDP content)
int server_port_min
UDP unicast server port range; the ports to which we should connect to receive unicast UDP RTP/RTCP d...
char auth[128]
plaintext authorization line (username:password)
int interleaved_min
interleave IDs; copies of RTSPTransportField->interleaved_min/max for the selected transport.
static const AVOption rtp_options[]
#define RTSP_RTP_PORT_MIN
enum RTSPLowerTransport lower_transport
network layer transport protocol; e.g.
int rtp_port_min
Minimum and maximum local UDP ports.
@ RTSP_LOWER_TRANSPORT_CUSTOM
Custom IO - not a public option for lower_transport_mask, but set in the SDP demuxer based on a flag.
#define AV_CHANNEL_LAYOUT_MONO
void avcodec_parameters_free(AVCodecParameters **ppar)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
int interleaved_min
interleave ids, if TCP transport; each TCP/RTSP data packet starts with a '$', stream length and stre...
Describe a single stream, as identified by a single m= line block in the SDP content.
#define AV_LOG_VERBOSE
Detailed information.
int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method, const char *url, const char *headers)
Send a command to the RTSP server without waiting for the reply.
char real_challenge[64]
the "RealChallenge1:" field from the server
void ff_rdt_calc_response_and_checksum(char response[41], char chksum[9], const char *challenge)
Calculate the response (RealChallenge2 in the RTSP header) to the challenge (RealChallenge1 in the RT...
int buf_size
Size of buf except extra allocated bytes.
void ff_network_close(void)
@ RTSP_SERVER_REAL
Realmedia-style server.
char * ff_http_auth_create_response(HTTPAuthState *state, const char *auth, const char *path, const char *method)
int nb_channels
Number of channels in this layout.
int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, AVIOContext *avio, int count)
some rtp servers assume client is dead if they don't hear from them...
enum AVMediaType codec_type
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
int64_t seek_timestamp
the seek value requested when calling av_seek_frame().
int ff_network_init(void)
int ff_sdp_parse(AVFormatContext *s, const char *content)
Parse an SDP description of streams by populating an RTSPState struct within the AVFormatContext; als...
#define FF_RTP_FLAG_OPTS(ctx, fieldname)
static AVDictionary * map_to_opts(RTSPState *rt)
int feedback
Enable sending RTCP feedback messages according to RFC 4585.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
AVFormatContext * asf_ctx
The following are used for RTP/ASF streams.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
#define RTSP_FLAG_SATIP_RAW
Export SAT>IP stream as raw MPEG-TS.
int ff_rtp_get_local_rtp_port(URLContext *h)
Return the local rtp port used by the RTP connection.
int ff_rtp_set_remote_url(URLContext *h, const char *uri)
If no filename is given to av_open_input_file because you want to get the local port first,...
int nb_rtsp_streams
number of items in the 'rtsp_streams' variable
int ffurl_connect(URLContext *uc, AVDictionary **options)
Connect an URLContext that has been allocated by ffurl_alloc.
static av_cold int read_close(AVFormatContext *ctx)
int ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt, uint8_t **bufptr, int len)
Parse RDT-style packet data (header + media data).
static void get_word(char *buf, int buf_size, const char **pp)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
void(* close)(PayloadContext *protocol_data)
Free any data needed by the rtp parsing for this dynamic data.
void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, const char *params)
@ RTSP_TRANSPORT_RDT
Realmedia Data Transport.
int ff_check_interrupt(AVIOInterruptCB *cb)
Check if the user has requested to interrupt a blocking function associated with cb.
@ RTSP_STATE_STREAMING
initialized and sending/receiving data
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
Get the description of the stream and set up the RTSPStream child objects.
int lower_transport_mask
A mask with all requested transport methods.
@ RTSP_MODE_TUNNEL
RTSP over HTTP (tunneling)
int stream_index
corresponding stream index, if any.
struct sockaddr_storage destination
destination IP address
void ff_rdt_parse_close(RDTDemuxContext *s)
@ RTSP_LOWER_TRANSPORT_HTTPS
HTTPS tunneled.
URLContext * rtsp_hd_out
Additional output handle, used when input and output are done separately, eg for HTTP tunneling.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
void avpriv_mpegts_parse_close(MpegTSContext *ts)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
#define RTSP_FLAG_LISTEN
Wait for incoming connections.
int reordering_queue_size
Size of RTP packet reordering queue.
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
struct MpegTSContext * ts
The following are used for parsing raw mpegts in udp.
This struct describes the properties of a single codec described by an AVCodecID.
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size)
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
struct pollfd * p
Polling array for udp.
char control_uri[MAX_URL_SIZE]
some MS RTSP streams contain a URL in the SDP that we need to use for all subsequent RTSP requests,...
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
#define filters(fmt, type, inverse, clp, inverset, clip, one, clip_fn, packed)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AVIO_FLAG_WRITE
write-only
void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
Undo the effect of ff_rtsp_make_setup_request, close the transport_priv and rtp_handle fields.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
Open RTSP transport context.
int ttl
time-to-live value (required for multicast); the amount of HOPs that packets will be allowed to make ...
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
Receive one packet from the RTSPStreams set up in the AVFormatContext (which should contain a RTSPSta...
const RTPDynamicProtocolHandler * dynamic_handler
The following are used for dynamic protocols (rtpdec_*.c/rdt.c)
int av_stristart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str independent of case.
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
#define RTSP_FLAG_OPTS(name, longname)
const RTPDynamicProtocolHandler * ff_rtp_handler_find_by_id(int id, enum AVMediaType codec_type)
Find a registered rtp dynamic protocol handler with a matching codec ID.
static void handler(vbi_event *ev, void *user_data)
#define RTP_REORDER_QUEUE_DEFAULT_SIZE
void ff_http_auth_handle_header(HTTPAuthState *state, const char *key, const char *value)
enum AVStreamParseType need_parsing
int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
Announce the stream to the server and set up the RTSPStream child objects for each media stream.
#define RTSP_MEDIATYPE_OPTS(name, longname)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
char session_id[512]
copy of RTSPMessageHeader->session_id, i.e.
#define LIBAVUTIL_VERSION_INT
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
const char * protocol_whitelist
int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s)
void ff_http_init_auth_state(URLContext *dest, const URLContext *src)
Initialize the authentication state based on another HTTP URLContext.
const char * av_default_item_name(void *ptr)
Return the context name.
AVIOContext * pb
I/O context.
static void get_word_sep(char *buf, int buf_size, const char *sep, const char **pp)
This structure contains the data a format has to probe a file.
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
@ AV_CODEC_ID_MPEG2TS
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
#define RTSP_MAX_TRANSPORTS
int av_parse_time(int64_t *timeval, const char *timestr, int duration)
Parse timestr and return in *time a corresponding number of microseconds.
enum RTSPClientState state
indicator of whether we are currently receiving data from the server.
uint8_t * recvbuf
Reusable buffer for receiving packets.
#define RTSP_FLAG_PREFER_TCP
Try RTP via TCP first if possible.
AVChannelLayout ch_layout
Audio only.
int sdp_port
The following are used only in SDP, not RTSP.
struct RTSPSource ** exclude_source_addrs
Source-specific multicast exclude source IP addresses (from SDP content)
int sample_rate
Audio only.
const uint8_t ff_log2_tab[256]
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
static int get_sockaddr(AVFormatContext *s, const char *buf, struct sockaddr_storage *sock)
void ff_rtp_parse_close(RTPDemuxContext *s)
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
static void interleave(uint8_t *dst, uint8_t *src, int w, int h, int dst_linesize, int src_linesize, enum FilterMode mode, int swap)
#define RTP_PT_IS_RTCP(x)
const OptionDef options[]
RTPDemuxContext * ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, int queue_size)
open a new RTP parse context for stream 'st'.
PayloadContext * dynamic_protocol_context
private data associated with the dynamic protocol
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size)
Receive one RTP packet from an TCP interleaved RTSP stream.
An AVChannelLayout holds information about the channel layout of audio data.
int rtsp_flags
Various option flags for the RTSP muxer/demuxer.
int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles)
Return the file descriptors associated with this URL.
const AVOption ff_rtsp_options[]
void ff_rtsp_close_connections(AVFormatContext *s)
Close all connection handles within the RTSP (de)muxer.
Private data for the RTSP demuxer.
struct RTSPSource ** include_source_addrs
Source-specific multicast include source IP addresses (from SDP content)
enum RTSPLowerTransport lower_transport
the negotiated network layer transport protocol; e.g.
char last_reply[2048]
The last reply of the server to a RTSP command.
enum RTSPTransport transport
data/packet transport protocol; e.g.
uint64_t first_rtcp_ntp_time
struct RTSPStream ** rtsp_streams
streams in this session
#define AV_NOPTS_VALUE
Undefined timestamp value.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int ff_rtsp_skip_packet(AVFormatContext *s)
Skip a RTP/TCP interleaved packet.
int seq
RTSP command sequence number.
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
static const uint8_t header[24]
HTTPAuthState auth_state
authentication state
int ff_rtp_get_codec_info(AVCodecParameters *par, int payload_type)
Initialize a codec context based on the payload type.
const RTPDynamicProtocolHandler * ff_rtp_handler_find_by_name(const char *name, enum AVMediaType codec_type)
Find a registered rtp dynamic protocol handler with the specified name.
RDTDemuxContext * ff_rdt_parse_open(AVFormatContext *ic, int first_stream_of_set_idx, void *priv_data, const RTPDynamicProtocolHandler *handler)
Allocate and init the RDT parsing context.
#define READ_PACKET_TIMEOUT_S
void ff_rtsp_parse_line(AVFormatContext *s, RTSPMessageHeader *reply, const char *buf, RTSPState *rt, const char *method)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
int nb_exclude_source_addrs
Number of source-specific multicast exclude source IP addresses (from SDP content)
void ff_real_parse_sdp_a_line(AVFormatContext *s, int stream_index, const char *line)
Parse a server-related SDP line.
int timeout
copy of RTSPMessageHeader->timeout, i.e.
#define AV_LOG_INFO
Standard information.
#define DEFAULT_REORDERING_DELAY
int ffurl_alloc(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb)
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connectio...
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
@ RTSP_SERVER_SATIP
SAT>IP server.
@ HTTP_AUTH_NONE
No authentication specified.
#define AV_BASE64_SIZE(x)
Calculate the output size needed to base64-encode x bytes to a null-terminated string.
int media_type_mask
Mask of all requested media types.
#define i(width, name, range_min, range_max)
char addr[128]
Source-specific multicast include source IP address (from SDP content)
int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, uint8_t **bufptr, int len)
Parse an RTP or RTCP packet directly sent as a buffer.
void ffio_init_context(FFIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
#define av_malloc_array(a, b)
int need_subscription
The following are used for Real stream selection.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
Send buffered packets over TCP.
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
int ff_rtsp_parse_streaming_commands(AVFormatContext *s)
Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in listen mode.
uint32_t ssrc
SSRC for this stream, to allow identifying RTCP packets before the first RTP packet.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
@ RTSP_LOWER_TRANSPORT_TCP
TCP; interleaved in RTSP.
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
int sdp_ttl
IP Time-To-Live (from SDP content)
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define RTSP_FLAG_CUSTOM_IO
Do all IO via the AVIOContext.
int client_port_min
UDP client ports; these should be the local ports of the UDP RTP (and RTCP) sockets over which we rec...
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
@ RTSP_LOWER_TRANSPORT_UDP_MULTICAST
UDP/multicast.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int id
Format-specific stream ID.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
void * cur_transport_priv
RTSPStream->transport_priv of the last stream that we read a packet from.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes,...
int sdp_payload_type
payload type
int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
Parse a Windows Media Server-specific SDP line.
int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, AVStream *st, URLContext *handle, int packet_size, int idx)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define RTP_MAX_PACKET_LENGTH
static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
Parse a string p in the form of Range:npt=xx-xx, and determine the start and end time.
struct sockaddr_storage sdp_ip
IP address (from SDP content)
int stale
Auth ok, but needs to be resent with a new nonce.
#define RTSP_DEFAULT_PORT
int index
stream index in AVFormatContext
@ RTSP_LOWER_TRANSPORT_HTTP
HTTP tunneled - not a proper transport mode as such, only for use via AVOptions.
This describes a single item in the "Transport:" line of one stream as negotiated by the SETUP RTSP c...
enum RTSPTransport transport
the negotiated data/packet transport protocol; e.g.
char control_url[MAX_URL_SIZE]
url for this stream (from SDP)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
FFmpeg currently uses a custom build this text attempts to document some of its obscure features and options Makefile the full command issued by make and its output will be shown on the screen DBG Preprocess x86 external assembler files to a dbg asm file in the object which then gets compiled Helps in developing those assembler files DESTDIR Destination directory for the install useful to prepare packages or install FFmpeg in cross environments GEN Set to ‘1’ to generate the missing or mismatched references Makefile builds all the libraries and the executables fate Run the fate test note that you must have installed it fate list List all fate regression test targets install Install headers
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
@ RTSP_SERVER_WMS
Windows Media server.
MpegTSContext * avpriv_mpegts_parse_open(AVFormatContext *s)
char * av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
Encode data to base64 and null-terminate.
@ RTSP_TRANSPORT_RAW
Raw data (over UDP)
#define RTSP_RTP_PORT_MAX
int64_t stimeout
timeout of socket i/o operations.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it.
HTTPAuthType
Authentication types, ordered from weakest to strongest.
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
@ RTSP_STATE_IDLE
not initialized
int auth_type
The currently chosen auth type.
int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
Read as many bytes as possible (up to size), calling the read function multiple times if necessary.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
@ RTSP_LOWER_TRANSPORT_NB
void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, const RTPDynamicProtocolHandler *handler)
This structure stores compressed data.
enum RTSPServerType server_type
brand of server that we're talking to; e.g.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int accept_dynamic_rate
Whether the server accepts the x-Dynamic-Rate header.
#define flags(name, subs,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, int lower_transport, const char *real_challenge)
Do the SETUP requests for each stream for the chosen lower transport mode.
const char * ff_rtp_enc_name(int payload_type)
Return the encoding name (as defined in http://www.iana.org/assignments/rtp-parameters) for a given p...
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
static void get_word_until_chars(char *buf, int buf_size, const char *sep, const char **pp)
int ff_rtsp_connect(AVFormatContext *s)
Connect to the RTSP server and set up the individual media streams.
int port_min
UDP multicast port range; the ports to which we should connect to receive multicast UDP data.
#define RTSP_FLAG_FILTER_SRC
Filter incoming UDP packets - receive packets only from the right source address and port.
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
#define RTSPS_DEFAULT_PORT
@ RTSP_LOWER_TRANSPORT_UDP
UDP/unicast.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
char * user_agent
User-Agent string.
#define RTSP_FLAG_RTCP_TO_SOURCE
Send RTCP packets to the source address of received packets.