summaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
Commit message (Collapse)AuthorAgeFilesLines
* network: Use SOCK_CLOEXEC when availableLuca Barbato2013-08-051-1/+1
|
* udp: Keep track of include and exclude sources separatelyEd Torbett2013-07-291-35/+51
| | | | | | | This allows us to explicitly fail if the caller tried to set both inclusions and exclusions at the same time. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Allow specifying multicast include/blocks as host names as wellEd Torbett2013-07-291-2/+2
| | | | | | | | Previously this only allowed literal IP addresses. When these are conveyed in a SDP file as in RFC4570, host names are allowed as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: use socklen_t where appropriateMans Rullgard2012-10-271-2/+2
| | | | | | | getsockname() takes a pointer to socklen_t which is not necessarily int. Signed-off-by: Mans Rullgard <mans@mansr.com>
* udp: Support IGMPv3 source specific multicast and source blockingMartin Storsjö2012-06-271-1/+113
| | | | | | Based on an original patch by Stephen D'Angelo <SDAngelo@evertz.com>. Signed-off-by: Martin Storsjö <martin@martin.st>
* network: Include unistd.h from network.hMartin Storsjö2012-06-261-1/+0
| | | | | | | | | | | This heaader is required for close() for sockets in network code. For winsock, the equivalent function is defined in the winsock2.h header. This avoids having the HAVE_UNISTD_H in all files dealing with raw sockets. Signed-off-by: Martin Storsjö <martin@martin.st>
* Remove unnecessary inclusions of [sys/]time.hMans Rullgard2012-06-201-1/+0
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* udp: Properly check for invalid socketsMartin Storsjö2012-06-191-1/+1
| | | | | | If stdin has been closed, 0 is a valid socket descriptor. Signed-off-by: Martin Storsjö <martin@martin.st>
* network: Use av_strerror for getting error messagesMartin Storsjö2012-06-191-12/+19
| | | | | | | Also use ff_neterrno() instead of errno directly (which doesn't work on windows), for getting the error code. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Properly print error from getnameinfoMartin Storsjö2012-06-191-2/+3
| | | | | | | | getnameinfo doesn't set errno on failure, it returns an error code, which should be handled by gai_strerror instead of the normal strerror. Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace memset(0) by zero initializations.Diego Biurrun2012-03-281-2/+1
| | | | Also remove one pointless zero initialization in rangecoder.c.
* udp: Set ttl for read-write streams, too, not only for write-only onesMartin Storsjö2012-03-091-2/+3
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Only bind to the multicast address if in read-only modeMartin Storsjö2012-03-091-2/+3
| | | | | | | | | | | | | | | This fixes sending back RTCP RR packets if receiving RTP over multicast. If the multicast stream is sent on demand (set up and signalled via RTSP), the sender might depend on getting RTCP RR packets knowing that there are listeners, otherwise the stream can be closed after a certain timeout. This fixes receiving RTSP streams over multicast on unix, from certain Axis cameras. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Clarify the comment about binding the multicast addressMartin Storsjö2012-03-091-1/+3
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Reorder commentsMartin Storsjö2012-03-091-1/+1
| | | | | | | | | When this code was added in 36b532815cb83, the new code was added between the existing comment and the existing line of code, making the old comment seem to refer to the new code. This makes it read correctly. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Print an error message if bind failsMartin Storsjö2012-03-071-1/+3
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: Add an URLProtocol flag for indicating that a protocol uses networkMartin Storsjö2012-01-051-0/+1
| | | | | | | This definition is in two files, since the definitions will move to the private header at the next bump. Signed-off-by: Martin Storsjö <martin@martin.st>
* Fix a bunch of common typos.Diego Biurrun2011-12-111-1/+1
|
* proto: Use .priv_data_size to allocate the private contextMartin Storsjö2011-12-011-8/+2
| | | | | | | | This simplifies the open functions by avoiding one function call that needs error checking, reducing the amount of extra bulk code. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Allow specifying the local IP addressMartin Storsjö2011-11-091-5/+10
| | | | | | | This is useful if sending multicast data on a host with multiple interfaces. Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Fix a compilation warningMartin Storsjö2011-06-301-1/+1
| | | | | | | | | This fixes this compilation warning, by making endptr a non-const pointer, as required by strtol: In function ‘udp_open’: warning: passing argument 2 of ‘strtol’ from incompatible pointer type Signed-off-by: Martin Storsjö <martin@martin.st>
* udp: Receive on the remote port number, if no local port is setCan Wu2011-06-241-1/+1
| | | | | | | | | | For a unicast udp stream to localhost:1234, currently ffplay udp://:1234?localport=1234 works, but ffplay udp://:1234 doesn't work. Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.Diego Biurrun2011-05-121-1/+1
| | | | | | | | | | | | | | | | Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems since it causes certain system functions to be hidden on some (BSD) systems. The solution is to only add the flag on systems that really require it, i.e. glibc-based ones. This change makes BSD systems compile out-of-the-box without the need for adding specific flags manually. It also allows dropping a number of flags set manually on a file-per-file basis, but were only present to work around breakage introduced by the presence of _POSIX_C_SOURCE. Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems. We use XSI extensions in several places already, so it is preferable to define it globally instead of littering source files with individual #defines only needed for glibc.
* udp: Fix receiving RTP data over multicastMartin Storsjö2011-05-091-6/+6
| | | | | | | | | | | | | | | | Earlier, AVIO_RDWR was handled as READ, and all the checks for the AVIO_WRONLY flag explicitly meant the write-only case. When changed from old AVIO/URL contants to AVIO_FLAG in 59d96941f0285a5, these comparisons were updated incorrectly, by mapping checks for AVIO_WRONLY to checks for AVIO_FLAG_WRITE. When receiving RTP over UDP, the urlcontext is opened with READ_WRITE flags. This patch updates the flag comparisons to check for the same conditions as the code did prior to 59d96941f0285a5. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Make protocols pass URLContext as log context where availableMartin Storsjö2011-04-201-4/+4
| | | | | | | Since the libavformat major bump, URLContext contains an AVClass, making it a usable log context. Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbolsStefano Sabatini2011-04-191-6/+6
| | | | | | | | Make AVIO_FLAG_ access constants work as flags, and in particular fix the behavior of functions (such as avio_check()) which expect them to be flags rather than modes. This breaks API.
* lavf: remove FF_API_UDP_GET_FILE cruftAnton Khirnov2011-04-191-4/+1
|
* lavf: use designated initializers for all protocolsAnton Khirnov2011-04-081-6/+5
| | | | | This is more readable and makes it easier to reorder URLProtocol members.
* avio: move extern url_interrupt_cb declaration from avio.h to url.hAnton Khirnov2011-04-071-0/+1
|
* avio: AVIO_ prefixes for URL_ open flags.Anton Khirnov2011-04-071-8/+8
|
* proto: factor ff_network_wait_fd and use it on udpLuca Barbato2011-04-071-40/+19
| | | | | | | | Support the URL_FLAG_NONBLOCK semantic and uniform the protocol. The quick retry loop is already part of retry_transfer_wrapper. The polling routine is common to the network protocols: udp, tcp and, once merged, sctp.
* avio: make udp_set_remote_url/get_local_port internal.Anton Khirnov2011-03-231-3/+4
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Use AVERROR_EXIT with url_interrupt_cb.Nicolas George2011-03-151-1/+1
| | | | | | | | | | | | | Functions interrupted by url_interrupt_cb should not be restarted. Therefore using AVERROR(EINTR) was wrong, as it did not allow to distinguish when the underlying system call was interrupted and actually needed to be restarted. This fixes roundup issues 2657 and 2659 (ffplay not exiting for streamed content). Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* libavformat: Remove FF_NETERRNO()Martin Storsjö2011-02-231-5/+5
| | | | | | | | | | | | | | Map EAGAIN and EINTR from ff_neterrno to the normal AVERROR() error codes. Provide fallback definitions of other errno.h network errors, mapping them to the corresponding winsock errors. This eases catching these error codes in common code, without having to distinguish between FF_NETERRNO(EAGAIN) and AVERROR(EAGAIN). This fixes roundup issue 2614, unbreaking blocking network IO on windows. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Move find_info_tag to lavu and add av_ prefix to itAnton Khirnov2011-02-171-7/+8
| | | | Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
* udp: Enable address reuse by default for multicastDavid Fries2011-02-091-2/+15
| | | | | | | | Keep the original corner case behaviour, where reuse is enabled for the case where no argument is given to the reuse url option. Signed-off-by: Martin Storsjö <martin@martin.st> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* os: replace select with pollLuca Barbato2011-01-281-10/+5
| | | | | Select has limitations on the fd values it could accept and silently breaks when it is reached.
* Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.Diego Elio Pettenò2011-01-261-1/+1
| | | | | This also lists the objects from those two libraries as internal (by adding the ff_ prefix) so that they can then be hidden via linker scripts.
* udp: Allow specifying the connect option in udp_set_remote_url, tooMartin Storsjö2011-01-061-1/+17
| | | | | | | If the remote address is updated later with this function, the caller shouldn't set the connect option until in this call. Originally committed as revision 26245 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add FF_API_UDP_GET_FILE define to disable the deprecated udp_get_file_handle()Aurelien Jacobs2010-10-151-1/+1
| | | | | | public function Originally committed as revision 25481 to svn://svn.ffmpeg.org/ffmpeg/trunk
* ReindentMartin Storsjö2010-10-081-3/+3
| | | | Originally committed as revision 25406 to svn://svn.ffmpeg.org/ffmpeg/trunk
* udp: Add an option for connecting the udp socketMartin Storsjö2010-10-081-0/+13
| | | | | | | | | | This allows us to find out the local sending address via getsockname, otherwise we just get INADDR_ANY (or similar for v6). This also makes writes return ECONNREFUSED if nobody is listening on the receiving port. Originally committed as revision 25405 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Convert ff_is_multicast_address to take a struct sockaddr parameterMartin Storsjö2010-10-071-1/+1
| | | | | | | | Not all users of this function will have a full struct sockaddr_storage available, and casting other sockaddrs to sockaddr_storage is wrong, while any sockaddr can be cast to a base sockaddr. Originally committed as revision 25388 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Share the is_multicast_address functionMartin Storsjö2010-10-071-15/+1
| | | | | | | | The header probably isn't the right permanent place for this function, but it is quite small, and consensus seems to be that it can stay in the header for now, instead of creating a new file network.c just for this one. Originally committed as revision 25387 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move multicast address identification fallback macros to network.h from udp.cMartin Storsjö2010-10-071-6/+0
| | | | Originally committed as revision 25386 to svn://svn.ffmpeg.org/ffmpeg/trunk
* udp: Define _DARWIN_C_SOURCEMartin Storsjö2010-10-051-0/+1
| | | | | | This is required in order to get the IP_MULTICAST_TTL define. Originally committed as revision 25351 to svn://svn.ffmpeg.org/ffmpeg/trunk
* udp: Return the actual error code on errors, instead of AVERROR(EIO)Martin Storsjö2010-10-051-1/+1
| | | | Originally committed as revision 25350 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Check for the IPPROTO_IPV6 define before using itMartin Storsjö2010-09-201-2/+2
| | | | | | | This fixes building on FreeBSD in some configurations, if the IPv6 multicast structs are available, but IPPROTO_IPV6 isn't defined. Originally committed as revision 25147 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Check for udp_set_remote_url error.Reimar Döffinger2010-07-281-1/+2
| | | | | | Fixes issue 1784 (hang with nonsense URL/no network available). Originally committed as revision 24575 to svn://svn.ffmpeg.org/ffmpeg/trunk
OpenPOWER on IntegriCloud