Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-21lavf/network: log ff_listen() errors to proper contexts rather than NULLAnton Khirnov
2022-01-21lavf/network: log ff_socket() errors to proper contexts rather than NULLAnton Khirnov
2019-12-11network: Define ENOTCONN as WSAENOTCONN if not definedMartin Storsjö
This fixes compilation with old mingw.org toolchains, which has got much fewer errno.h entries. Signed-off-by: Martin Storsjö <martin@martin.st>
2018-09-11Merge commit '9b4c3f5aadf54ffd2a6e15746b1fd736379883c4'James Almer
* commit '9b4c3f5aadf54ffd2a6e15746b1fd736379883c4': network: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper function Merged-by: James Almer <jamrial@gmail.com>
2018-08-31network: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper functionMartin Storsjö
For cases with dual stack (IPv4 + IPv6) connectivity, but where one stack potentially is less reliable, strive to trying to connect over both protocols in parallel, using whichever address connected first. In cases with a hostname resolving to multiple IPv4 and IPv6 addresses, the current connection mechanism would try all addresses in the order returned by getaddrinfo (with all IPv6 addresses ordered before the IPv4 addresses normally). If connection attempts to the IPv6 addresses return quickly with an error, this was no problem, but if they were unsuccessful leading up to timeouts, the connection process would have to wait for timeouts on all IPv6 target addresses before attempting any IPv4 address. Similar to what RFC 8305 suggests, reorder the list of addresses to try connecting to, interleaving address families. After starting one connection attempt, start another one in parallel after a small delay (200 ms as suggested by the RFC). For cases with unreliable IPv6 but reliable IPv4, this should make connection attempts work as reliably as with plain IPv4, with only an extra 200 ms of connection delay. Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-18lavf/network: add a ff_log_net_error function.Jun Zhao
add a ff_log_net_error function for error log. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-05-10lavf/network: fix doxygen comments.Jun Zhao
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-01-16avformat: make avformat_network_init() explicitly optionalwm4
It was sort of optional before - if you didn't call it, networking was initialized on demand, and an ugly warning was logged. Also, the doxygen comments threatened that it would be made strictly required one day. Make it explicitly optional. I would prefer to deprecate it fully, but there might still be legitimate reasons to use this. But the average user won't need it. This is needed only for two reasons: to initialize TLS libraries like OpenSSL and GnuTLS, and winsock. OpenSSL and GnuTLS were already silently initialized on demand if the global network init function was not called. They also have various thread-safety acrobatics, which make concurrent initialization within libavformat safe. In addition, the libraries are moving towards making their global init functions safe, which removes all need for central global init. In particular, GnuTLS 3.5.16 and OpenSSL 1.1.0g have been found to have safe init functions. In all cases, they use internal reference counters to avoid that the global uninit functions interfere with concurrent uses of the library by other API users who called global init. winsock should be thread-safe as well, and maintains an internal reference counter as well. Since we still support ancient TLS libraries, which do not have this fixed, and since it's unknown whether winsock and GnuTLS reinitialization is costly in any way, don't deprecate the libavformat functions yet.
2018-01-06libavformat: unexpose the ff_inet_aton functionRostislav Pehlivanov
Used only by ffserver. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-04http: block while waiting for reconnectingwm4
It makes no sense to return an error after the first reconnect, and then somehow resume the next time it's called. Usually this will lead to demuxer errors. Make reconnecting block instead, until it has either successfully reconnected, or given up. Also make the wait reasonably interruptible. Since there is no mechanism for this in the API, polling is the best we can do. This behaves roughly the same as other interruptible network functions in libavformat. (The original code would work if it returned AVERROR(EAGAIN) or so, which would make retry_transfer_wrapper() repeat the read call. But I think having an explicit loop for this is better anyway.) I also snuck in a fix for reconnect_at_eof. It has to check for AVERROR_EOF, not 0.
2017-11-17avformat/tcp: add option to enable TCP_NODELAYAman Gupta
This can reduce latency and increase throughput, particularly on high latency networks. Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Jeyapal, Karthick <kjeyapal@akamai.com>
2015-08-01lavf/network: split ff_listen_bind into ff_listen and ff_acceptStephan Holljes
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
2015-02-03avformat/network: Check for av_malloc* failures in ff_tls_init()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-16avformat/network: move sockaddr_union after sockaddr_storage compatibility codeMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-15avformat/network: add union for avoiding strict aliassing violations with ↵Michael Niedermayer
sockaddr* Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-25Merge commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f'Michael Niedermayer
* commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f': libavformat: use MSG_NOSIGNAL when applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-25libavformat: use MSG_NOSIGNAL when applicableRémi Denis-Courmont
If the remote end of a connection oriented socket hangs up, generating an EPIPE error is preferable over an unhandled SIGPIPE signal. Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-07Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: network.h: Add #endif comments to improve readability Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07network.h: Add #endif comments to improve readabilityDiego Biurrun
2013-08-10Merge commit '9d5ec50ead97e088d77317e77b18cef06cb3d053'Michael Niedermayer
* commit '9d5ec50ead97e088d77317e77b18cef06cb3d053': ff_socket: put out-of-line and fallback to fcntl() for close-on-exec Conflicts: libavformat/network.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-09ff_socket: put out-of-line and fallback to fcntl() for close-on-execRémi Denis-Courmont
This supports non-Linux systems (SOCK_CLOEXEC is non-standard) and older Linux kernels to the extent possible. Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-06Merge commit 'abe5268c3328bf0e8fcfb7dc6e231b8920177c3a'Michael Niedermayer
* commit 'abe5268c3328bf0e8fcfb7dc6e231b8920177c3a': tcp: Use a different log message and level if there's more addresses to try Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-06Merge commit 'bb9378251a167ef0116f263912e57f715c1e02ac'Michael Niedermayer
* commit 'bb9378251a167ef0116f263912e57f715c1e02ac': network: Use SOCK_CLOEXEC when available Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-06tcp: Use a different log message and level if there's more addresses to tryMartin Storsjö
This lowers the level of warnings printed if trying to connect to a host name that provides both v6 and v4 addresses but the service only is available on the v4 address (often occurring for 'localhost', with servers that aren't v6-aware). Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-05network: Use SOCK_CLOEXEC when availableLuca Barbato
2013-07-12ff_network_wait_fd_timeout(): check for interrupt before operationAndrey Utkin
Reviewed-by: Lukasz M <lukasz.m.luki@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-17Merge commit 'ec7c51c7868d3ccc66b5cc38bf126258b94f086c'Michael Niedermayer
* commit 'ec7c51c7868d3ccc66b5cc38bf126258b94f086c': avf: move ff_http_match_no_proxy to network Conflicts: libavformat/internal.h libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-16avf: move ff_http_match_no_proxy to networkLuca Barbato
It is only used by network protocols.
2013-06-05Merge commit '9835abb6d63fb07613994ae90e72fef758149408'Michael Niedermayer
* commit '9835abb6d63fb07613994ae90e72fef758149408': network: uniform ff_listen_bind and ff_listen_connect Conflicts: libavformat/network.c libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-04network: uniform ff_listen_bind and ff_listen_connectLuca Barbato
Document the functions and have both use a millisecond timeout and check for interrupt.
2013-06-02Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: network: factor out connect-listening code Conflicts: libavformat/network.h libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-02Merge commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f'Michael Niedermayer
* commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f': network: factor out bind-listening code use my full first name instead of short one in copyrights Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-01network: factor out connect-listening codeLuca Barbato
Introduce ff_listen_connect, to be shared with the other non-tcp network protocols.
2013-06-01network: factor out bind-listening codeLuca Barbato
Introduce ff_listen_bind, to be shared with the other non-tcp network protocols.
2012-10-24Merge commit '80521c1997a23e148edf89e11b939ab8646297ca'Michael Niedermayer
* commit '80521c1997a23e148edf89e11b939ab8646297ca': build: allow targets to specify extra objects to link with executables swscale: avoid pointless use of compound literals libm: add fallbacks for various single-precision functions network: use getservbyport() only if available network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLEN Include sys/time.h before sys/resource.h Conflicts: Makefile configure libavutil/libm.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-23network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLENMans Rullgard
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-17Merge commit 'a25d912dca9cd553440167e0476c47581359c0fc'Michael Niedermayer
* commit 'a25d912dca9cd553440167e0476c47581359c0fc': avcodec_encode_audio(): fix invalid free pcm-mpeg: correct bitrate calculation ffv1: K&R formatting cosmetics fate: Add rangecoder test network: #include stdint.h in network.h nut: export codec_tag provided by rawvideo avserver: move avserver-specific code from ffmdec.c to avserver.c Conflicts: ffserver.c libavcodec/ffv1.c libavformat/ffmdec.c libavformat/nutenc.c tests/ref/lavfi/crop tests/ref/lavfi/crop_scale tests/ref/lavfi/crop_scale_vflip tests/ref/lavfi/crop_vflip tests/ref/lavfi/null tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_crop tests/ref/lavfi/pixfmts_hflip tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_pad tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip tests/ref/lavfi/scale200 tests/ref/lavfi/scale500 tests/ref/lavfi/vflip tests/ref/lavfi/vflip_crop tests/ref/lavfi/vflip_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16network: #include stdint.h in network.hMans Rullgard
This header uses various types provided by stdint.h without explicitly including it. Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-09Introduce ff_network_wait_fd_timeout()Andrey Utkin
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-16Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: rtmp: rtmp_parse_result() add case for video and audio packets to avoid undesired debug output. configure: Move the getaddrinfo function check into the network block configure: Remove an unused 'have' item mpeg: remove disabled code libfdk-aac: Check if cutoff value is valid network: Always use our version of gai_strerror on windows network: Undefine existing gai_strerror definitions network: Extend the fallback gai_strerror implementation to handle more error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-15network: Always use our version of gai_strerror on windowsMartin Storsjö
Even if linking directly to getaddrinfo, use our version of gai_strerror instead of the system's version. Microsoft explicitly documents that their version of gai_strerror is thread-unsafe. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15network: Undefine existing gai_strerror definitionsMartin Storsjö
This avoids warnings if there already exists a definition. This is the case on windows, where the getaddrinfo isn't available and linked to (and we use our fallbacks instead, which actually try to use the proper getaddrinfo version if found at runtime), but gai_strerror still exists as a define. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15network: Extend the fallback gai_strerror implementation to handle more ↵Martin Storsjö
error codes This is useful if a proper getaddrinfo is loaded dynamically on windows, while using the fallback implementation of gai_strerror. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-27Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: avconv: add an assert to silence an uninitialized variable warning. avconv: shut up an uninitialized variable warning. avfiltergraph: shut up uninitialized variable warning. af_join: initialize a variable to shut up gcc warning. amix: fix format specifier for AVFilterLink.sample_rate. lavfi: make filters less verbose. mpc8: read APE tags. lavr: x86: fix ff_conv_fltp_to_flt_6ch function prototypes libm: provide fallback definition for cbrtf() using powf() network: Don't redefine error codes if they already exist in errno.h configure: Check for sys/time.h network: Include unistd.h from network.h avconv: don't include vsrc_buffer.h, which doesn't exist anymore lavfi: reorder AVFilterLink fields. lavfi: reorder AVFilterContext fields. lavfi: reorder AVFilter fields. lavfi: reorder AVFilterBufferRef fields. lavfi: reorder AVFilterBuffer fields. Conflicts: configure libavcodec/v210dec.h libavfilter/asrc_anullsrc.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_crop.c libavfilter/vf_drawbox.c libavfilter/vf_fade.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vsrc_color.c libavformat/network.h libavutil/libm.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-26network: Don't redefine error codes if they already exist in errno.hRonald S. Bultje
Since the errno.h values don't match the error codes that winsock returns, map the winsock error codes to the errno ones, to make sure explicit checks against AVERROR(x) match. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-26network: Include unistd.h from network.hMartin Storsjö
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>
2012-06-20Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: MS Screen 1 decoder aacdec: Fix popping channel layouts. av_gettime: support Win32 without gettimeofday() Use av_gettime() in various places Move av_gettime() to libavutil dct-test: use emms_c() from libavutil instead of duplicating it mov: fix operator precedence bug mathematics.h: remove a couple of math defines Remove unnecessary inclusions of [sys/]time.h lavf: remove unnecessary inclusions of unistd.h bfin: libswscale: add const where appropriate to fix warnings bfin: libswscale: remove unnecessary #includes udp: Properly check for invalid sockets tcp: Check the return value from getsockopt network: Use av_strerror for getting error messages udp: Properly print error from getnameinfo mmst: Use AVUNERROR() to convert error codes to the right range for strerror network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows rtmp: Reduce the number of idle posts sent by sleeping 50ms Conflicts: Changelog configure libavcodec/aacdec.c libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/dct-test.c libavcodec/version.h libavformat/riff.c libavformat/udp.c libavutil/Makefile libswscale/bfin/yuv2rgb_bfin.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-19network: Pass pointers of the right type to get/setsockopt/ioctlsocket on ↵Martin Storsjö
windows This avoids warnings. Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-03Remove some warnings when compiling with mingw (mingw-w64, 32 bits)Vincent Torri
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-08Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: avformat: Avoid a warning about mixed declarations and code BMV demuxer and decoder matroskaenc: Make sure the seekhead struct is freed even on seek failure mpeg12enc: Remove write-only variables. mpeg12enc: Don't set up run-level info for level 0. msmpeg4: Don't set up run-level info for level 0. avformat: Warn about using network functions without calling avformat_network_init avformat: Revise wording rdt: Set AVFMT_NOFILE on ff_rdt_demuxer rdt: Check the return value of avformat_open rtsp: Discard the dynamic handler, if it has an alloc function which failed dsputil: use cpuflags in x86 versions of vector_clip_int32() Conflicts: libavcodec/avcodec.h libavcodec/version.h libavformat/Makefile libavformat/allformats.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>