diff options
author | Thijs <thijsvermeir@telenet.be> | 2006-10-27 18:19:29 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-10-27 18:19:29 +0000 |
commit | dbf30963f3599717e8ff90c0820bb7bfca94a38b (patch) | |
tree | d20847d3435b4ea5196de81dfd5cb62789a44fa0 /libavformat/rtsp.c | |
parent | ed78754216ffe657c6f5e4b71aa41afd2e5ec523 (diff) | |
download | ffmpeg-dbf30963f3599717e8ff90c0820bb7bfca94a38b.tar.gz |
make ffmpeg able to send back a RTCP receiver report.
Patch by Thijs thijsvermeir A telenet P be
Original thread:
Date: Oct 27, 2006 12:58 PM
Subject: [Ffmpeg-devel] [PATCH proposal] RTCP receiver report
Originally committed as revision 6805 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index d340819bdf..08c71c534b 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -884,7 +884,7 @@ static int rtsp_read_header(AVFormatContext *s, if (RTSP_RTP_PORT_MIN != 0) { while(j <= RTSP_RTP_PORT_MAX) { snprintf(buf, sizeof(buf), "rtp://?localport=%d", j); - if (url_open(&rtsp_st->rtp_handle, buf, URL_RDONLY) == 0) { + if (url_open(&rtsp_st->rtp_handle, buf, URL_RDWR) == 0) { j += 2; /* we will use two port by rtp stream (rtp and rtcp) */ goto rtp_opened; } @@ -981,7 +981,7 @@ static int rtsp_read_header(AVFormatContext *s, host, reply->transports[0].server_port_min, ttl); - if (url_open(&rtsp_st->rtp_handle, url, URL_RDONLY) < 0) { + if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) { err = AVERROR_INVALIDDATA; goto fail; } @@ -994,7 +994,7 @@ static int rtsp_read_header(AVFormatContext *s, st = s->streams[rtsp_st->stream_index]; if (!st) s->ctx_flags |= AVFMTCTX_NOHEADER; - rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); + rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); if (!rtsp_st->rtp_ctx) { err = AVERROR_NOMEM; @@ -1157,6 +1157,8 @@ static int rtsp_read_packet(AVFormatContext *s, case RTSP_PROTOCOL_RTP_UDP: case RTSP_PROTOCOL_RTP_UDP_MULTICAST: len = udp_read_packet(s, &rtsp_st, buf, sizeof(buf)); + if (rtsp_st->rtp_ctx) + rtp_check_and_send_back_rr(rtsp_st->rtp_ctx, len); break; } if (len < 0) @@ -1336,7 +1338,7 @@ static int sdp_read_header(AVFormatContext *s, inet_ntoa(rtsp_st->sdp_ip), rtsp_st->sdp_port, rtsp_st->sdp_ttl); - if (url_open(&rtsp_st->rtp_handle, url, URL_RDONLY) < 0) { + if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) { err = AVERROR_INVALIDDATA; goto fail; } @@ -1346,7 +1348,7 @@ static int sdp_read_header(AVFormatContext *s, st = s->streams[rtsp_st->stream_index]; if (!st) s->ctx_flags |= AVFMTCTX_NOHEADER; - rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); + rtsp_st->rtp_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); if (!rtsp_st->rtp_ctx) { err = AVERROR_NOMEM; goto fail; |