Commit Graph

50 Commits

Author SHA1 Message Date
Michael Niedermayer 9db747b2a3 Merge remote-tracking branch 'qatar/master'
* 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-16 20:45:41 +02:00
Martin Storsjö 9e4b04f8b9 network: Always use our version of gai_strerror on windows
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-15 21:41:38 +03:00
Martin Storsjö c98e2053f5 network: Undefine existing gai_strerror definitions
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-15 21:41:28 +03:00
Martin Storsjö 2ca6e9bb47 network: Extend the fallback gai_strerror implementation to handle more 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-07-15 21:21:59 +03:00
Michael Niedermayer b536e2facf Merge remote-tracking branch 'qatar/master'
* 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-27 01:58:09 +02:00
Ronald S. Bultje 4b1b1449d9 network: Don't redefine error codes if they already exist in errno.h
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-26 17:22:21 +03:00
Martin Storsjö 39dba5aa1b network: Include unistd.h from network.h
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-26 17:22:21 +03:00
Michael Niedermayer 4da42ebe44 Merge remote-tracking branch 'qatar/master'
* 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-20 20:47:46 +02:00
Martin Storsjö 561687696f network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
This avoids warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-19 20:22:47 +03:00
Vincent Torri ed3c0fe85d Remove some warnings when compiling with mingw (mingw-w64, 32 bits)
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-03 19:51:13 +01:00
Michael Niedermayer 0bd42ae72c Merge remote-tracking branch 'qatar/master'
* 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>
2011-11-08 02:03:14 +01:00
Martin Storsjö ce145690b6 avformat: Warn about using network functions without calling avformat_network_init
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>
2011-11-07 19:29:33 +02:00
Michael Niedermayer d8cab5c26b Merge remote-tracking branch 'qatar/master'
* 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>
2011-11-06 02:23:34 +01:00
Martin Storsjö 48e59ad8e7 avformat: Add ff_tls_init()/deinit() that initialize OpenSSL
If the application hasn't set up mutex callbacks, we set up
our own using pthreads (or w32pthreads).

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-05 12:08:59 +02:00
Martin Storsjö f6d3710096 avformat: Split out functions from network.h to a new file, network.c
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-05 12:08:47 +02:00
Michael Niedermayer 46eb300d01 Merge remote-tracking branch 'qatar/master'
* 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>
2011-06-05 03:00:31 +02:00
Diego Biurrun 8d459acc10 Add missing #includes to make headers self-contained.
This fixes 'make checkheaders'.
2011-06-04 18:15:50 +02:00
Michael Niedermayer 027264cb82 Merge remote-tracking branch 'qatar/master'
* 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>
2011-05-27 02:53:21 +02:00
Diego Biurrun e169428529 Mark parameterless function declarations as 'void'. 2011-05-26 16:26:17 +02:00
Michael Niedermayer 455ce979d0 Merge remote branch 'qatar/master'
* 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>
2011-04-29 04:29:21 +02:00
Gil Pedersen f2c85458c4 network: Check POLLERR and POLLHUP in ff_network_wait_fd
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>
2011-04-28 10:28:51 +03:00
Michael Niedermayer c88caa522c Merge remote branch 'qatar/master'
* 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>
2011-04-08 02:50:13 +02:00
Luca Barbato a2031251c7 proto: include os_support.h in network.h
Fix compilation on systems without poll()
2011-04-07 21:03:12 +02:00
Luca Barbato ebba2b3e2a proto: factor ff_network_wait_fd and use it on udp
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.
2011-04-07 02:53:55 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Martin Storsjö c24a403496 libavformat: Remove FF_NETERRNO()
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)
2011-02-23 18:22:03 +01:00
Martin Storsjö 28c4741a66 libavformat: Remove FF_NETERRNO()
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>
2011-02-23 07:21:31 -05:00
Martin Storsjö 55b6bd1c01 Convert ff_is_multicast_address to take a struct sockaddr parameter
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
2010-10-07 07:58:56 +00:00
Martin Storsjö 7ac57fa5eb Share the is_multicast_address function
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
2010-10-07 07:54:52 +00:00
Martin Storsjö f63630cdf3 Move multicast address identification fallback macros to network.h from udp.c
Originally committed as revision 25386 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-07 07:53:31 +00:00
Ronald S. Bultje f0d8ac529f Move INET6_ADDRSTRLEN to network.h, similar to other network-related fixups
for broken OSes. This is included in rtsp.h, as opposed to os_support.h.
Should fix OS/2 broken build on fate.

Originally committed as revision 25035 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-03 20:06:01 +00:00
Ronald S. Bultje 4aecee7fc3 Fix compile error on mingw where ETIMEDOUT is missing (because it's a WSA error).
This patch also changes FF_NETERROR() to be an AVERROR(), i.e. it is always
negative, whereas it was previously positive.

Originally committed as revision 22887 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-15 18:27:27 +00:00
David Conrad ac11d562e5 Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c
Originally committed as revision 22284 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-07 19:48:59 +00:00
Ronald S. Bultje 04a2b04b98 Implement gai_strerror() for systems lacking such functionality. Patch
by KO Myung-Hun <komh challion net>.

Originally committed as revision 21692 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-02-08 18:48:12 +00:00
Martin Storsjö 3d7b42f97b Use the configure check from r21351 and use it to properly define struct
sockaddr (in case it's not missing) so it always works on the system that
we are defining it for, in a RFC-2553/3493-compliant way (i.e. containing
a ss_family field). which is used in udp.c. Patch by Martin Storsjö
<$firstname $firstname st>.

Originally committed as revision 21352 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-20 17:26:14 +00:00
Martin Storsjö 5d629b72cb Provide a fallback for getnameinfo() also. Patch by Martin Storsjö
<$firstname()$firstname,st>.

Originally committed as revision 21150 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-11 17:45:17 +00:00
Martin Storsjö 34a65f1fdd Implement a fallback for struct sockaddr_storage if not available.
Patch by Martin Storsjö <$firstname()$firstname,st>.

Originally committed as revision 21149 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-11 17:42:35 +00:00
Martin Storsjö fa053ca725 Provide fallback implementations of getaddrinfo() and freeaddrinfo().
Patch by Martin Storsjö <$firstname()$firstname,st>.

Originally committed as revision 21145 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-11 17:27:07 +00:00
Diego Biurrun da837937c6 Fix undefined preprocessor directives warnings during 'make checkheaders'.
Originally committed as revision 16747 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-24 14:52:46 +00:00
Diego Biurrun 406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Aurelien Jacobs b250f9c66d Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.

Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-13 23:44:16 +00:00
Stefano Sabatini 987903826b Globally rename the header inclusion guard names.
Consistently apply this rule: the guard name is obtained from the
filename by stripping the leading "lib", converting '/' and '.'  to
'_' and uppercasing the resulting name. Guard names in the root
directory have to be prefixed by "FFMPEG_".

Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-08-31 07:39:47 +00:00
Diego Biurrun 5b21bdabe4 Add FFMPEG_ prefix to all multiple inclusion guards.
Originally committed as revision 10765 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-10-17 09:37:46 +00:00
Ramiro Polla 1642cb6b2e Add initialization and cleanup functions for Winsock
Originally committed as revision 10040 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-08-09 23:39:05 +00:00
Ramiro Polla 6ff3f3e7ce Check for winsock2.h instead of __MINGW32__
Originally committed as revision 9988 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-08-08 19:18:10 +00:00
Alex Beregszaszi 5676d140a9 initial mingw networking support
Originally committed as revision 9029 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-05-15 14:58:30 +00:00
Alex Beregszaszi ba472aaf01 implement ff_socket_nonblock and use it in networking code
Originally committed as revision 8846 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-04-27 00:41:50 +00:00
Alex Beregszaszi 8da4034f52 use ff_neterrno() and FF_NETERROR() for networking error handling
Originally committed as revision 8845 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-04-27 00:35:54 +00:00
François Revol c9fdab0dab Some more BeOS cleanup: check for arpa/inet.h; declare the prototype for inet_aton if not found; remove barpainet.h as it's not longer needed.
Originally committed as revision 8488 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-03-23 22:01:37 +00:00
Ramiro Polla 42572ef53f move networking #includes into separate file
patch by Ramiro Polla angustia =a= arrozcru =d= no-ip =d= org

Originally committed as revision 7817 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-02-04 17:05:44 +00:00