aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/udp: add function to set remote address directlyTimo Rothenpieler3 days1-0/+30
|
* avformat/udp: separate rx and tx fifoTimo Rothenpieler3 days1-20/+27
|
* avformat/udp: make recv addr of each packet availableTimo Rothenpieler3 days1-18/+34
|
* avformat/udp: don't override 0 localportTimo Rothenpieler10 days1-1/+1
|
* Revert "avformat/udp: Fix temporary buffer race"Michael Niedermayer2024-07-231-8/+7
| | | | | | This is not needed This reverts commit 7b2f67ea77f4c856311946f153e5eed99b0128f7.
* avformat/udp: Fix temporary buffer raceMichael Niedermayer2024-07-071-7/+8
| | | | | | | | Fixes: CID1551679 Data race condition Fixes: CID1551687 Data race condition Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-1/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+2
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-2/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Remove avformat and avio headers from protocolsAndreas Rheinhardt2023-09-101-2/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/udp: check for memory allocation failure when setting localaddrjackarain2023-03-081-0/+4
| | | | | Signed-off-by: jackarain <jack.wgm@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: set internal thread namesAnton Khirnov2022-10-241-0/+4
|
* avformat/udp: remove IPPROTO_IPV6 macroLimin Wang2022-02-121-1/+1
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: Fix IP_MULTICAST_TTL for BSD compatibilityLimin Wang2022-02-121-2/+12
| | | | | | | | | | Suggested by zhilizhao, vlc project has solved the compatibility by the same way, so I borrowed the comments from vlc project. Fixes ticket #9449 Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: use one setsockopt for ipv4/ipv6Limin Wang2022-02-121-12/+20
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: properly check for valid ttl in urlLimin Wang2022-02-121-0/+5
| | | | | | | Zhao Zhili added a ttl upper bound in commit 9daac85da8, but the check for ttl in url is missing still. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavf/udp: switch to new FIFO APIAnton Khirnov2022-02-071-17/+17
|
* avformat/udp: set ttl upper bound to 255Zhao Zhili2022-02-061-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/network: log ff_socket() errors to proper contexts rather than NULLAnton Khirnov2022-01-211-2/+2
|
* lavf/udp: log net errors to proper contexts rather than NULLAnton Khirnov2022-01-211-15/+20
|
* lavf/udp: do not return an uninitialized value from udp_open()Anton Khirnov2022-01-111-2/+6
|
* avformat/udp: remove local localaddr arrayLimin Wang2021-11-261-6/+4
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: fix check for pthread_cond_wait return valueZhao Zhili2021-07-101-3/+1
| | | | | | | | POSIX errno is positive. We have strict_pthread_cond_wait to handle error code during development. Signed-off-by: zhilizhao <zhilizhao@tencent.com> Reviewed-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/udp: add memory alloc checksLimin Wang2021-01-161-0/+4
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: return the error code instead of generic EIOLimin Wang2021-01-161-22/+36
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: cosmeticsLimin Wang2020-10-221-16/+15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: clarify option description for timeout unitLimin Wang2020-10-221-1/+1
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/udp: remove redundant setting of h->max_packet_sizeZhao Zhili2020-10-161-3/+0
| | | | | | h->max_packet_size is being reset in the following code. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/udp: fix the comments for default UDP socket recvbuf sizeJun Zhao2020-07-121-1/+1
| | | | | | | | 15d160cc0b2 increased the UDP socket receiving buffer size (64K ->384K), but missed to update this comments. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/udp: support w32pthreads compatphunkyfish2020-03-081-1/+6
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: cancel pending IO on win32 manuallyMarton Balint2020-02-021-1/+10
| | | | | | | | | | | | | recvfrom() is not a cancellation point in pthreads-win32, see https://sourceware.org/pthreads-win32/manual/pthread_cancel.html In order to be able to cancel the reader thread on Win32 properly we first shutdown the socket then call CancelIoEx to abort pending IO. Subsequent recvfrom() calls will fail with WSAESHUTDOWN causing the thread to exit. Fixes ticket #5717. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: remove setting cancel state from the TX threadMarton Balint2020-02-021-4/+0
| | | | | | Write mode does not use cancellation. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: increase the default buffer size of a receiving socket to 384KMarton Balint2020-01-251-1/+2
| | | | | | | | | | | | It is a common mistake that people only increase fifo_size when they experience drops, unfortunately this does not help for higher bitrate (> 100 Mbps) streams when the reader thread simply might not receive the packets in time (especially under high CPU load) if the default 64 KB of kernel buffer size is used. New default is determined so that common linux systems can set this buffer size without tuning kernel parameters. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: properly use return value of pthread_cond_timedwaitMarton Balint2020-01-251-2/+3
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: add newline after warningMarton Balint2020-01-251-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: modify the not write-only to read-only mode.Xuchen Su2020-01-201-1/+1
| | | | | | not write-only include read-write pseudo flag. so make the flag read-only Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/udp: add logging context to logSteven Liu2019-10-081-4/+4
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/udp: always use IP_ADD_SOURCE_MEMBERSHIP for subscribing to an UDP ↵Marton Balint2018-10-031-24/+28
| | | | | | | | | | | | | | multicast source group in IPv4 That alone supports specifying the interface based on its address. Getting the interface index from the local address seems quite a bit of work in a platform independent way... Obviously for IPv6 we still always use MCAST_JOIN_SOURCE_GROUP. As a side effect this also fixes ticket #7459. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: specify the local address for some source filtered multicast joinsMarton Balint2018-10-031-4/+11
| | | | | | | | | | | | | We already use localaddr for the multicast joins without source filters, so we should use them for source filters as well. This patch only fixes the IP_ADD_SOURCE_MEMBERSHIP and the IP_BLOCK_SOURCE case. Unless we do this, the kernel automatically selects an interface based on the source address, and that interface might be different from the one set in localaddr. For blocked sources this even casues EINVAL because we joined the multicast group on a different interface. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: add support for generic source filteringMarton Balint2018-10-031-4/+13
| | | | | | | | This allows getting data only from a specific source IP. This is useful not only for unicast but for multicast as well because multicast source subscriptions do not act as source filters for the incoming packets. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: use factorized ip functionsMarton Balint2018-10-031-102/+21
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/udp: use ff_log_net_error to replace log_net_errorJun Zhao2018-08-181-24/+17
| | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* Revert "udp: fix compilation when HAVE_PTHREAD_CANCEL isnt defined"Derek Buitenhuis2017-11-231-4/+0
| | | | | | | | This was an mplayer-specific hack. This reverts commit a4f94f24b4f153c30bbcaa700bedfb2b3a581e5e. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavf/udp: Do not use MCAST_* for multicast on tvOS.Carl Eugen Hoyos2016-09-031-1/+5
| | | | Fixes ticket #5774.
* avformat/udp: replace packet_gap with bitrate optionMarton Balint2016-06-191-18/+33
| | | | | | | | We haven't had a stable release since the packet_gap addition, so probably it is worth reworking the option to something that makes more sense to the end user. Also add burst_bits option to specify maximum length of bit bursts. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/udp: do not accumulate packet_gap delay errorsMarton Balint2016-06-191-2/+13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/udp: fix dead code.Nicolas George2016-06-031-1/+1
| | | | | | | | | | Since d607861, service can not be NULL, only "0". An UDP address with neither local port nor address leaves both service and node to their default value, and POSIX specifies that they are not allowed to be both NULL; "0" is equivalent to an unspecified port for all currently known protocols. Fix CID 1341570.
* avformat/udp: Protect write to circular_buffer_error by mutexMichael Niedermayer2016-06-021-0/+2
| | | | | | | This isnt really needed on most platforms but fixes CID1362183 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/udp: Remove unused variableMichael Niedermayer2016-05-291-1/+0
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/udp: Close the socket after destroying the thread using the socketMichael Niedermayer2016-05-251-1/+1
| | | | | | for send() this cannot work and even for recv() it feels very wrong and hackish Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>