From bfc6db4477cd1ca6c32ab533783238cf8381f177 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 12 Oct 2011 12:37:42 +0300 Subject: rtpdec: Add ff_ prefix to all nonstatic symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtsp.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 8b70c8b28a..ff4d16a45b 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -501,7 +501,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s) } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) ff_rdt_parse_close(rtsp_st->transport_priv); else if (CONFIG_RTPDEC) - rtp_parse_close(rtsp_st->transport_priv); + ff_rtp_parse_close(rtsp_st->transport_priv); } rtsp_st->transport_priv = NULL; if (rtsp_st->rtp_handle) @@ -558,7 +558,7 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); else if (CONFIG_RTPDEC) - rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle, + rtsp_st->transport_priv = ff_rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay) ? 0 : RTP_REORDER_QUEUE_DEFAULT_SIZE); @@ -567,9 +567,9 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) return AVERROR(ENOMEM); } else if (rt->transport != RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) { if (rtsp_st->dynamic_handler) { - rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv, - rtsp_st->dynamic_protocol_context, - rtsp_st->dynamic_handler); + ff_rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv, + rtsp_st->dynamic_protocol_context, + rtsp_st->dynamic_handler); } } @@ -1121,7 +1121,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, goto fail; rtp_opened: - port = rtp_get_local_rtp_port(rtsp_st->rtp_handle); + port = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle); have_port: snprintf(transport, sizeof(transport) - 1, "%s/UDP;", trans_pref); @@ -1225,7 +1225,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, reply->transports[0].server_port_min, "%s", options); } if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && - rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) { + ff_rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) { err = AVERROR_INVALIDDATA; goto fail; } @@ -1235,7 +1235,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, */ if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat && CONFIG_RTPDEC) - rtp_send_punch_packets(rtsp_st->rtp_handle); + ff_rtp_send_punch_packets(rtsp_st->rtp_handle); break; } case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: { @@ -1569,7 +1569,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, if (rtsp_st->rtp_handle) { p[max_p].fd = ffurl_get_file_handle(rtsp_st->rtp_handle); p[max_p++].events = POLLIN; - p[max_p].fd = rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); + p[max_p].fd = ff_rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); p[max_p++].events = POLLIN; } } @@ -1624,7 +1624,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) if (rt->transport == RTSP_TRANSPORT_RDT) { ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); } else - ret = rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); + ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); if (ret == 0) { rt->cur_transport_priv = NULL; return 0; @@ -1672,13 +1672,13 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end); if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP) - rtp_check_and_send_back_rr(rtsp_st->transport_priv, len); + ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, len); break; } if (len == AVERROR(EAGAIN) && first_queue_st && rt->transport == RTSP_TRANSPORT_RTP) { rtsp_st = first_queue_st; - ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0); + ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0); goto end; } if (len < 0) @@ -1688,7 +1688,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) if (rt->transport == RTSP_TRANSPORT_RDT) { ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len); } else { - ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len); + ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len); if (ret < 0) { /* Either bad packet, or a RTCP packet. Check if the * first_rtcp_ntp_time field was initialized. */ -- cgit v1.2.3 From 30eae325302a99fd6c3051c34b60a605765e026c Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Sun, 2 Jan 2011 14:32:18 +0200 Subject: rtsp: Parse the x-Accept-Dynamic-Rate header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtsp.c | 3 +++ libavformat/rtsp.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index ff4d16a45b..ba104d24b8 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -808,6 +808,9 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf, if (strstr(p, "GET_PARAMETER") && method && !strcmp(method, "OPTIONS")) rt->get_parameter_supported = 1; + } else if (av_stristart(p, "x-Accept-Dynamic-Rate:", &p) && rt) { + p += strspn(p, SPACE_CHARS); + rt->accept_dynamic_rate = atoi(p); } } diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h index 265d9f837f..62ca483d9d 100644 --- a/libavformat/rtsp.h +++ b/libavformat/rtsp.h @@ -346,6 +346,9 @@ typedef struct RTSPState { * Option flags for the chained RTP muxer. */ int rtp_muxer_flags; + + /** Whether the server accepts the x-Dynamic-Rate header */ + int accept_dynamic_rate; } RTSPState; /** -- cgit v1.2.3 From 76b0d03d827626b9c235812096b0be490a6e4ea0 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 27 Dec 2010 09:51:09 +0200 Subject: rtsp: Request that dynamic rate is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DSS enables this automatically if streaming VOD over TCP. If enabled, the server feeds packets faster than realtime, screwing up RTCP NTP based timestamps. Also, DSS doesn't indicate that this was indicated, if it was enabled automatically (although if it was requested to be enabled, a header saying that it was enabled is added, but this isn't added if it is enabled automatically), making it even harder to detect and work around properly without explicitly asking for it to be disabled(/enabled, if we were able to support it). Signed-off-by: Martin Storsjö --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index ba104d24b8..674a8b6017 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1168,6 +1168,8 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, snprintf(cmd, sizeof(cmd), "Transport: %s\r\n", transport); + if (rt->accept_dynamic_rate) + av_strlcat(cmd, "x-Dynamic-Rate: 0\r\n", sizeof(cmd)); if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) { char real_res[41], real_csum[9]; ff_rdt_calc_response_and_checksum(real_res, real_csum, -- cgit v1.2.3