* 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>
... | ... |
@@ -17,7 +17,7 @@ PROGS-$(CONFIG_FFSERVER) += ffserver |
17 | 17 |
|
18 | 18 |
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF)) |
19 | 19 |
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF)) |
20 |
-OBJS = cmdutils.o |
|
20 |
+OBJS = cmdutils.o $(EXEOBJS) |
|
21 | 21 |
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o |
22 | 22 |
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 |
23 | 23 |
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options |
... | ... |
@@ -56,8 +56,8 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF) |
56 | 56 |
$(CP) $< $@ |
57 | 57 |
$(STRIP) $@ |
58 | 58 |
|
59 |
-$(TOOLS): %$(EXESUF): %.o |
|
60 |
- $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS) |
|
59 |
+$(TOOLS): %$(EXESUF): %.o $(EXEOBJS) |
|
60 |
+ $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS) |
|
61 | 61 |
|
62 | 62 |
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) |
63 | 63 |
|
... | ... |
@@ -91,7 +91,7 @@ endef |
91 | 91 |
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) |
92 | 92 |
|
93 | 93 |
define DOPROG |
94 |
-OBJS-$(1) += $(1).o cmdutils.o |
|
94 |
+OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS) |
|
95 | 95 |
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1)) |
96 | 96 |
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) |
97 | 97 |
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) |
... | ... |
@@ -1264,20 +1264,28 @@ HAVE_LIST_PUB=' |
1264 | 1264 |
' |
1265 | 1265 |
|
1266 | 1266 |
MATH_FUNCS=" |
1267 |
+ atanf |
|
1268 |
+ atan2f |
|
1267 | 1269 |
cbrtf |
1270 |
+ cosf |
|
1268 | 1271 |
exp2 |
1269 | 1272 |
exp2f |
1273 |
+ expf |
|
1270 | 1274 |
isinf |
1271 | 1275 |
isnan |
1276 |
+ ldexpf |
|
1272 | 1277 |
llrint |
1273 | 1278 |
llrintf |
1274 | 1279 |
log2 |
1275 | 1280 |
log2f |
1281 |
+ log10f |
|
1276 | 1282 |
lrint |
1277 | 1283 |
lrintf |
1284 |
+ powf |
|
1278 | 1285 |
rint |
1279 | 1286 |
round |
1280 | 1287 |
roundf |
1288 |
+ sinf |
|
1281 | 1289 |
trunc |
1282 | 1290 |
truncf |
1283 | 1291 |
" |
... | ... |
@@ -1331,6 +1339,7 @@ HAVE_LIST=" |
1331 | 1331 |
GetProcessTimes |
1332 | 1332 |
GetSystemTimeAsFileTime |
1333 | 1333 |
getrusage |
1334 |
+ getservbyport |
|
1334 | 1335 |
gettimeofday |
1335 | 1336 |
glob |
1336 | 1337 |
gnu_as |
... | ... |
@@ -3484,6 +3493,7 @@ if enabled network; then |
3484 | 3484 |
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len |
3485 | 3485 |
check_type netinet/sctp.h "struct sctp_event_subscribe" |
3486 | 3486 |
check_func getaddrinfo $network_extralibs |
3487 |
+ check_func getservbyport $network_extralibs |
|
3487 | 3488 |
# Prefer arpa/inet.h over winsock2 |
3488 | 3489 |
if check_header arpa/inet.h ; then |
3489 | 3490 |
check_func closesocket |
... | ... |
@@ -4206,6 +4216,7 @@ ZLIB=$($ldflags_filter -lz) |
4206 | 4206 |
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD |
4207 | 4207 |
EXTRALIBS=$extralibs |
4208 | 4208 |
COMPAT_OBJS=$compat_objs |
4209 |
+EXEOBJS=$exeobjs |
|
4209 | 4210 |
INSTALL=$install |
4210 | 4211 |
LIBTARGET=${LIBTARGET} |
4211 | 4212 |
SLIBNAME=${SLIBNAME} |
... | ... |
@@ -201,6 +201,14 @@ const char *ff_gai_strerror(int ecode); |
201 | 201 |
#define gai_strerror ff_gai_strerror |
202 | 202 |
#endif |
203 | 203 |
|
204 |
+#ifndef INADDR_LOOPBACK |
|
205 |
+#define INADDR_LOOPBACK 0x7f000001 |
|
206 |
+#endif |
|
207 |
+ |
|
208 |
+#ifndef INET_ADDRSTRLEN |
|
209 |
+#define INET_ADDRSTRLEN 16 |
|
210 |
+#endif |
|
211 |
+ |
|
204 | 212 |
#ifndef INET6_ADDRSTRLEN |
205 | 213 |
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN |
206 | 214 |
#endif |
... | ... |
@@ -236,8 +236,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen, |
236 | 236 |
|
237 | 237 |
if (serv && servlen > 0) { |
238 | 238 |
struct servent *ent = NULL; |
239 |
+#if HAVE_GETSERVBYPORT |
|
239 | 240 |
if (!(flags & NI_NUMERICSERV)) |
240 | 241 |
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp"); |
242 |
+#endif |
|
241 | 243 |
|
242 | 244 |
if (ent) |
243 | 245 |
snprintf(serv, servlen, "%s", ent->s_name); |
... | ... |
@@ -33,6 +33,21 @@ |
33 | 33 |
#include "libavutil/mips/libm_mips.h" |
34 | 34 |
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM*/ |
35 | 35 |
|
36 |
+#if !HAVE_ATANF |
|
37 |
+#undef atanf |
|
38 |
+#define atanf(x) ((float)atan(x)) |
|
39 |
+#endif |
|
40 |
+ |
|
41 |
+#if !HAVE_ATAN2F |
|
42 |
+#undef atan2f |
|
43 |
+#define atan2f(y, x) ((float)atan2(y, x)) |
|
44 |
+#endif |
|
45 |
+ |
|
46 |
+#if !HAVE_POWF |
|
47 |
+#undef powf |
|
48 |
+#define powf(x, y) ((float)pow(x, y)) |
|
49 |
+#endif |
|
50 |
+ |
|
36 | 51 |
#if !HAVE_CBRTF |
37 | 52 |
static av_always_inline float cbrtf(float x) |
38 | 53 |
{ |
... | ... |
@@ -40,6 +55,16 @@ static av_always_inline float cbrtf(float x) |
40 | 40 |
} |
41 | 41 |
#endif |
42 | 42 |
|
43 |
+#if !HAVE_COSF |
|
44 |
+#undef cosf |
|
45 |
+#define cosf(x) ((float)cos(x)) |
|
46 |
+#endif |
|
47 |
+ |
|
48 |
+#if !HAVE_EXPF |
|
49 |
+#undef expf |
|
50 |
+#define expf(x) ((float)exp(x)) |
|
51 |
+#endif |
|
52 |
+ |
|
43 | 53 |
#if !HAVE_EXP2 |
44 | 54 |
#undef exp2 |
45 | 55 |
#define exp2(x) exp((x) * 0.693147180559945) |
... | ... |
@@ -70,6 +95,11 @@ static av_always_inline av_const int isnan(float x) |
70 | 70 |
} |
71 | 71 |
#endif /* HAVE_ISNAN */ |
72 | 72 |
|
73 |
+#if !HAVE_LDEXPF |
|
74 |
+#undef ldexpf |
|
75 |
+#define ldexpf(x, exp) ((float)ldexp(x, exp)) |
|
76 |
+#endif |
|
77 |
+ |
|
73 | 78 |
#if !HAVE_LLRINT |
74 | 79 |
#undef llrint |
75 | 80 |
#define llrint(x) ((long long)rint(x)) |
... | ... |
@@ -90,6 +120,16 @@ static av_always_inline av_const int isnan(float x) |
90 | 90 |
#define log2f(x) ((float)log2(x)) |
91 | 91 |
#endif /* HAVE_LOG2F */ |
92 | 92 |
|
93 |
+#if !HAVE_LOG10F |
|
94 |
+#undef log10f |
|
95 |
+#define log10f(x) ((float)log10(x)) |
|
96 |
+#endif |
|
97 |
+ |
|
98 |
+#if !HAVE_SINF |
|
99 |
+#undef sinf |
|
100 |
+#define sinf(x) ((float)sin(x)) |
|
101 |
+#endif |
|
102 |
+ |
|
93 | 103 |
#if !HAVE_RINT |
94 | 104 |
static inline double rint(double x) |
95 | 105 |
{ |
... | ... |
@@ -36,7 +36,7 @@ define RULES |
36 | 36 |
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB)) |
37 | 37 |
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) |
38 | 38 |
|
39 |
-$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o |
|
39 |
+$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) |
|
40 | 40 |
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS) |
41 | 41 |
|
42 | 42 |
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) |
... | ... |
@@ -451,6 +451,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], |
451 | 451 |
uint8_t *dst[], int dstStride[]) |
452 | 452 |
{ |
453 | 453 |
int alpha_first = 0; |
454 |
+ const uint8_t *src102[] = { src[1], src[0], src[2] }; |
|
455 |
+ const uint8_t *src201[] = { src[2], src[0], src[1] }; |
|
456 |
+ int stride102[] = { srcStride[1], srcStride[0], srcStride[2] }; |
|
457 |
+ int stride201[] = { srcStride[2], srcStride[0], srcStride[1] }; |
|
458 |
+ |
|
454 | 459 |
if (c->srcFormat != AV_PIX_FMT_GBRP) { |
455 | 460 |
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n", |
456 | 461 |
av_get_pix_fmt_name(c->srcFormat), |
... | ... |
@@ -460,15 +465,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], |
460 | 460 |
|
461 | 461 |
switch (c->dstFormat) { |
462 | 462 |
case AV_PIX_FMT_BGR24: |
463 |
- gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] }, |
|
464 |
- (int []) { srcStride[1], srcStride[0], srcStride[2] }, |
|
463 |
+ gbr24ptopacked24(src102, stride102, |
|
465 | 464 |
dst[0] + srcSliceY * dstStride[0], dstStride[0], |
466 | 465 |
srcSliceH, c->srcW); |
467 | 466 |
break; |
468 | 467 |
|
469 | 468 |
case AV_PIX_FMT_RGB24: |
470 |
- gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] }, |
|
471 |
- (int []) { srcStride[2], srcStride[0], srcStride[1] }, |
|
469 |
+ gbr24ptopacked24(src201, stride201, |
|
472 | 470 |
dst[0] + srcSliceY * dstStride[0], dstStride[0], |
473 | 471 |
srcSliceH, c->srcW); |
474 | 472 |
break; |
... | ... |
@@ -476,8 +479,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], |
476 | 476 |
case AV_PIX_FMT_ARGB: |
477 | 477 |
alpha_first = 1; |
478 | 478 |
case AV_PIX_FMT_RGBA: |
479 |
- gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] }, |
|
480 |
- (int []) { srcStride[2], srcStride[0], srcStride[1] }, |
|
479 |
+ gbr24ptopacked32(src201, stride201, |
|
481 | 480 |
dst[0] + srcSliceY * dstStride[0], dstStride[0], |
482 | 481 |
srcSliceH, alpha_first, c->srcW); |
483 | 482 |
break; |
... | ... |
@@ -485,8 +487,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], |
485 | 485 |
case AV_PIX_FMT_ABGR: |
486 | 486 |
alpha_first = 1; |
487 | 487 |
case AV_PIX_FMT_BGRA: |
488 |
- gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] }, |
|
489 |
- (int []) { srcStride[1], srcStride[0], srcStride[2] }, |
|
488 |
+ gbr24ptopacked32(src102, stride102, |
|
490 | 489 |
dst[0] + srcSliceY * dstStride[0], dstStride[0], |
491 | 490 |
srcSliceH, alpha_first, c->srcW); |
492 | 491 |
break; |