summaryrefslogtreecommitdiffstats
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-19 13:58:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-19 13:58:14 +0200
commit81ff0c24ef050c1877639ecc3ba6c485fde0a74e (patch)
tree862e934366547cb8723d94f7f30953cb20d549b8 /libavformat/rtsp.c
parent93f244e3abc3d75a797535a8da890bb1f9932433 (diff)
parent1cd432e167b1a80853760c89a33606e2b5f229c2 (diff)
downloadffmpeg-streaming-81ff0c24ef050c1877639ecc3ba6c485fde0a74e.zip
ffmpeg-streaming-81ff0c24ef050c1877639ecc3ba6c485fde0a74e.tar.gz
Merge commit '1cd432e167b1a80853760c89a33606e2b5f229c2'
* commit '1cd432e167b1a80853760c89a33606e2b5f229c2': configure: fix libcdio check rtsp: Allow setting the reordering buffer size via an AVOption rtsp: Vertically align a constant definition rtp: Update the check for distinguishing between RTP and RTCP aac: fix build with hardcoded tables fate: dependencies for screen codec tests riff: Move functions around to be covered by appropriate #ifdefs Conflicts: configure tests/fate/screen.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 80f1047..0328d28 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -75,6 +75,9 @@
{ "audio", "Audio", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_AUDIO}, 0, 0, DEC, "allowed_media_types" }, \
{ "data", "Data", 0, AV_OPT_TYPE_CONST, {.i64 = 1 << AVMEDIA_TYPE_DATA}, 0, 0, DEC, "allowed_media_types" }
+#define RTSP_REORDERING_OPTS() \
+ { "reorder_queue_size", "Number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }
+
const AVOption ff_rtsp_options[] = {
{ "initial_pause", "Don't start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
@@ -88,17 +91,20 @@ const AVOption ff_rtsp_options[] = {
{ "min_port", "Minimum local UDP port", OFFSET(rtp_port_min), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC },
{ "max_port", "Maximum local UDP port", OFFSET(rtp_port_max), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
{ "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC },
+ RTSP_REORDERING_OPTS(),
{ NULL },
};
static const AVOption sdp_options[] = {
RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
RTSP_MEDIATYPE_OPTS("allowed_media_types", "Media types to accept from the server"),
+ RTSP_REORDERING_OPTS(),
{ NULL },
};
static const AVOption rtp_options[] = {
RTSP_FLAG_OPTS("rtp_flags", "RTP flags"),
+ RTSP_REORDERING_OPTS(),
{ NULL },
};
@@ -608,6 +614,13 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
{
RTSPState *rt = s->priv_data;
AVStream *st = NULL;
+ int reordering_queue_size = rt->reordering_queue_size;
+ if (reordering_queue_size < 0) {
+ if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay)
+ reordering_queue_size = 0;
+ else
+ reordering_queue_size = RTP_REORDER_QUEUE_DEFAULT_SIZE;
+ }
/* open the RTP context */
if (rtsp_st->stream_index >= 0)
@@ -632,8 +645,7 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
else if (CONFIG_RTPDEC)
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);
+ reordering_queue_size);
if (!rtsp_st->transport_priv) {
return AVERROR(ENOMEM);
OpenPOWER on IntegriCloud