Commit fd0bc419 authored by Henri Fallon's avatar Henri Fallon

lpcm support (tested on 1 source only)

parent f213a1d6
......@@ -37,18 +37,18 @@ dnl Check for GNU make
dnl
AC_PATH_PROG(GMAKE, gmake, no)
if test "x${GMAKE}" = "xno"; then
AC_CACHE_CHECK([whether GNU make is installed],
[ac_cv_gmake],
[if make --version | grep -q -i gnu; then
ac_cv_gmake="yes"
else
echo "This software needs you to install GNU make to compile properly."
echo "You can get it from http://www.gnu.org/."
exit
fi])
VLC_MAKE="make"
AC_CACHE_CHECK([whether GNU make is installed],
[ac_cv_gmake],
[if make --version | grep -q -i gnu; then
ac_cv_gmake="yes"
else
echo "This software needs you to install GNU make to compile properly."
echo "You can get it from http://www.gnu.org/."
exit
fi])
VLC_MAKE="make"
else
VLC_MAKE="gmake"
VLC_MAKE="gmake"
fi
dnl Gettext stuff
......@@ -72,66 +72,66 @@ dnl
dnl Check the operating system
dnl
case "x${target_os}" in
x)
SYS=unknown
;;
xlinux*)
SYS=linux
;;
xbsdi*)
SYS=bsdi
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
;;
x*bsd*)
SYS="${target_os}"
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
;;
xdarwin*)
SYS=darwin
save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
;;
x*mingw32*)
SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :)
save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
http_LDFLAGS="${http_LDFLAGS} -lws2_32"
rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
;;
x*nto*)
SYS=nto
x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
;;
xsolaris*)
SYS=solaris
;;
xbeos)
SYS=beos
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -lstdc++.r4"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
;;
x*)
SYS="${target_os}"
;;
x)
SYS=unknown
;;
xlinux*)
SYS=linux
;;
xbsdi*)
SYS=bsdi
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
;;
x*bsd*)
SYS="${target_os}"
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
;;
xdarwin*)
SYS=darwin
save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
;;
x*mingw32*)
SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :)
save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
http_LDFLAGS="${http_LDFLAGS} -lws2_32"
rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
;;
x*nto*)
SYS=nto
x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
;;
xsolaris*)
SYS=solaris
;;
xbeos)
SYS=beos
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -lstdc++.r4"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
;;
x*)
SYS="${target_os}"
;;
esac
dnl Flags for plugin compilation
if test "x${SYS}" = "xmingw32"
then
plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
else
plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
fi
dnl The -DSYS_FOO flag
......@@ -141,17 +141,17 @@ dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
AC_CHECK_FUNC(connect,,[
AC_CHECK_LIB(socket,connect,
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
AC_CHECK_LIB(socket,connect,
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
)])
AC_CHECK_FUNC(send,,[
AC_CHECK_LIB(socket,send,
http_LDFLAGS="${http_LDFLAGS} -lsocket"
AC_CHECK_LIB(socket,send,
http_LDFLAGS="${http_LDFLAGS} -lsocket"
)])
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
])
have_nanosleep=0
AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
......@@ -162,42 +162,42 @@ AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
)
])
if test x$have_nanosleep = x1; then
AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.)
AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.)
fi
# HP/UX port
AC_CHECK_LIB(rt,sem_init, [pthread_LDFLAGS="${pthread_LDFLAGS} -lrt"])
AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
])
AC_CHECK_FUNC(textdomain,,[
AC_CHECK_LIB(intl,textdomain,
vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
)
AC_CHECK_LIB(intl,textdomain,
vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
)
])
dnl Check for getopt
NEED_GETOPT=0
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
[NEED_GETOPT=1])])
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
[NEED_GETOPT=1])])
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
AC_CHECK_LIB(m,cos,
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
AC_CHECK_LIB(m,pow,
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
faad_LDFLAGS="${faad_LDFLAGS} -lm"
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
faad_LDFLAGS="${faad_LDFLAGS} -lm"
)
dnl Check for pthreads - borrowed from XMMS
......@@ -209,11 +209,11 @@ if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads ${pthread_LDFLAGS}")
fi
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
fi
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_FUNC(pthread_mutex_lock)
THREAD_LIB=""
AC_CHECK_FUNC(pthread_mutex_lock)
THREAD_LIB=""
fi
dnl Check for cthreads under GNU/Hurd for instance
......@@ -221,14 +221,14 @@ AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_cond_t.)])
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_cond_t.)])
AC_EGREP_HEADER(pthread_once,pthread.h,[
AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_once.)])
AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_once.)])
AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.)])
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.)])
dnl Check for headers
AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
......@@ -242,14 +242,14 @@ AC_HEADER_TIME
dnl Mac OS X and other OSes don't have declaration for nanosleep
AC_EGREP_HEADER(nanosleep,time.h,[
AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
Define if <time.h> defines nanosleep.)
AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
Define if <time.h> defines nanosleep.)
])
dnl Make sure we have timespecs
AC_EGREP_HEADER(timespec,sys/time.h,[
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
Define if <sys/time.h> defines struct timespec.)
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
Define if <sys/time.h> defines struct timespec.)
])
dnl Check for threads library
......@@ -257,10 +257,10 @@ AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Default X headers and libraries
if test "x${x_includes}" = "xNONE"; then
x_includes="/usr/X11R6/include"
x_includes="/usr/X11R6/include"
fi
if test "x${x_libraries}" = "xNONE"; then
x_libraries="/usr/X11R6/lib"
x_libraries="/usr/X11R6/lib"
fi
dnl Build the gtk_main plugin?
......@@ -269,174 +269,174 @@ NEED_GTK_MAIN=no
dnl Check for DPMS
if test "x${SYS}" != "xmingw32"
then
CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
])
])
CPPFLAGS="${save_CPPFLAGS}"
CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
])
])
CPPFLAGS="${save_CPPFLAGS}"
fi
dnl Check for ntohl, etc.
AC_CACHE_CHECK([for ntohl in sys/param.h],
[ac_cv_c_ntohl_sys_param_h],
[CFLAGS="${save_CFLAGS} -Wall -Werror"
AC_TRY_COMPILE([#include <sys/param.h>],
[void foo() { int meuh; ntohl(meuh); }],
ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
[ac_cv_c_ntohl_sys_param_h],
[CFLAGS="${save_CFLAGS} -Wall -Werror"
AC_TRY_COMPILE([#include <sys/param.h>],
[void foo() { int meuh; ntohl(meuh); }],
ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi
dnl Check for inline function size limit
AC_CACHE_CHECK([if \$CC accepts -finline-limit],
[ac_cv_c_inline_limit],
[CFLAGS="${save_CFLAGS} -finline-limit-30000"
AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
[ac_cv_c_inline_limit],
[CFLAGS="${save_CFLAGS} -finline-limit-30000"
AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
if test "x${ac_cv_c_inline_limit}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
fi
dnl Check for -W or -w flags
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
[ac_cv_c_Wall_Winline],
[CFLAGS="-Wall -Winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
[ac_cv_c_Wall_Winline],
[CFLAGS="-Wall -Winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
else
AC_CACHE_CHECK([if \$CC accepts -wall -winline],
[ac_cv_c_wall_winline],
[CFLAGS="-wall -winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
if test "x${ac_cv_c_wall_winline}" != "xno"; then
save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
fi
AC_CACHE_CHECK([if \$CC accepts -wall -winline],
[ac_cv_c_wall_winline],
[CFLAGS="-wall -winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
if test "x${ac_cv_c_wall_winline}" != "xno"; then
save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
fi
fi
dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe],
[ac_cv_c_pipe],
[CFLAGS="${save_CFLAGS} -pipe"
AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
[ac_cv_c_pipe],
[CFLAGS="${save_CFLAGS} -pipe"
AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
if test "x${ac_cv_c_pipe}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
fi
dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3],
[ac_cv_c_o3],
[CFLAGS="${save_CFLAGS} -O3"
AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
[ac_cv_c_o3],
[CFLAGS="${save_CFLAGS} -O3"
AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test "x${ac_cv_c_o3}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
else
AC_CACHE_CHECK([if \$CC accepts -O2],
[ac_cv_c_o2],
[CFLAGS="${save_CFLAGS} -O2"
AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
if test "x${ac_cv_c_o2}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
else
AC_CACHE_CHECK([if \$CC accepts -O],
[ac_cv_c_o],
[CFLAGS="${save_CFLAGS} -O"
AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
if test "x${ac_cv_c_o}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
fi
AC_CACHE_CHECK([if \$CC accepts -O2],
[ac_cv_c_o2],
[CFLAGS="${save_CFLAGS} -O2"
AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
if test "x${ac_cv_c_o2}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
else
AC_CACHE_CHECK([if \$CC accepts -O],
[ac_cv_c_o],
[CFLAGS="${save_CFLAGS} -O"
AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
if test "x${ac_cv_c_o}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
fi
fi
fi
dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math],
[CFLAGS="${save_CFLAGS} -ffast-math"
AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
[ac_cv_c_fast_math],
[CFLAGS="${save_CFLAGS} -ffast-math"
AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test "x${ac_cv_c_fast_math}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
fi
dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
[ac_cv_c_unroll_loops],
[CFLAGS="${save_CFLAGS} -funroll-loops"
AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
[ac_cv_c_unroll_loops],
[CFLAGS="${save_CFLAGS} -funroll-loops"
AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test "x${ac_cv_c_unroll_loops}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
fi
dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer],
[CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
[ac_cv_c_omit_frame_pointer],
[CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
# this plugin does not compile without -fomit-frame-pointer, damn gcc!
i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
# this plugin does not compile without -fomit-frame-pointer, damn gcc!
i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
fi
dnl Check for Darwin plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
[ac_cv_ld_darwin],
[CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
[ac_cv_ld_darwin],
[CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test "x${ac_cv_ld_darwin}" != "xno"; then
plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
fi
dnl Check for standard plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -shared],
[ac_cv_ld_plugins],
[CFLAGS="${save_CFLAGS} -shared"
AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
[ac_cv_ld_plugins],
[CFLAGS="${save_CFLAGS} -shared"
AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
if test "x${ac_cv_ld_plugins}" != "xno"; then
plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
fi
dnl Check for variadic macros
AC_CACHE_CHECK([for variadic cpp macros],
[ac_cv_cpp_variadic_macros],
[CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE(
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");],
ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)])
[ac_cv_cpp_variadic_macros],
[CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE(
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");],
ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)])
if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
fi
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
[ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0
CFLAGS="${save_CFLAGS} -Werror"
for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
done
CFLAGS="${save_CFLAGS}"])
[ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0
CFLAGS="${save_CFLAGS} -Werror"
for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
done
CFLAGS="${save_CFLAGS}"])
if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
fi
dnl
dnl Check the CPU
dnl
case "x${target_cpu}" in
x)
ARCH=unknown
;;
*)
ARCH="${target_cpu}"
;;
x)
ARCH=unknown
;;
*)
ARCH="${target_cpu}"
;;
esac
dnl
......@@ -447,10 +447,9 @@ PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts demux/a52sys"
PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/mpeg_audio/mpeg_audio"
PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old codec/a52"
#PLUGINS="${PLUGINS} codec/lpcm/lpcm"
PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old codec/a52 codec/lpcm/lpcm"
PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop video_filter/motionblur"
PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif audio_filter/converter/fixed32tofloat32 audio_filter/converter/fixed32tos16 audio_filter/converter/s16tofloat32"
PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif audio_filter/converter/fixed32tofloat32 audio_filter/converter/fixed32tos16 audio_filter/converter/s16tofloat32 audio_filter/converter/s16tofloat32swab"
PLUGINS="${PLUGINS} audio_filter/resampler/trivial audio_filter/resampler/ugly"
PLUGINS="${PLUGINS} audio_filter/channel_mixer/trivial"
PLUGINS="${PLUGINS} audio_mixer/float32 audio_mixer/trivial audio_mixer/spdif"
......
/*****************************************************************************
* s16tofloat32.c : converter from signed 16 bits integer to float32
* with endianness change
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32swab.c,v 1.1 2002/09/18 01:28:04 henri Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h>
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <vlc/vlc.h>
#include "audio_output.h"
#include "aout_internal.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Create ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description(
_("audio filter for s16->float32 with endianness conversion") );
set_capability( "audio filter", 1 );
set_callbacks( Create, NULL );
vlc_module_end();
/*****************************************************************************
* Create: allocate trivial mixer
*****************************************************************************
* This function allocates and initializes a Crop vout method.
*****************************************************************************/
static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
if ( (p_filter->input.i_format == AOUT_FMT_S16_LE ||
p_filter->input.i_format == AOUT_FMT_S16_BE)
&& p_filter->output.i_format == AOUT_FMT_FLOAT32
&& p_filter->input.i_format != AOUT_FMT_S16_NE )
{
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = VLC_TRUE;
return 0;
}
return -1;
}
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
int i = p_in_buf->i_nb_samples * p_filter->input.i_channels;
/* We start from the end because b_in_place is true */
s16 * p_in = (s16 *)p_in_buf->p_buffer + i - 1;
float * p_out = (float *)p_out_buf->p_buffer + i - 1;
#ifdef HAVE_SWAB
s16 * p_swabbed = malloc( i * sizeof(s16) );
swab( p_in_buf->p_buffer, p_swabbed,
i * sizeof(s16) );
p_in = p_swabbed +i - 1;
#else
byte_t temp;
#endif
while( i-- )
{
#ifndef HAVE_SWAB
temp = *(byte_t*)p_in;
*(byte_t*)p_in = *(byte_t*)p_in+1;
*(byte_t*)p_in+1 = temp;
#endif
*p_out = (float)*p_in / 32768.0;
p_in--; p_out--;
}
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 2;
}
......@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.3 2002/08/30 22:22:24 massiot Exp $
* $Id: lpcm.c,v 1.4 2002/09/18 01:28:05 henri Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -25,19 +25,19 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <string.h> /* memcpy(), memset() */
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memcpy(), memset() */
#include <vlc/vlc.h>
#include <vlc/aout.h>
#include <vlc/decoder.h>
#include <input_ext-dec.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* getpid() */
#endif
#include "lpcm.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......@@ -45,7 +45,7 @@ static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
void DecodeFrame ( lpcmdec_thread_t * );
static int InitThread ( lpcmdec_thread_t * );
// static int InitThread ( lpcmdec_thread_t * );
static void EndThread ( lpcmdec_thread_t * );
/*****************************************************************************
......@@ -95,10 +95,25 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
*/
p_lpcmdec->p_fifo = p_fifo;
if( InitThread( p_lpcmdec ) )
/* Init the BitStream */
InitBitstream( &p_lpcmdec->bit_stream, p_lpcmdec->p_fifo,
NULL, NULL );
/* FIXME : I suppose the number of channel ans sampling rate
* are someway in the headers */
p_lpcmdec->output_format.i_format = AOUT_FMT_S16_BE;
p_lpcmdec->output_format.i_channels = 2;
p_lpcmdec->output_format.i_rate = 48000;
aout_DateInit( &p_lpcmdec->end_date, 48000 );
p_lpcmdec->p_aout_input = aout_InputNew( p_lpcmdec->p_fifo,
&p_lpcmdec->p_aout,
&p_lpcmdec->output_format );
if( p_lpcmdec->p_aout_input == NULL )
{
DecoderError( p_fifo );
free( p_lpcmdec );
msg_Err( p_lpcmdec->p_fifo, "failed to create aout fifo" );
p_lpcmdec->p_fifo->b_error = 1;
return( -1 );
}
......@@ -120,67 +135,41 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
return( 0 );
}
/*****************************************************************************
* InitThread : initialize an lpcm decoder thread
*****************************************************************************/
static int InitThread (lpcmdec_thread_t * p_lpcmdec)
{
/* Init the BitStream */
InitBitstream( &p_lpcmdec->bit_stream, p_lpcmdec->p_fifo,
NULL, NULL);
/* Creating the audio output fifo */
p_lpcmdec->p_aout_fifo =
aout_CreateFifo( p_lpcmdec->p_fifo, AOUT_FIFO_PCM,
2, 48000, LPCMDEC_FRAME_SIZE / 2, NULL );
if ( p_lpcmdec->p_aout_fifo == NULL )
{
return( -1 );
}
return( 0 );
}
/*****************************************************************************
* DecodeFrame: decodes a frame.
*****************************************************************************/
void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
{
byte_t * buffer;
#ifndef WORDS_BIGENDIAN
byte_t * p_temp[LPCMDEC_FRAME_SIZE];
#endif
byte_t buffer[LPCMDEC_FRAME_SIZE];
aout_buffer_t * p_aout_buffer;
mtime_t i_pts;
vlc_bool_t b_sync;
int i_loop;
CurrentPTS( &p_lpcmdec->bit_stream,
&p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame],
NULL );
if( !p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame] )
NextPTS( &p_lpcmdec->bit_stream, &i_pts, NULL );
if( i_pts != 0 && i_pts != aout_DateGet( &p_lpcmdec->end_date ) )
{
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame] =
LAST_MDATE;
aout_DateSet( &p_lpcmdec->end_date, i_pts );
}
buffer = ((byte_t *)p_lpcmdec->p_aout_fifo->buffer) +
(p_lpcmdec->p_aout_fifo->i_end_frame * LPCMDEC_FRAME_SIZE);
RemoveBits32(&p_lpcmdec->bit_stream);
#if 0
byte1 = GetBits(&p_lpcmdec->bit_stream, 8) ;
byte2 = GetBits(&p_lpcmdec->bit_stream, 8) ;
/* I only have 2 test streams. As far as I understand
* after the RemoveBits and the 2 GetBits, we should be exactly
* where we want : the sync word : 0x0180.
* If not, we go and find it. */
while( ( byte1 != 0x01 || byte2 != 0x80 ) && (!p_lpcmdec->p_fifo->b_die)
&& (!p_lpcmdec->p_fifo->b_error) )
p_aout_buffer = aout_BufferNew( p_lpcmdec->p_aout,
p_lpcmdec->p_aout_input,
LPCMDEC_FRAME_SIZE/4 );
if( !p_aout_buffer )
{
byte1 = byte2;
byte2 = GetBits(&p_lpcmdec->bit_stream, 8);
msg_Err( p_lpcmdec->p_fifo, "cannot get aout buffer" );
p_lpcmdec->p_fifo->b_error = 1;
return;
}
#else
p_aout_buffer->start_date = aout_DateGet( &p_lpcmdec->end_date );
p_aout_buffer->end_date = aout_DateIncrement( &p_lpcmdec->end_date,
LPCMDEC_FRAME_SIZE/4 );
b_sync = 0;
while( ( !p_lpcmdec->p_fifo->b_die ) &&
( !p_lpcmdec->p_fifo->b_error ) &&
......@@ -191,33 +180,18 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
( GetBits( &p_lpcmdec->bit_stream, 8 ) != 0x01 ) );
b_sync = ( ShowBits( &p_lpcmdec->bit_stream, 8 ) == 0x80 );
}
RemoveBits( &p_lpcmdec->bit_stream, 8 );
#endif
#ifndef WORDS_BIGENDIAN
GetChunk( &p_lpcmdec->bit_stream, p_temp, LPCMDEC_FRAME_SIZE);
if( p_lpcmdec->p_fifo->b_die || p_lpcmdec->p_fifo->b_error ) return;
# ifdef HAVE_SWAB
swab( buffer, p_temp, LPCMDEC_FRAME_SIZE );
# else
for( i_loop = 0; i_loop < LPCMDEC_FRAME_SIZE/2; i_loop++ )
{
buffer[2*i_loop]=p_temp[2*i_loop+1];
buffer[2*i_loop+1]=p_temp[2*i_loop];
}
# endif
GetChunk( &p_lpcmdec->bit_stream, p_aout_buffer->p_buffer,
LPCMDEC_FRAME_SIZE);
#else
GetChunk( &p_lpcmdec->bit_stream, buffer, LPCMDEC_FRAME_SIZE);
if( p_lpcmdec->p_fifo->b_die ) return;
#endif
if( p_lpcmdec->p_fifo->b_die || p_lpcmdec->p_fifo->b_error )
return;
aout_BufferPlay( p_lpcmdec->p_aout, p_lpcmdec->p_aout_input,
p_aout_buffer );
vlc_mutex_lock (&p_lpcmdec->p_aout_fifo->data_lock);
p_lpcmdec->p_aout_fifo->i_end_frame =
(p_lpcmdec->p_aout_fifo->i_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal (&p_lpcmdec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
}
/*****************************************************************************
......@@ -226,14 +200,10 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
static void EndThread( lpcmdec_thread_t * p_lpcmdec )
{
/* If the audio output fifo was created, we destroy it */
if( p_lpcmdec->p_aout_fifo != NULL )
if( p_lpcmdec->p_aout_input )
{
aout_DestroyFifo( p_lpcmdec->p_aout_fifo );
/* Make sure the output thread leaves the NextFrame() function */
vlc_mutex_lock( &(p_lpcmdec->p_aout_fifo->data_lock) );
vlc_cond_signal( &(p_lpcmdec->p_aout_fifo->data_wait) );
vlc_mutex_unlock( &(p_lpcmdec->p_aout_fifo->data_lock) );
aout_InputDelete( p_lpcmdec->p_aout, p_lpcmdec->p_aout_input );
}
/* Destroy descriptor */
......
......@@ -2,7 +2,7 @@
* lpcm.h : lpcm decoder module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm.h,v 1.1 2002/08/04 17:23:42 sam Exp $
* $Id: lpcm.h,v 1.2 2002/09/18 01:28:05 henri Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -42,8 +42,11 @@ typedef struct lpcmdec_thread_s
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_instance_t *p_aout;
aout_input_t *p_aout_input;
audio_sample_format_t output_format;
audio_date_t end_date;
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment