aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-24 12:53:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-24 12:53:26 +0200
commit2dbc93455c148bbd051549a7ed5c88fb08c853c5 (patch)
tree41461a4365556582fe991c06ed4624d4767ef05d
parentcccb45751e93142d71be78f6bb90bbfb50ee13be (diff)
parent80521c1997a23e148edf89e11b939ab8646297ca (diff)
downloadffmpeg-2dbc93455c148bbd051549a7ed5c88fb08c853c5.tar.gz
Merge commit '80521c1997a23e148edf89e11b939ab8646297ca'
* 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>
-rw-r--r--Makefile8
-rw-r--r--cmdutils.c1
-rwxr-xr-xconfigure11
-rw-r--r--ffmpeg.c1
-rw-r--r--libavcodec/aacps_tablegen.h1
-rw-r--r--libavformat/network.h8
-rw-r--r--libavformat/os_support.c2
-rw-r--r--libavutil/libm.h40
-rw-r--r--library.mak2
-rw-r--r--libswscale/swscale_unscaled.c17
10 files changed, 78 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index f1570cddc3..02e1a136d0 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
-OBJS = cmdutils.o
+OBJS = cmdutils.o $(EXEOBJS)
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
@@ -56,8 +56,8 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF)
$(CP) $< $@
$(STRIP) $@
-$(TOOLS): %$(EXESUF): %.o
- $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
+$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
+ $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
@@ -91,7 +91,7 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
define DOPROG
-OBJS-$(1) += $(1).o cmdutils.o
+OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS)
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
diff --git a/cmdutils.c b/cmdutils.c
index 39cc2dbea2..af24c4fcd5 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -54,6 +54,7 @@
#include "libavformat/network.h"
#endif
#if HAVE_SYS_RESOURCE_H
+#include <sys/time.h>
#include <sys/resource.h>
#endif
diff --git a/configure b/configure
index cf05d2f4d9..00aafc240d 100755
--- a/configure
+++ b/configure
@@ -1264,20 +1264,28 @@ HAVE_LIST_PUB='
'
MATH_FUNCS="
+ atanf
+ atan2f
cbrtf
+ cosf
exp2
exp2f
+ expf
isinf
isnan
+ ldexpf
llrint
llrintf
log2
log2f
+ log10f
lrint
lrintf
+ powf
rint
round
roundf
+ sinf
trunc
truncf
"
@@ -1331,6 +1339,7 @@ HAVE_LIST="
GetProcessTimes
GetSystemTimeAsFileTime
getrusage
+ getservbyport
gettimeofday
glob
gnu_as
@@ -3484,6 +3493,7 @@ if enabled network; then
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_type netinet/sctp.h "struct sctp_event_subscribe"
check_func getaddrinfo $network_extralibs
+ check_func getservbyport $network_extralibs
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
@@ -4206,6 +4216,7 @@ ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
+EXEOBJS=$exeobjs
INSTALL=$install
LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
diff --git a/ffmpeg.c b/ffmpeg.c
index a0e41bdf23..d12e51a865 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -69,6 +69,7 @@
# include "libavfilter/buffersink.h"
#if HAVE_SYS_RESOURCE_H
+#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#elif HAVE_GETPROCESSTIMES
diff --git a/libavcodec/aacps_tablegen.h b/libavcodec/aacps_tablegen.h
index a8c4021756..1f9c326d49 100644
--- a/libavcodec/aacps_tablegen.h
+++ b/libavcodec/aacps_tablegen.h
@@ -31,6 +31,7 @@
#include "libavcodec/aacps_tables.h"
#else
#include "libavutil/common.h"
+#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#define NR_ALLPASS_BANDS20 30
diff --git a/libavformat/network.h b/libavformat/network.h
index a766d03fcd..f8b4dee50e 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -201,6 +201,14 @@ const char *ff_gai_strerror(int ecode);
#define gai_strerror ff_gai_strerror
#endif
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN
#endif
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index bf6b8f29ca..ad1a23d0ed 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -236,8 +236,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
if (serv && servlen > 0) {
struct servent *ent = NULL;
+#if HAVE_GETSERVBYPORT
if (!(flags & NI_NUMERICSERV))
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp");
+#endif
if (ent)
snprintf(serv, servlen, "%s", ent->s_name);
diff --git a/libavutil/libm.h b/libavutil/libm.h
index d36420bc9b..bfcc21c5da 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -33,6 +33,21 @@
#include "libavutil/mips/libm_mips.h"
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM*/
+#if !HAVE_ATANF
+#undef atanf
+#define atanf(x) ((float)atan(x))
+#endif
+
+#if !HAVE_ATAN2F
+#undef atan2f
+#define atan2f(y, x) ((float)atan2(y, x))
+#endif
+
+#if !HAVE_POWF
+#undef powf
+#define powf(x, y) ((float)pow(x, y))
+#endif
+
#if !HAVE_CBRTF
static av_always_inline float cbrtf(float x)
{
@@ -40,6 +55,16 @@ static av_always_inline float cbrtf(float x)
}
#endif
+#if !HAVE_COSF
+#undef cosf
+#define cosf(x) ((float)cos(x))
+#endif
+
+#if !HAVE_EXPF
+#undef expf
+#define expf(x) ((float)exp(x))
+#endif
+
#if !HAVE_EXP2
#undef exp2
#define exp2(x) exp((x) * 0.693147180559945)
@@ -70,6 +95,11 @@ static av_always_inline av_const int isnan(float x)
}
#endif /* HAVE_ISNAN */
+#if !HAVE_LDEXPF
+#undef ldexpf
+#define ldexpf(x, exp) ((float)ldexp(x, exp))
+#endif
+
#if !HAVE_LLRINT
#undef llrint
#define llrint(x) ((long long)rint(x))
@@ -90,6 +120,16 @@ static av_always_inline av_const int isnan(float x)
#define log2f(x) ((float)log2(x))
#endif /* HAVE_LOG2F */
+#if !HAVE_LOG10F
+#undef log10f
+#define log10f(x) ((float)log10(x))
+#endif
+
+#if !HAVE_SINF
+#undef sinf
+#define sinf(x) ((float)sin(x))
+#endif
+
#if !HAVE_RINT
static inline double rint(double x)
{
diff --git a/library.mak b/library.mak
index 2728340d0c..c472404da5 100644
--- a/library.mak
+++ b/library.mak
@@ -36,7 +36,7 @@ define RULES
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
-$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
+$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index e27eaa1309..0fe974f054 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -451,6 +451,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
uint8_t *dst[], int dstStride[])
{
int alpha_first = 0;
+ const uint8_t *src102[] = { src[1], src[0], src[2] };
+ const uint8_t *src201[] = { src[2], src[0], src[1] };
+ int stride102[] = { srcStride[1], srcStride[0], srcStride[2] };
+ int stride201[] = { srcStride[2], srcStride[0], srcStride[1] };
+
if (c->srcFormat != AV_PIX_FMT_GBRP) {
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
av_get_pix_fmt_name(c->srcFormat),
@@ -460,15 +465,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
switch (c->dstFormat) {
case AV_PIX_FMT_BGR24:
- gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
- (int []) { srcStride[1], srcStride[0], srcStride[2] },
+ gbr24ptopacked24(src102, stride102,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
case AV_PIX_FMT_RGB24:
- gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },
- (int []) { srcStride[2], srcStride[0], srcStride[1] },
+ gbr24ptopacked24(src201, stride201,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
@@ -476,8 +479,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
case AV_PIX_FMT_ARGB:
alpha_first = 1;
case AV_PIX_FMT_RGBA:
- gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },
- (int []) { srcStride[2], srcStride[0], srcStride[1] },
+ gbr24ptopacked32(src201, stride201,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, alpha_first, c->srcW);
break;
@@ -485,8 +487,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
case AV_PIX_FMT_ABGR:
alpha_first = 1;
case AV_PIX_FMT_BGRA:
- gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },
- (int []) { srcStride[1], srcStride[0], srcStride[2] },
+ gbr24ptopacked32(src102, stride102,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, alpha_first, c->srcW);
break;