]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c'
authorJames Almer <jamrial@gmail.com>
Sun, 2 Sep 2018 22:11:23 +0000 (19:11 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 2 Sep 2018 22:11:23 +0000 (19:11 -0300)
* commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c':
  avformat/libsrt: add payload size option

Merged-by: James Almer <jamrial@gmail.com>
1  2 
doc/protocols.texi
libavformat/libsrt.c
libavformat/version.h

index 4c5e972a049d861d8ce20551ddebea7c77beac11,5b625e571bd4cd876655a4083f72fd9d80917214..6322581c86705121e36b8086a0c436fef9b77605
@@@ -1255,6 -755,17 +1255,21 @@@ only if @option{pbkeylen} is non-zero. 
  the receiver only if the received data is encrypted.
  The configured passphrase cannot be recovered (write-only).
  
 -@item payloadsize=@var{bytes}
++@item payload_size=@var{bytes}
+ Sets the maximum declared size of a packet transferred
+ during the single call to the sending function in Live
+ mode. Use 0 if this value isn't used (which is default in
+ file mode).
 -Default value is for MPEG-TS; if you are going to use SRT
++Default is -1 (automatic), which typically means MPEG-TS;
++if you are going to use SRT
+ to send any different kind of payload, such as, for example,
+ wrapping a live stream in very small frames, then you can
+ use a bigger maximum frame size, though not greater than
+ 1456 bytes.
++@item pkt_size=@var{bytes}
++Alias for @samp{payload_size}.
++
  @item pbkeylen=@var{bytes}
  Sender encryption key length, in bytes.
  Only can be set to 0, 16, 24 and 32.
index 2b7e4cb247478496266a3430cade3df72c743ec6,ec209c236dfa3df571f6c129b45eeec052bcb726..cb30f23eb3b738bbc7dd0821863ae6c618afb0e6
@@@ -74,7 -84,6 +84,10 @@@ static const AVOption libsrt_options[] 
      { "listen_timeout", "Connection awaiting timeout",                                          OFFSET(listen_timeout),   AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
      { "send_buffer_size", "Socket send buffer size (in bytes)",                                 OFFSET(send_buffer_size), AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
      { "recv_buffer_size", "Socket receive buffer size (in bytes)",                              OFFSET(recv_buffer_size), AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
-     { "pkt_size",       "Maximum SRT packet size",                                              OFFSET(pkt_size),         AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, INT_MAX,   .flags = D|E },
++    { "pkt_size",       "Maximum SRT packet size",                                              OFFSET(payload_size),     AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, SRT_LIVE_MAX_PAYLOAD_SIZE, .flags = D|E, "payload_size" },
++    { "payload_size",   "Maximum SRT packet size",                                              OFFSET(payload_size),     AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, SRT_LIVE_MAX_PAYLOAD_SIZE, .flags = D|E, "payload_size" },
++    { "ts_size",        NULL, 0, AV_OPT_TYPE_CONST,  { .i64 = SRT_LIVE_DEFAULT_PAYLOAD_SIZE }, INT_MIN, INT_MAX, .flags = D|E, "payload_size" },
++    { "max_size",       NULL, 0, AV_OPT_TYPE_CONST,  { .i64 = SRT_LIVE_MAX_PAYLOAD_SIZE },     INT_MIN, INT_MAX, .flags = D|E, "payload_size" },
      { "maxbw",          "Maximum bandwidth (bytes per second) that the connection can use",     OFFSET(maxbw),            AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
      { "pbkeylen",       "Crypto key len in bytes {16,24,32} Default: 16 (128-bit)",             OFFSET(pbkeylen),         AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 32,        .flags = D|E },
      { "passphrase",     "Crypto PBKDF2 Passphrase size[0,10..64] 0:disable crypto",             OFFSET(passphrase),       AV_OPT_TYPE_STRING,   { .str = NULL },              .flags = D|E },
@@@ -287,8 -290,8 +300,8 @@@ static int libsrt_set_options_pre(URLCo
          (tsbpddelay >= 0 && libsrt_setsockopt(h, fd, SRTO_TSBPDDELAY, "SRTO_TSBPDELAY", &tsbpddelay, sizeof(tsbpddelay)) < 0) ||
          (s->tlpktdrop >= 0 && libsrt_setsockopt(h, fd, SRTO_TLPKTDROP, "SRTO_TLPKDROP", &s->tlpktdrop, sizeof(s->tlpktdrop)) < 0) ||
          (s->nakreport >= 0 && libsrt_setsockopt(h, fd, SRTO_NAKREPORT, "SRTO_NAKREPORT", &s->nakreport, sizeof(s->nakreport)) < 0) ||
-         (s->pkt_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->pkt_size, sizeof(s->pkt_size)) < 0) ||
-         (connect_timeout >= 0 && libsrt_setsockopt(h, fd, SRTO_CONNTIMEO, "SRTO_CONNTIMEO", &connect_timeout, sizeof(connect_timeout)) <0 )) {
 -        (connect_timeout >= 0 && libsrt_setsockopt(h, fd, SRTO_CONNTIMEO, "SRTO_CONNTIMEO", &connect_timeout, sizeof(connect_timeout)) < 0) ||
 -        (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0)) {
++        (connect_timeout >= 0 && libsrt_setsockopt(h, fd, SRTO_CONNTIMEO, "SRTO_CONNTIMEO", &connect_timeout, sizeof(connect_timeout)) <0 )) ||
++        (s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) {
          return AVERROR(EIO);
      }
      return 0;
index da292d4242a810b5721987a302ba601998ec2d23,016f266f1ff96210255b21c98bf96f1fb885f5fe..b65ba19f3cfda811fbef27202a4200ab2f725215
  
  #include "libavutil/version.h"
  
 -#define LIBAVFORMAT_VERSION_MAJOR 58
 -#define LIBAVFORMAT_VERSION_MINOR  2
 -#define LIBAVFORMAT_VERSION_MICRO  0
 +// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 +// Also please add any ticket numbers that you believe might be affected here
 +#define LIBAVFORMAT_VERSION_MAJOR  58
 +#define LIBAVFORMAT_VERSION_MINOR  17
- #define LIBAVFORMAT_VERSION_MICRO 104
++#define LIBAVFORMAT_VERSION_MICRO 105
  
  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                 LIBAVFORMAT_VERSION_MINOR, \