Browse Source

avformat/rtsp: support buffer_size and pkt_size options for RTP

And forward it to the underlying UDP protocol.

Fixes ticket #7517.

Signed-off-by: Jiangjie Gao <gaojiangjie@live.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
tags/n4.4
Jiangjie Gao Marton Balint 4 years ago
parent
commit
3e9284fccb
2 changed files with 7 additions and 1 deletions
  1. +3
    -0
      doc/protocols.texi
  2. +4
    -1
      libavformat/rtsp.c

+ 3
- 0
doc/protocols.texi View File

@@ -1033,6 +1033,9 @@ Set the local RTCP port to @var{n}.
@item pkt_size=@var{n}
Set max packet size (in bytes) to @var{n}.

@item buffer_size=@var{size}
Set the maximum UDP socket buffer size in bytes.

@item connect=0|1
Do a @code{connect()} on the UDP socket (if set to 1) or not (if set
to 0).


+ 4
- 1
libavformat/rtsp.c View File

@@ -2506,12 +2506,15 @@ static int rtp_read_header(AVFormatContext *s)
RTSPState *rt = s->priv_data;
const char *p;
AVBPrint sdp;
AVDictionary *opts = NULL;

if (!ff_network_init())
return AVERROR(EIO);

opts = map_to_opts(rt);
ret = ffurl_open_whitelist(&in, s->url, AVIO_FLAG_READ,
&s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL);
&s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
av_dict_free(&opts);
if (ret)
goto fail;



Loading…
Cancel
Save