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>
This commit is contained in:
commit
2dbc93455c
8
Makefile
8
Makefile
@ -17,7 +17,7 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
|
|||||||
|
|
||||||
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
||||||
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
|
||||||
OBJS = cmdutils.o
|
OBJS = cmdutils.o $(EXEOBJS)
|
||||||
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
|
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
|
||||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
||||||
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
||||||
@ -56,8 +56,8 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF)
|
|||||||
$(CP) $< $@
|
$(CP) $< $@
|
||||||
$(STRIP) $@
|
$(STRIP) $@
|
||||||
|
|
||||||
$(TOOLS): %$(EXESUF): %.o
|
$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
|
||||||
$(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
|
$(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
|
||||||
|
|
||||||
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
|
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ endef
|
|||||||
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
||||||
|
|
||||||
define DOPROG
|
define DOPROG
|
||||||
OBJS-$(1) += $(1).o cmdutils.o
|
OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS)
|
||||||
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
|
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
|
||||||
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
|
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
|
||||||
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
|
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "libavformat/network.h"
|
#include "libavformat/network.h"
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_SYS_RESOURCE_H
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
11
configure
vendored
11
configure
vendored
@ -1264,20 +1264,28 @@ HAVE_LIST_PUB='
|
|||||||
'
|
'
|
||||||
|
|
||||||
MATH_FUNCS="
|
MATH_FUNCS="
|
||||||
|
atanf
|
||||||
|
atan2f
|
||||||
cbrtf
|
cbrtf
|
||||||
|
cosf
|
||||||
exp2
|
exp2
|
||||||
exp2f
|
exp2f
|
||||||
|
expf
|
||||||
isinf
|
isinf
|
||||||
isnan
|
isnan
|
||||||
|
ldexpf
|
||||||
llrint
|
llrint
|
||||||
llrintf
|
llrintf
|
||||||
log2
|
log2
|
||||||
log2f
|
log2f
|
||||||
|
log10f
|
||||||
lrint
|
lrint
|
||||||
lrintf
|
lrintf
|
||||||
|
powf
|
||||||
rint
|
rint
|
||||||
round
|
round
|
||||||
roundf
|
roundf
|
||||||
|
sinf
|
||||||
trunc
|
trunc
|
||||||
truncf
|
truncf
|
||||||
"
|
"
|
||||||
@ -1331,6 +1339,7 @@ HAVE_LIST="
|
|||||||
GetProcessTimes
|
GetProcessTimes
|
||||||
GetSystemTimeAsFileTime
|
GetSystemTimeAsFileTime
|
||||||
getrusage
|
getrusage
|
||||||
|
getservbyport
|
||||||
gettimeofday
|
gettimeofday
|
||||||
glob
|
glob
|
||||||
gnu_as
|
gnu_as
|
||||||
@ -3484,6 +3493,7 @@ if enabled network; then
|
|||||||
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
|
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
|
||||||
check_type netinet/sctp.h "struct sctp_event_subscribe"
|
check_type netinet/sctp.h "struct sctp_event_subscribe"
|
||||||
check_func getaddrinfo $network_extralibs
|
check_func getaddrinfo $network_extralibs
|
||||||
|
check_func getservbyport $network_extralibs
|
||||||
# Prefer arpa/inet.h over winsock2
|
# Prefer arpa/inet.h over winsock2
|
||||||
if check_header arpa/inet.h ; then
|
if check_header arpa/inet.h ; then
|
||||||
check_func closesocket
|
check_func closesocket
|
||||||
@ -4206,6 +4216,7 @@ ZLIB=$($ldflags_filter -lz)
|
|||||||
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
|
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
|
||||||
EXTRALIBS=$extralibs
|
EXTRALIBS=$extralibs
|
||||||
COMPAT_OBJS=$compat_objs
|
COMPAT_OBJS=$compat_objs
|
||||||
|
EXEOBJS=$exeobjs
|
||||||
INSTALL=$install
|
INSTALL=$install
|
||||||
LIBTARGET=${LIBTARGET}
|
LIBTARGET=${LIBTARGET}
|
||||||
SLIBNAME=${SLIBNAME}
|
SLIBNAME=${SLIBNAME}
|
||||||
|
1
ffmpeg.c
1
ffmpeg.c
@ -69,6 +69,7 @@
|
|||||||
# include "libavfilter/buffersink.h"
|
# include "libavfilter/buffersink.h"
|
||||||
|
|
||||||
#if HAVE_SYS_RESOURCE_H
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#elif HAVE_GETPROCESSTIMES
|
#elif HAVE_GETPROCESSTIMES
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "libavcodec/aacps_tables.h"
|
#include "libavcodec/aacps_tables.h"
|
||||||
#else
|
#else
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
|
#include "libavutil/libm.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
#define NR_ALLPASS_BANDS20 30
|
#define NR_ALLPASS_BANDS20 30
|
||||||
|
@ -201,6 +201,14 @@ const char *ff_gai_strerror(int ecode);
|
|||||||
#define gai_strerror ff_gai_strerror
|
#define gai_strerror ff_gai_strerror
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef INADDR_LOOPBACK
|
||||||
|
#define INADDR_LOOPBACK 0x7f000001
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef INET_ADDRSTRLEN
|
||||||
|
#define INET_ADDRSTRLEN 16
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef INET6_ADDRSTRLEN
|
#ifndef INET6_ADDRSTRLEN
|
||||||
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN
|
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN
|
||||||
#endif
|
#endif
|
||||||
|
@ -236,8 +236,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,
|
|||||||
|
|
||||||
if (serv && servlen > 0) {
|
if (serv && servlen > 0) {
|
||||||
struct servent *ent = NULL;
|
struct servent *ent = NULL;
|
||||||
|
#if HAVE_GETSERVBYPORT
|
||||||
if (!(flags & NI_NUMERICSERV))
|
if (!(flags & NI_NUMERICSERV))
|
||||||
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp");
|
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ent)
|
if (ent)
|
||||||
snprintf(serv, servlen, "%s", ent->s_name);
|
snprintf(serv, servlen, "%s", ent->s_name);
|
||||||
|
@ -33,6 +33,21 @@
|
|||||||
#include "libavutil/mips/libm_mips.h"
|
#include "libavutil/mips/libm_mips.h"
|
||||||
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM*/
|
#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
|
#if !HAVE_CBRTF
|
||||||
static av_always_inline float cbrtf(float x)
|
static av_always_inline float cbrtf(float x)
|
||||||
{
|
{
|
||||||
@ -40,6 +55,16 @@ static av_always_inline float cbrtf(float x)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
#if !HAVE_EXP2
|
||||||
#undef exp2
|
#undef exp2
|
||||||
#define exp2(x) exp((x) * 0.693147180559945)
|
#define exp2(x) exp((x) * 0.693147180559945)
|
||||||
@ -70,6 +95,11 @@ static av_always_inline av_const int isnan(float x)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_ISNAN */
|
#endif /* HAVE_ISNAN */
|
||||||
|
|
||||||
|
#if !HAVE_LDEXPF
|
||||||
|
#undef ldexpf
|
||||||
|
#define ldexpf(x, exp) ((float)ldexp(x, exp))
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !HAVE_LLRINT
|
#if !HAVE_LLRINT
|
||||||
#undef llrint
|
#undef llrint
|
||||||
#define llrint(x) ((long long)rint(x))
|
#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))
|
#define log2f(x) ((float)log2(x))
|
||||||
#endif /* HAVE_LOG2F */
|
#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
|
#if !HAVE_RINT
|
||||||
static inline double rint(double x)
|
static inline double rint(double x)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ define RULES
|
|||||||
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
|
$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
|
||||||
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
|
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
|
||||||
|
|
||||||
$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
|
$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
|
||||||
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
|
$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
|
||||||
|
|
||||||
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
|
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
|
||||||
|
@ -451,6 +451,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
uint8_t *dst[], int dstStride[])
|
uint8_t *dst[], int dstStride[])
|
||||||
{
|
{
|
||||||
int alpha_first = 0;
|
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) {
|
if (c->srcFormat != AV_PIX_FMT_GBRP) {
|
||||||
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
|
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
|
||||||
av_get_pix_fmt_name(c->srcFormat),
|
av_get_pix_fmt_name(c->srcFormat),
|
||||||
@ -460,15 +465,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
|
|
||||||
switch (c->dstFormat) {
|
switch (c->dstFormat) {
|
||||||
case AV_PIX_FMT_BGR24:
|
case AV_PIX_FMT_BGR24:
|
||||||
gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
|
gbr24ptopacked24(src102, stride102,
|
||||||
(int []) { srcStride[1], srcStride[0], srcStride[2] },
|
|
||||||
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
||||||
srcSliceH, c->srcW);
|
srcSliceH, c->srcW);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AV_PIX_FMT_RGB24:
|
case AV_PIX_FMT_RGB24:
|
||||||
gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },
|
gbr24ptopacked24(src201, stride201,
|
||||||
(int []) { srcStride[2], srcStride[0], srcStride[1] },
|
|
||||||
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
||||||
srcSliceH, c->srcW);
|
srcSliceH, c->srcW);
|
||||||
break;
|
break;
|
||||||
@ -476,8 +479,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
case AV_PIX_FMT_ARGB:
|
case AV_PIX_FMT_ARGB:
|
||||||
alpha_first = 1;
|
alpha_first = 1;
|
||||||
case AV_PIX_FMT_RGBA:
|
case AV_PIX_FMT_RGBA:
|
||||||
gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },
|
gbr24ptopacked32(src201, stride201,
|
||||||
(int []) { srcStride[2], srcStride[0], srcStride[1] },
|
|
||||||
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
||||||
srcSliceH, alpha_first, c->srcW);
|
srcSliceH, alpha_first, c->srcW);
|
||||||
break;
|
break;
|
||||||
@ -485,8 +487,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
case AV_PIX_FMT_ABGR:
|
case AV_PIX_FMT_ABGR:
|
||||||
alpha_first = 1;
|
alpha_first = 1;
|
||||||
case AV_PIX_FMT_BGRA:
|
case AV_PIX_FMT_BGRA:
|
||||||
gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },
|
gbr24ptopacked32(src102, stride102,
|
||||||
(int []) { srcStride[1], srcStride[0], srcStride[2] },
|
|
||||||
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
dst[0] + srcSliceY * dstStride[0], dstStride[0],
|
||||||
srcSliceH, alpha_first, c->srcW);
|
srcSliceH, alpha_first, c->srcW);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user