Commit Graph

30 Commits

Author SHA1 Message Date
Marton Balint 290a35aefe avformat/libsrt: make avformat connect timeout 0 by default
Otherwise the user is not able to override the SRT API connect timeout above 5
sec without also setting the timeout option.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:13:38 +01:00
Marton Balint 449e984192 avformat/libsrt: use listen_timeout for listening
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:46 +01:00
Marton Balint 7cc7680a80 avformat/libsrt: send non-blocking mode on both the listen and the connect socket
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:46 +01:00
Marton Balint 86a7b77b60 avformat/libsrt: small fixes in libsrt_neterrno()
Return os error code if available, check for both SRT_EASYNCRCV and
SRT_EASYNCSND when transforming them to EAGAIN and only display error if it is
not EAGAIN.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint c112fae660 avformat/libsrt: poll for error conditions as well
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint aab9133d91 avformat/libsrt: fix checking connection result in non-blocking mode
After f8990c5f41 we properly set non-blocking
mode which makes the connect() call return always 0 even if no connection can
be established.

Fix this by always doing a poll after calling connect(). Also there was some
leftover copy paste code which checks for various errors which are simply not
possible with SRT.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint 006744bdbd avformat/libsrt: fix name of timeout option
rw_timeout is the generic URLcontext option, not the protocol specific timeout
option, also ?rw_timeout never worked because ?timeout was parsed instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint b96bc946f2 avformat/libsrt: fix timeout unit confusion between milisec and microsec
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint fee4cafbf5 avformat/libsrt: add missing SRT_VERSION_VALUE check
This was missed in d7e2a2bb35.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-23 22:41:43 +01:00
Anthony Delannoy f8990c5f41 avformat/libsrt: fix enabling nonblocking mode
As written in https://github.com/Haivision/srt/blob/v1.4.1/docs/API.md,
the nonblock mode is activated if SRTO_SNDSYN and SRTO_RCVSYN, for
sending and receiving respectively, are set to 0.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-19 00:17:11 +01:00
Anthony Delannoy 3def315c5c lavf/libsrt: Fix typo
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-08 01:35:13 +01:00
Jun Zhao d7e2a2bb35 lavf/libsrt: add version guard for srt encryption control
add version guard for srt encryption control. and use
SRTO_STRICTENC(53) for compatibility.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-01-01 19:35:53 +08:00
Jun Zhao 952fd0c768 lavf/libsrt: enable other encryption parameters
Enable the SRTO_ENFORCEDENCRYPTION/SRTO_KMREFRESHRATE/
SRTO_KMPREANNOUNCE for srt encryption control.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-12-11 14:23:26 +08:00
Jun Zhao 8d823e6005 lavf/libsrt: add linger parameter to libsrt
add linger parameter to libsrt, it's setting the number of seconds
that the socket waits for unsent data when closing.

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-12-11 14:23:26 +08:00
Limin Wang 79d907774d avformat/libsrt: change tlpktdrop, nakreport, messageapi options to boolean type
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-06 11:27:25 +01:00
Limin Wang f9d6addd60 avformat/libsrt: fix for the memory leak if passphrase has been configured by option
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-06 11:25:29 +01:00
Steven Liu 1f7b527194 avformat/libsrt: check av_strdup() return value and fix memleak
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-19 06:49:46 +02:00
James Almer 1811b7d1f5 Merge commit '90b15f60bf4919deaed66d868e18107eba371da7'
* commit '90b15f60bf4919deaed66d868e18107eba371da7':
  srt: Set srto_sender flag to sender srt socket

Merged-by: James Almer <jamrial@gmail.com>
2019-02-20 15:50:06 -03:00
Sven Dueking 90b15f60bf srt: Set srto_sender flag to sender srt socket
SRT API Documentation:
This flag is superfluous if both parties are at least version 1.3.0
(this shall be enforced by setting this value to SRTO_MINVERSION if
you expect that it be true) and therefore support HSv5 handshake,
where the SRT extended handshake is done with the overall handshake
process.

This flag is however obligatory if at least one party may be using
SRT below version 1.3.0 and does not support HSv5.
2019-02-12 11:59:29 +01:00
Matsuzawa Tomohiro c2ac3b8e6a avformat/libsrt: add several options supported in srt 1.3.0
Several SRT options are missing. Since pkg_config requires libsrt v1.3.0 and above, it should be able to support options added in libsrt v1.3.0 and below.
This commit adds 8 SRT options.
sndbuf, rcvbuf, lossmaxttl, minversion, streamid, smoother, messageapi and transtype
The keys of option are equivalent to stransmit.
https://github.com/Haivision/srt/blob/v1.3.0/apps/socketoptions.hpp#L196-L223

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-10-23 19:42:48 +02:00
Marton Balint 23fe072e43 avformat/libsrt: fix merge of payload_size option
Fixes a compile error and re-adds pkt_size as a url?option as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-09-03 09:46:42 +02:00
James Almer 768b07e3bc Merge commit 'f25117a4286505b38c12466ef04459471de3c1b0'
* commit 'f25117a4286505b38c12466ef04459471de3c1b0':
  libsrt: Pass the correct pointer for the passphrase

Merged-by: James Almer <jamrial@gmail.com>
2018-09-02 19:21:35 -03:00
James Almer de33b3e457 Merge commit 'a507af97eef468238d545ff954a39d7432832e54'
* commit 'a507af97eef468238d545ff954a39d7432832e54':
  avformat/libsrt: add latency options and deprecate tspbdelay

Merged-by: James Almer <jamrial@gmail.com>
2018-09-02 19:11:45 -03:00
James Almer b1b0e53258 Merge commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c'
* commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c':
  avformat/libsrt: add payload size option

Merged-by: James Almer <jamrial@gmail.com>
2018-09-02 19:11:23 -03:00
Marton Balint 1124df0397 avformat/libsrt: add pkt_size parameter to libsrt
Also make sure we set the URL context max packet size accordingly.

Based on a patch by Tudor Suciu <tudor.suciu@gmail.com>

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-09-01 21:57:59 +02:00
Sven Dueking f25117a428 libsrt: Pass the correct pointer for the passphrase
The passphrase field is a pointer already.

Bug-Id: https://github.com/Haivision/srt/issues/416
2018-07-13 18:36:11 +02:00
Sven Dueking a507af97ee avformat/libsrt: add latency options and deprecate tspbdelay
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-06-04 18:47:48 +02:00
Sven Dueking ea8ae27a5e avformat/libsrt: add payload size option
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-06-03 17:46:23 +02:00
James Almer a123e576a4 Merge commit 'a2fc8dbae85339d1b418d296f2982b6c04c53c57'
* commit 'a2fc8dbae85339d1b418d296f2982b6c04c53c57':
  Add Haivision SRT protocol

Merged-by: James Almer <jamrial@gmail.com>
2018-03-29 21:56:19 -03:00
Sven Dueking a2fc8dbae8 Add Haivision SRT protocol
The protocol requires libsrt (https://github.com/Haivision/srt) to be
installed

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-28 16:16:41 +02:00