summaryrefslogtreecommitdiff
path: root/libavformat/libsrt.c
Commit message (Collapse)AuthorAge
* avformat/libsrt: fix help messageZhao Zhili2021-03-19
| | | | | | SRTO_TLPKTDROP works for receiver and sender both. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix setsockopt() typoZhao Zhili2021-03-19
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix race condition with libsrt_network_wait_fd and epollMarton Balint2021-02-07
| | | | | | | | | | | | | | | The way SRT's async / epoll-based IO works is that the event status is stored in the epoll containers. That is, if an event occurs on an SRT socket, and that SRT socket isn't part of any epoll container, then that event is lost. If we later add that socket to an epoll container, we still won't receive the event even if it wasn't serviced. Therefore we create the epoll and put the fd into it right after the connection is established. See http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-January/275334.html Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix or simplify some function return valuesMarton Balint2021-02-07
| | | | | | | Sometimes there was a confusion between srt_*() function return values and libavformat-style return values. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: close listen fd immediately after acceptMarton Balint2021-02-07
| | | | | | There is no reason to keep it open. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix cleanups on failed libsrt_open() and libsrt_setup()Marton Balint2020-10-16
| | | | | | | | | | - Call srt_epoll_release() to avoid fd leak on libsrt_setup() error. - Call srt_cleanup() on libsrt_open() failure. - Fix return value and method on mode parsing failure. Based on a patch by Nicolas Sugino <nsugino@3way.com.ar>. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: close listen fd in listener modeNicolas Sugino2020-08-20
| | | | | | | | | | | In listener mode the first fd is not closed when libsrt_close() is called because it is overwritten by the new accept fd. Added the listen_fd to the context to properly close it when libsrt_close() is called. Fixes trac ticket #8372. Signed-off-by: Nicolas Sugino <nsugino@3way.com.ar> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/srt: fix build fail when used the libsrt 1.4.1Jun Zhao2020-07-28
| | | | | | | | | | | | libsrt changed the: SRTO_SMOOTHER -> SRTO_CONGESTION SRTO_STRICTENC -> SRTO_ENFORCEDENCRYPTION and removed the front of deprecated options (SRTO_SMOOTHER/SRTO_STRICTENC) in the header, it's lead to build fail fix #8760 Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/libsrt: change open_timeout to int64_t to avoid integer overflowLimin Wang2020-05-03
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/libsrt: clarify option description for timeout and latency unit of ↵Limin Wang2020-05-03
| | | | | | measurement Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/libsrt: make avformat connect timeout 0 by defaultMarton Balint2020-02-24
| | | | | | | 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>
* avformat/libsrt: use listen_timeout for listeningMarton Balint2020-02-24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: send non-blocking mode on both the listen and the connect ↵Marton Balint2020-02-24
| | | | | | socket Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: small fixes in libsrt_neterrno()Marton Balint2020-02-24
| | | | | | | | 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>
* avformat/libsrt: poll for error conditions as wellMarton Balint2020-02-24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix checking connection result in non-blocking modeMarton Balint2020-02-24
| | | | | | | | | | | | After f8990c5f414d4575415e2a3981c3b142222ca3d4 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>
* avformat/libsrt: fix name of timeout optionMarton Balint2020-02-24
| | | | | | | 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>
* avformat/libsrt: fix timeout unit confusion between milisec and microsecMarton Balint2020-02-24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: add missing SRT_VERSION_VALUE checkMarton Balint2020-01-23
| | | | | | This was missed in d7e2a2bb35e394287b3e3dc27744830bf0b7ca99. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix enabling nonblocking modeAnthony Delannoy2020-01-19
| | | | | | | | 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>
* lavf/libsrt: Fix typoAnthony Delannoy2020-01-08
| | | | | Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/libsrt: add version guard for srt encryption controlJun Zhao2020-01-01
| | | | | | | add version guard for srt encryption control. and use SRTO_STRICTENC(53) for compatibility. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/libsrt: enable other encryption parametersJun Zhao2019-12-11
| | | | | | | Enable the SRTO_ENFORCEDENCRYPTION/SRTO_KMREFRESHRATE/ SRTO_KMPREANNOUNCE for srt encryption control. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/libsrt: add linger parameter to libsrtJun Zhao2019-12-11
| | | | | | | | 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>
* avformat/libsrt: change tlpktdrop, nakreport, messageapi options to boolean typeLimin Wang2019-12-06
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/libsrt: fix for the memory leak if passphrase has been configured ↵Limin Wang2019-12-06
| | | | | | | by option Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/libsrt: check av_strdup() return value and fix memleakSteven Liu2019-10-19
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* Merge commit '90b15f60bf4919deaed66d868e18107eba371da7'James Almer2019-02-20
|\ | | | | | | | | | | | | * commit '90b15f60bf4919deaed66d868e18107eba371da7': srt: Set srto_sender flag to sender srt socket Merged-by: James Almer <jamrial@gmail.com>
| * srt: Set srto_sender flag to sender srt socketSven Dueking2019-02-12
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | avformat/libsrt: add several options supported in srt 1.3.0Matsuzawa Tomohiro2018-10-23
| | | | | | | | | | | | | | | | | | | | 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>
* | avformat/libsrt: fix merge of payload_size optionMarton Balint2018-09-03
| | | | | | | | | | | | Fixes a compile error and re-adds pkt_size as a url?option as well. Signed-off-by: Marton Balint <cus@passwd.hu>
* | Merge commit 'f25117a4286505b38c12466ef04459471de3c1b0'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit 'f25117a4286505b38c12466ef04459471de3c1b0': libsrt: Pass the correct pointer for the passphrase Merged-by: James Almer <jamrial@gmail.com>
| * libsrt: Pass the correct pointer for the passphraseSven Dueking2018-07-13
| | | | | | | | | | | | The passphrase field is a pointer already. Bug-Id: https://github.com/Haivision/srt/issues/416
* | Merge commit 'a507af97eef468238d545ff954a39d7432832e54'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit 'a507af97eef468238d545ff954a39d7432832e54': avformat/libsrt: add latency options and deprecate tspbdelay Merged-by: James Almer <jamrial@gmail.com>
| * avformat/libsrt: add latency options and deprecate tspbdelaySven Dueking2018-06-04
| | | | | | | | | | Signed-off-by: Sven Dueking <sven.dueking@nablet.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c': avformat/libsrt: add payload size option Merged-by: James Almer <jamrial@gmail.com>
| * avformat/libsrt: add payload size optionSven Dueking2018-06-03
| | | | | | | | | | Signed-off-by: Sven Dueking <sven.dueking@nablet.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat/libsrt: add pkt_size parameter to libsrtMarton Balint2018-09-01
| | | | | | | | | | | | | | | | 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>
* | Merge commit 'a2fc8dbae85339d1b418d296f2982b6c04c53c57'James Almer2018-03-29
|/ | | | | | | * commit 'a2fc8dbae85339d1b418d296f2982b6c04c53c57': Add Haivision SRT protocol Merged-by: James Almer <jamrial@gmail.com>
* Add Haivision SRT protocolSven Dueking2018-03-28
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>