* 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>
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>
* 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>
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>
* 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>
* 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>
* 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>
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>
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>
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>
* 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>
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>
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>
* 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>
* 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>
This is to make developers aware of the fact that they will
start using the new init function at some point.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
http: Remove the custom function for disabling chunked posts
rtsp: Disable chunked http post through AVOptions
movdec: Set frame_size for AMR
h264_weight: remove duplication functions.
swscale: align vertical filtersize by 2 on x86.
libavfilter: reindent.
matroskadec: empty blocks are in fact valid.
avfilter: don't abort() on zero-size allocations.
h264: improve calculation of codec delay.
movenc: Set a correct packet size for AMR-NB mode 15, "no data"
avformat: Add functions for doing global network initialization
avformat: Add the https protocol
avformat: Add the tls protocol, using OpenSSL or gnutls
avformat: Initialize gnutls in ff_tls_init()
w32threads: Wrap the mutex functions in inline functions returning int
configure: Allow linking to the gnutls library
avformat: Add ff_tls_init()/deinit() that initialize OpenSSL
configure: Allow linking to openssl
avcodec: Allow locking and unlocking an avformat specific mutex
avformat: Split out functions from network.h to a new file, network.c
Conflicts:
Changelog
configure
doc/APIchanges
libavcodec/internal.h
libavcodec/version.h
libavfilter/formats.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
ARM: remove MULL inline asm
mathops: use MUL64 macro where it forms part of other ops
tty: factorise returning error codes.
rawdec: add framerate private option.
x11grab: add framerate private option.
fbdev,v4l2: remove some forgotten uses of AVFormatParameters.time_base.
bktr: don't error when AVFormatParameters.time_base isn't set.
cmdutils: add missing const qualifier
Skip headers not designed to work standalone during 'make checkheaders'.
Add missing #includes to make headers self-contained.
musepack: remove unnecessary #include from mpcdata.h
musepack: remove extraneous mpcdata.h inclusions
Fix error check in av_file_map()
Conflicts:
cmdutils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master: (31 commits)
ARM: add ARMv6 optimised av_clip_uintp2
ARM: remove volatile from asm statements in libavutil/intmath
ARM: fix av_clipl_int32_arm()
v4l: include avdevice.h
ffserver: move close_connection() call to avoid a temporary string and copy.
lavf: initialize demuxer private options.
AVOptions: set string default values.
lavdevice: mark v4l for removal on next major bump.
swscale: fix compile on ppc.
swscale: fix compile on x86-32.
build: Remove generated .version file on distclean.
configure: Add -D_GNU_SOURCE to CPPFLAGS on OS/2.
doc: Drop hint at --enable-memalign-hack for MinGW, it is now autodetected.
ffplay: Remove disabled code.
Mark parameterless function declarations as 'void'.
swscale: use av_clip_uint8() in yuv2yuv1_c().
swscale: remove VOF/VOFW.
swscale: split chroma buffers into separate U/V planes.
swscale: replace formatConvBuffer[VOF] by allocated array.
rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
...
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
LOTS of duplicates ...
avio: Fix the deprecated fallback URL-prefixed open flags
avoid duplicate -lm in .pc files
mpeg12: terminate mpeg2_video_profiles arrays
network: Check POLLERR and POLLHUP in ff_network_wait_fd
mpegtsenc: make PMT PID really start on pmt_start_pid
nut format: support PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
rawvideo codec: support PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
hflip: make the filter accept PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
crop: make the filter accept PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementation
Conflicts:
configure
libswscale/swscale.h
tests/ref/lavf/ts
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Previously, the function would lead to an infinite wait (by
returning AVERROR(EAGAIN)) on sockets indicating an error
via either of these poll flags.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
proto: include os_support.h in network.h
matroskaenc: don't write an empty Cues element.
lavc: add a FF_API_REQUEST_CHANNELS deprecation macro
avio: move extern url_interrupt_cb declaration from avio.h to url.h
avio: make av_register_protocol2 internal.
avio: avio_ prefix for url_set_interrupt_cb.
avio: AVIO_ prefixes for URL_ open flags.
proto: introduce listen option in tcp
doc: clarify configure features
proto: factor ff_network_wait_fd and use it on udp
Conflicts:
ffmpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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.
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>
(cherry picked from commit 28c4741a66)
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>
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
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