]> git.sesse.net Git - ffmpeg/commitdiff
rtsp: add pkt_size option
authorTristan Matthews <tmatth@videolan.org>
Thu, 11 Apr 2019 04:07:15 +0000 (00:07 -0400)
committerMartin Storsjö <martin@martin.st>
Mon, 15 Apr 2019 19:44:19 +0000 (22:44 +0300)
This allows users to specify an upper limit on the size of outgoing packets
when publishing via RTSP.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c
libavformat/rtsp.h

index 8bf9d9e3c7b067608435c2d466c12d84f11ac5ff..12c4998c669850c8496edaf26ecc5a113f612e5d 100644 (file)
@@ -74,7 +74,8 @@
 
 #define COMMON_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 }, \
-    { "buffer_size",        "Underlying protocol send/receive buffer size",                  OFFSET(buffer_size),           AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC } \
+    { "buffer_size",        "Underlying protocol send/receive buffer size",                  OFFSET(buffer_size),           AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \
+    { "pkt_size",           "Underlying protocol send packet size",                          OFFSET(pkt_size),              AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC } \
 
 
 const AVOption ff_rtsp_options[] = {
@@ -118,6 +119,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
 
     snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
     av_dict_set(&opts, "buffer_size", buf, 0);
+    snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
+    av_dict_set(&opts, "pkt_size", buf, 0);
 
     return opts;
 }
index 9dfbc5367f9f7eab408d0df7565c22b201209dea..c38b90432d86eea9fd154c077dfe5105d88cc45b 100644 (file)
@@ -399,6 +399,7 @@ typedef struct RTSPState {
 
     char default_lang[4];
     int buffer_size;
+    int pkt_size;
 
     const URLProtocol **protocols;
 } RTSPState;