Update to pjsua-1.5.5
From (new) MAINTAINER Christopher Zimmermann with some modifications by landry@, ajacoutot@, sthen@ and myself. Thanks! OK landry@, ajacoutot@, sthen@
This commit is contained in:
parent
a61768d255
commit
42a5d6cf0f
@ -1,34 +1,45 @@
|
||||
# $OpenBSD: Makefile,v 1.4 2008/06/18 21:41:42 todd Exp $
|
||||
# $OpenBSD: Makefile,v 1.5 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
COMMENT= lightweight sip client
|
||||
|
||||
DISTNAME= pjproject-0.7.0
|
||||
PKGNAME= pjsua-0.7.0p2
|
||||
VERSION= 1.5.5
|
||||
DISTNAME= pjproject-${VERSION}
|
||||
PKGNAME= pjsua-${VERSION}
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
CATEGORIES= telephony
|
||||
|
||||
HOMEPAGE= http://www.pjsip.org
|
||||
MASTER_SITES= http://www.pjsip.org/release/0.7.0/
|
||||
MAINTAINER= Deanna Phillips <deanna@openbsd.org>
|
||||
HOMEPAGE= http://www.pjsip.org/
|
||||
MASTER_SITES= ${HOMEPAGE}release/${VERSION}/
|
||||
MAINTAINER= Christopher Zimmermann <madroach@zakweb.de>
|
||||
|
||||
WANTLIB= c crypto m ossaudio pthread ssl
|
||||
USE_GMAKE= Yes
|
||||
CONFIGURE_STYLE= gnu
|
||||
|
||||
# GPL
|
||||
# GPLv2
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
post-configure:
|
||||
perl -pi -e's,%%LOCALBASE%%,${LOCALBASE},' \
|
||||
${WRKSRC}/build/os-openbsd.mak
|
||||
cd ${WRKSRC} && ${GMAKE} dep
|
||||
WANTLIB= c crypto m pthread ssl
|
||||
LIB_DEPENDS= gsm.>=1.0::audio/gsm \
|
||||
portaudio::audio/portaudio-svn \
|
||||
speex,speexdsp::audio/speex
|
||||
|
||||
CFLAGS+=-DNDEBUG
|
||||
NO_REGRESS=Yes
|
||||
CONFIGURE_STYLE= autoconf no-autoheader
|
||||
AUTOCONF_VERSION= 2.62
|
||||
CONFIGURE_ARGS= --disable-oss \
|
||||
--with-external-gsm \
|
||||
--with-external-pa \
|
||||
--with-external-speex
|
||||
CONFIGURE_ENV+= CFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
|
||||
USE_GMAKE= Yes
|
||||
NO_REGRESS= Yes
|
||||
|
||||
post-extract:
|
||||
rm -f ${WRKSRC}/configure
|
||||
ln -s ${WRKSRC}/aconfigure.ac ${WRKSRC}/configure.ac
|
||||
|
||||
do-install:
|
||||
cp ${WRKSRC}/pjsip-apps/bin/pjsua* ${PREFIX}/bin/pjsua
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/pjsip-apps/bin/pjsua* ${PREFIX}/bin/pjsua
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (pjproject-0.7.0.tar.gz) = bTAg/nuRheeFW2Eh+3Vb7g==
|
||||
RMD160 (pjproject-0.7.0.tar.gz) = 7Vw5Pu7t4AC1Uu3AseaSgiTeTaU=
|
||||
SHA1 (pjproject-0.7.0.tar.gz) = w5h/ZfEoT1rkvGYaL7k6u/4iY6s=
|
||||
SHA256 (pjproject-0.7.0.tar.gz) = Dd2v1u5IH0Tm/tnChWAuy8b/5/LITDjkRuCAkt0nb/0=
|
||||
SIZE (pjproject-0.7.0.tar.gz) = 4276564
|
||||
MD5 (pjproject-1.5.5.tar.bz2) = vK/lRJTgukSULTUrRCuncw==
|
||||
RMD160 (pjproject-1.5.5.tar.bz2) = 3ezUJiyC4HXIzo/2+jKNmA63kWQ=
|
||||
SHA1 (pjproject-1.5.5.tar.bz2) = z3T1WfnuUuK5gSe6H7cUSazD5c4=
|
||||
SHA256 (pjproject-1.5.5.tar.bz2) = p2nU44Eq6eojQvqNkYhB5geX0ahgX9n0amSWzi5hmYw=
|
||||
SIZE (pjproject-1.5.5.tar.bz2) = 3697555
|
||||
|
@ -1,50 +0,0 @@
|
||||
$OpenBSD: patch-aconfigure,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- aconfigure.orig Sat Jun 2 20:16:57 2007
|
||||
+++ aconfigure Sat Jun 2 20:17:59 2007
|
||||
@@ -9573,13 +9573,13 @@ if test $ac_cv_header_openssl_ssl_h = yes; then
|
||||
fi
|
||||
|
||||
|
||||
- echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5
|
||||
-echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6
|
||||
+ echo "$as_me:$LINENO: checking for SSL_library_init in -lssl -lcrypto" >&5
|
||||
+echo $ECHO_N "checking for SSL_library_init in -lssl -lcrypto... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
-LIBS="-lssl $LIBS"
|
||||
+LIBS="-lssl -lcrypto $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
@@ -9638,16 +9638,16 @@ fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6
|
||||
if test $ac_cv_lib_ssl_SSL_library_init = yes; then
|
||||
- libssl_present=1 && LIBS="$LIBS -lssl"
|
||||
+ libssl_present=1 && LIBS="$LIBS -lssl -lcrypto"
|
||||
fi
|
||||
|
||||
- echo "$as_me:$LINENO: checking for ERR_load_BIO_strings in -lcrypto" >&5
|
||||
-echo $ECHO_N "checking for ERR_load_BIO_strings in -lcrypto... $ECHO_C" >&6
|
||||
+ echo "$as_me:$LINENO: checking for ERR_load_BIO_strings in -lcrypto -lssl" >&5
|
||||
+echo $ECHO_N "checking for ERR_load_BIO_strings in -lcrypto -lssl... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_crypto_ERR_load_BIO_strings+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
-LIBS="-lcrypto $LIBS"
|
||||
+LIBS="-lcrypto -lssl $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
@@ -9706,7 +9706,7 @@ fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6
|
||||
if test $ac_cv_lib_crypto_ERR_load_BIO_strings = yes; then
|
||||
- libcrypto_present=1 && LIBS="$LIBS -lcrypto"
|
||||
+ libcrypto_present=1 && LIBS="$LIBS -lcrypto -lssl"
|
||||
fi
|
||||
|
||||
if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
|
208
telephony/pjsua/patches/patch-aconfigure_ac
Normal file
208
telephony/pjsua/patches/patch-aconfigure_ac
Normal file
@ -0,0 +1,208 @@
|
||||
$OpenBSD: patch-aconfigure_ac,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
use -pthread instead of -lpthread
|
||||
fix memory alignment detection on sparc64
|
||||
fix header detection when using external libgsm on OpenBSD
|
||||
|
||||
fixes from upstream:
|
||||
fixes in detecting header availability
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
check for libcrypto before libssl
|
||||
|
||||
--- aconfigure.ac.orig Wed Oct 28 07:09:15 2009
|
||||
+++ aconfigure.ac Thu Apr 1 14:41:24 2010
|
||||
@@ -1,4 +1,4 @@
|
||||
-AC_INIT(pjproject,1.0)
|
||||
+AC_INIT(pjproject,1.x)
|
||||
|
||||
host_orig="$host"
|
||||
|
||||
@@ -17,9 +17,9 @@ AC_CONFIG_FILES([build.mak
|
||||
pjlib-util/build/os-auto.mak
|
||||
pjmedia/build/os-auto.mak
|
||||
pjsip/build/os-auto.mak
|
||||
- third_party/build/portaudio/os-auto.mak
|
||||
third_party/build/os-auto.mak
|
||||
- ])
|
||||
+ third_party/build/portaudio/os-auto.mak
|
||||
+ ])
|
||||
|
||||
|
||||
dnl
|
||||
@@ -48,7 +48,23 @@ case $target in
|
||||
;;
|
||||
esac
|
||||
|
||||
-AC_CHECK_LIB(pthread,pthread_create)
|
||||
+AC_CHECK_HEADER(pthread.h, have_pthread_h=yes)
|
||||
+if test "X$have_pthread_h" = "Xyes" ; then
|
||||
+ save_LDFLAGS="$LDFLAGS";
|
||||
+ LDFLAGS="$LDFLAGS -pthread"
|
||||
+ AC_LINK_IFELSE(
|
||||
+ [AC_LANG_PROGRAM(
|
||||
+ [[#include <pthread.h>
|
||||
+ pthread_t thr;]],
|
||||
+ [pthread_create(&thr, NULL, NULL, NULL);])],
|
||||
+ [ac_cv_support_pthreads=yes],
|
||||
+ [LDFLAGS="$save_LDFLAGS"])
|
||||
+ if test "X$ac_cv_support_pthreads" != "Xyes" ; then
|
||||
+ AC_CHECK_LIB(pthread, pthread_create,
|
||||
+ LIBS="-lpthread $LIBS")
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
AC_CHECK_LIB(wsock32,puts)
|
||||
AC_CHECK_LIB(ws2_32,puts)
|
||||
AC_CHECK_LIB(ole32,puts)
|
||||
@@ -67,7 +83,7 @@ dnl Memory alignment detection
|
||||
dnl
|
||||
AC_MSG_CHECKING([memory alignment])
|
||||
case $target in
|
||||
- ia64-* | x86_64-* )
|
||||
+ ia64-* | x86_64-* | sparc64-* )
|
||||
AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
|
||||
AC_MSG_RESULT([8 bytes])
|
||||
;;
|
||||
@@ -146,9 +162,15 @@ AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
|
||||
AC_CHECK_HEADER(netinet/in_systm.h,[AC_DEFINE(PJ_HAS_NETINET_IN_SYSTM_H,1)])
|
||||
AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
|
||||
AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[],
|
||||
- [#if PJ_HAS_NETINET_IN_SYSTM_H
|
||||
+ [#if PJ_HAS_SYS_TYPES_H
|
||||
+ # include <sys/types.h>
|
||||
+ #endif
|
||||
+ #if PJ_HAS_NETINET_IN_SYSTM_H
|
||||
# include <netinet/in_systm.h>
|
||||
#endif
|
||||
+ #if PJ_HAS_NETINET_IN_H
|
||||
+ # include <netinet/in.h>
|
||||
+ #endif
|
||||
])
|
||||
AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)])
|
||||
AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])
|
||||
@@ -166,6 +188,8 @@ AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOC
|
||||
AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
|
||||
AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
|
||||
AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
|
||||
+AC_CHECK_HEADER(sys/filio.h,[AC_DEFINE(PJ_HAS_SYS_FILIO_H,1)])
|
||||
+AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(PJ_HAS_SYS_SOCKIO_H,1)])
|
||||
AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
|
||||
AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
|
||||
AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
|
||||
@@ -180,11 +204,14 @@ AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,
|
||||
AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)])
|
||||
AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1])
|
||||
AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)],[],
|
||||
- [#if PJ_HAS_SYS_SOCKET_H
|
||||
+ [#if PJ_HAS_SYS_TYPES_H
|
||||
+ # include <sys/types.h>
|
||||
+ #endif
|
||||
+ #if PJ_HAS_SYS_SOCKET_H
|
||||
+
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
])
|
||||
-
|
||||
AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
|
||||
AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
|
||||
|
||||
@@ -256,7 +283,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/typ
|
||||
|
||||
dnl # Determine if socklen_t is available
|
||||
AC_MSG_CHECKING([if socklen_t is available])
|
||||
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
|
||||
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
+ #include <sys/socket.h>]],
|
||||
[socklen_t xxx = 0;])],
|
||||
[AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
|
||||
AC_MSG_RESULT(yes)],
|
||||
@@ -367,6 +395,52 @@ dnl #
|
||||
dnl # PJMEDIA
|
||||
dnl #
|
||||
|
||||
+dnl # Use external Speex installation
|
||||
+AC_SUBST(ac_external_speex,0)
|
||||
+AC_ARG_WITH(external-speex,
|
||||
+ AC_HELP_STRING([--with-external-speex],
|
||||
+ [Use external Speex development files, not the one in "third_party" directory. When this option is set, make sure that Speex is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
|
||||
+ [
|
||||
+ if test "x$with_external_speex" != "xno"; then
|
||||
+ # Test Speex installation
|
||||
+ AC_MSG_CHECKING([if external Speex devkit is installed])
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <speex/speex.h>
|
||||
+ #include <speex/speex_echo.h>
|
||||
+ ]],
|
||||
+ [speex_echo_state_init(0, 0); speex_encoder_init(0); ])],
|
||||
+ [AC_MSG_RESULT(yes!!)
|
||||
+ AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1)
|
||||
+ ac_external_speex="1"
|
||||
+ ],
|
||||
+ [AC_MSG_ERROR([Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
|
||||
+ fi
|
||||
+ ]
|
||||
+ )
|
||||
+
|
||||
+dnl # Use external GSM codec library installation
|
||||
+AC_SUBST(ac_external_gsm,0)
|
||||
+AC_ARG_WITH(external-gsm,
|
||||
+ AC_HELP_STRING([--with-external-gsm],
|
||||
+ [Use external GSM codec library, not the one in "third_party" directory. When this option is set, make sure that the GSM include/lib files are accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
|
||||
+ [
|
||||
+ if test "x$with_external_gsm" != "xno"; then
|
||||
+ # Test GSM library installation
|
||||
+ AC_MSG_CHECKING([if external GSM devkit is installed])
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gsm.h>
|
||||
+ ]],
|
||||
+ [gsm_create(); ])
|
||||
+ ],
|
||||
+ [AC_MSG_RESULT(yes!!)
|
||||
+ AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1)
|
||||
+ ac_external_gsm="1"
|
||||
+ ],
|
||||
+ [AC_MSG_ERROR([Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
|
||||
+ fi
|
||||
+ ]
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+
|
||||
dnl # Sound device backend selection
|
||||
AC_SUBST(ac_pjmedia_snd)
|
||||
AC_ARG_ENABLE(sound,
|
||||
@@ -378,6 +452,26 @@ AC_ARG_ENABLE(sound,
|
||||
fi]
|
||||
)
|
||||
|
||||
+dnl # Use external PortAudio installation
|
||||
+AC_SUBST(ac_external_pa,0)
|
||||
+AC_ARG_WITH(external-pa,
|
||||
+ AC_HELP_STRING([--with-external-pa],
|
||||
+ [Use external PortAudio development files, not the one in "third_party" directory. When this option is set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
|
||||
+ [
|
||||
+ if test "x$with_external_pa" != "xno"; then
|
||||
+ # Test PortAudio installation
|
||||
+ AC_MSG_CHECKING([if external PortAudio devkit is installed])
|
||||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <portaudio.h>
|
||||
+ ]],
|
||||
+ [Pa_Initialize();])],
|
||||
+ [AC_MSG_RESULT(yes!!)
|
||||
+ ac_external_pa="1"
|
||||
+ ],
|
||||
+ [AC_MSG_ERROR([Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
|
||||
+ fi
|
||||
+ ]
|
||||
+ )
|
||||
+
|
||||
AC_SUBST(ac_pa_cflags)
|
||||
AC_CHECK_HEADER(sys/soundcard.h,
|
||||
[ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"])
|
||||
@@ -754,8 +848,8 @@ AC_ARG_ENABLE(ssl,
|
||||
AC_SUBST(libssl_present)
|
||||
AC_SUBST(libcrypto_present)
|
||||
AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
|
||||
- AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"])
|
||||
AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"])
|
||||
+ AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"])
|
||||
if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
|
||||
AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
|
||||
# PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK
|
@ -1,58 +1,85 @@
|
||||
$OpenBSD: patch-build_mak_in,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- build.mak.in.orig Tue Apr 17 12:16:01 2007
|
||||
+++ build.mak.in Thu May 24 10:09:23 2007
|
||||
@@ -1,6 +1,6 @@
|
||||
# @configure_input@
|
||||
export MACHINE_NAME := auto
|
||||
-export OS_NAME := auto
|
||||
+export OS_NAME = openbsd
|
||||
export HOST_NAME := unix
|
||||
export CC_NAME := gcc
|
||||
export TARGET_NAME := @target@
|
||||
@@ -10,33 +10,22 @@ export LINUX_POLL := @ac_linux_poll@
|
||||
$OpenBSD: patch-build_mak_in,v 1.2 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
|
||||
--- build.mak.in.orig Wed Apr 15 16:45:41 2009
|
||||
+++ build.mak.in Thu Apr 1 18:52:00 2010
|
||||
@@ -7,21 +7,33 @@ export TARGET_NAME := @target@
|
||||
export CROSS_COMPILE := @ac_cross_compile@
|
||||
export LINUX_POLL := @ac_linux_poll@
|
||||
|
||||
+export ac_prefix := @prefix@
|
||||
+
|
||||
LIB_SUFFIX = $(TARGET_NAME).a
|
||||
|
||||
# Determine which party libraries to use
|
||||
export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME)
|
||||
export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME)
|
||||
+export APP_THIRD_PARTY_EXT :=
|
||||
export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX)
|
||||
|
||||
-ifneq (@ac_no_gsm_codec@,1)
|
||||
ifneq (@ac_no_gsm_codec@,1)
|
||||
+ifeq (@ac_external_gsm@,1)
|
||||
+# External GSM library
|
||||
+APP_THIRD_PARTY_EXT += -lgsm
|
||||
+else
|
||||
APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME)
|
||||
-endif
|
||||
-
|
||||
-ifneq (@ac_no_speex_codec@,1)
|
||||
APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME)
|
||||
-endif
|
||||
-
|
||||
-ifneq (@ac_no_ilbc_codec@,1)
|
||||
APP_THIRD_PARTY_LIBS += -lilbccodec-$(TARGET_NAME)
|
||||
-endif
|
||||
-
|
||||
-ifneq ($(findstring pa,@ac_pjmedia_snd@),)
|
||||
APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME)
|
||||
-endif
|
||||
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX)
|
||||
endif
|
||||
+endif
|
||||
|
||||
-
|
||||
# CFLAGS, LDFLAGS, and LIBS to be used by applications
|
||||
export PJDIR := @ac_pjdir@
|
||||
export APP_CC := $(CROSS_COMPILE)$(CC_NAME)
|
||||
-export APP_CFLAGS := -DPJ_AUTOCONF=1\
|
||||
- @CFLAGS@\
|
||||
+export APP_CFLAGS := @CFLAGS@\
|
||||
-I$(PJDIR)/pjlib/include\
|
||||
-I$(PJDIR)/pjlib-util/include\
|
||||
-I$(PJDIR)/pjnath/include\
|
||||
-I$(PJDIR)/pjmedia/include\
|
||||
- -I$(PJDIR)/pjsip/include
|
||||
+ -I$(PJDIR)/pjsip/include\
|
||||
+ -I$(PJDIR)/thirdparty/speex/include\
|
||||
+ -I$(PJDIR)/thirdparty/portaudio/include
|
||||
export APP_CXXFLAGS := $(APP_CFLAGS)
|
||||
export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\
|
||||
-L$(PJDIR)/pjlib-util/lib\
|
||||
@@ -55,7 +44,7 @@ export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\
|
||||
ifneq (@ac_no_speex_codec@,1)
|
||||
+ifeq (@ac_external_speex@,1)
|
||||
+APP_THIRD_PARTY_EXT += -lspeex -lspeexdsp
|
||||
+else
|
||||
APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME)
|
||||
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX)
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifneq (@ac_no_ilbc_codec@,1)
|
||||
APP_THIRD_PARTY_LIBS += -lilbccodec-$(TARGET_NAME)
|
||||
@@ -34,9 +46,14 @@ APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib
|
||||
endif
|
||||
|
||||
ifneq ($(findstring pa,@ac_pjmedia_snd@),)
|
||||
+ifeq (@ac_external_pa@,1)
|
||||
+# External PA
|
||||
+APP_THIRD_PARTY_EXT += -lportaudio
|
||||
+else
|
||||
APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME)
|
||||
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX)
|
||||
endif
|
||||
+endif
|
||||
|
||||
# Additional flags
|
||||
@ac_build_mak_vars@
|
||||
@@ -69,6 +86,7 @@ export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\
|
||||
-lpjnath-$(TARGET_NAME)\
|
||||
-lpjlib-util-$(TARGET_NAME)\
|
||||
$(APP_THIRD_PARTY_LIBS)\
|
||||
+ $(APP_THIRD_PARTY_EXT)\
|
||||
-lpj-$(TARGET_NAME)\
|
||||
- @LIBS@
|
||||
+ @LIBS@ -lossaudio
|
||||
@LIBS@
|
||||
export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \
|
||||
@@ -83,6 +101,8 @@ export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(
|
||||
$(APP_THIRD_PARTY_LIB_FILES) \
|
||||
$(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX)
|
||||
|
||||
+# Here are the variabels to use if application is using the library
|
||||
+# from within the source distribution
|
||||
export PJ_DIR := $(PJDIR)
|
||||
export PJ_CC := $(APP_CC)
|
||||
export PJ_CFLAGS := $(APP_CFLAGS)
|
||||
@@ -91,3 +111,11 @@ export PJ_LDFLAGS := $(APP_LDFLAGS)
|
||||
export PJ_LDLIBS := $(APP_LDLIBS)
|
||||
export PJ_LIB_FILES := $(APP_LIB_FILES)
|
||||
|
||||
+# And here are the variables to use if application is using the
|
||||
+# library from the install location (i.e. --prefix)
|
||||
+export PJ_INSTALL_DIR := @prefix@
|
||||
+export PJ_INSTALL_INC_DIR := $(PJ_INSTALL_DIR)/include
|
||||
+export PJ_INSTALL_LIB_DIR := $(PJ_INSTALL_DIR)/lib
|
||||
+export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
|
||||
+export PJ_INSTALL_CXXFLAGS := $(PJ_INSTALL_CFLAGS)
|
||||
+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
|
||||
|
@ -1,5 +0,0 @@
|
||||
$OpenBSD: patch-build_os-openbsd_mak,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- build/os-openbsd.mak.orig Fri Oct 26 13:52:15 2007
|
||||
+++ build/os-openbsd.mak Fri Oct 26 13:52:24 2007
|
||||
@@ -0,0 +1 @@
|
||||
+export OS_LDFLAGS = -L/usr/local/lib -lm -lpthread -lssl -lcrypto -lossaudio
|
@ -0,0 +1,18 @@
|
||||
$OpenBSD: patch-pjlib-util_src_pjlib-util-test_resolver_test_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
fix bug in pjlib-util resolver test on OpenBSD
|
||||
|
||||
--- pjlib-util/src/pjlib-util-test/resolver_test.c.orig Thu Jan 1 21:56:36 2009
|
||||
+++ pjlib-util/src/pjlib-util-test/resolver_test.c Wed Mar 31 10:28:45 2010
|
||||
@@ -813,8 +813,8 @@ static int dns_test(void)
|
||||
/* Now only server 0 should get packet, since both servers are
|
||||
* in STATE_ACTIVE state
|
||||
*/
|
||||
- pj_assert(g_server[0].pkt_count == 1);
|
||||
- pj_assert(g_server[1].pkt_count == 0);
|
||||
+ pj_assert((g_server[0].pkt_count == 1 && g_server[1].pkt_count == 0) ||
|
||||
+ (g_server[1].pkt_count == 1 && g_server[0].pkt_count == 0));
|
||||
|
||||
/* Wait to allow probing period to complete */
|
||||
PJ_LOG(3,(THIS_FILE, " waiting for active NS to expire (%d sec)",
|
@ -1,25 +0,0 @@
|
||||
$OpenBSD: patch-pjlib_build_os-openbsd_mak,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjlib/build/os-openbsd.mak.orig Sat Jun 2 19:16:29 2007
|
||||
+++ pjlib/build/os-openbsd.mak Sat Jun 2 19:31:37 2007
|
||||
@@ -0,0 +1,21 @@
|
||||
+#
|
||||
+# OS specific configuration for OpenBSD OS target.
|
||||
+#
|
||||
+
|
||||
+# Determine OS specific files
|
||||
+AC_OS_OBJS= file_access_unistd.o file_io_ansi.o os_core_unix.o \
|
||||
+ os_error_unix.o os_time_unix.o os_timestamp_posix.o \
|
||||
+ guid_simple.o ioqueue_select.o
|
||||
+
|
||||
+export PJLIB_OBJS += $(AC_OS_OBJS) \
|
||||
+ addr_resolv_sock.o \
|
||||
+ log_writer_stdout.o \
|
||||
+ os_timestamp_common.o \
|
||||
+ pool_policy_malloc.o sock_bsd.o sock_select.o
|
||||
+
|
||||
+export TEST_OBJS += main.o
|
||||
+
|
||||
+export TEST_LDFLAGS += -lm -lpthread -lssl -lcrypto
|
||||
+
|
||||
+export TARGETS = pjlib pjlib-test
|
||||
+
|
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-pjlib_include_pj_compat_os_auto_h_in,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
fixes in detecting header availability
|
||||
|
||||
--- pjlib/include/pj/compat/os_auto.h.in.orig Mon Oct 26 16:47:52 2009
|
||||
+++ pjlib/include/pj/compat/os_auto.h.in Wed Mar 31 10:28:45 2010
|
||||
@@ -71,6 +71,8 @@
|
||||
#undef PJ_HAS_SYS_TIME_H
|
||||
#undef PJ_HAS_SYS_TIMEB_H
|
||||
#undef PJ_HAS_SYS_TYPES_H
|
||||
+#undef PJ_HAS_SYS_FILIO_H
|
||||
+#undef PJ_HAS_SYS_SOCKIO_H
|
||||
#undef PJ_HAS_TIME_H
|
||||
#undef PJ_HAS_UNISTD_H
|
||||
|
@ -1,56 +0,0 @@
|
||||
$OpenBSD: patch-pjlib_include_pj_compat_os_openbsd_h,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjlib/include/pj/compat/os_openbsd.h.orig Sat Jun 2 22:47:03 2007
|
||||
+++ pjlib/include/pj/compat/os_openbsd.h Sat Jun 2 22:47:03 2007
|
||||
@@ -0,0 +1,52 @@
|
||||
+#ifndef __PJ_COMPAT_OS_OPENBSD_H__
|
||||
+#define __PJ_COMPAT_OS_OPENBSD_H__
|
||||
+
|
||||
+/* Canonical OS name */
|
||||
+#define PJ_OS_NAME "openbsd"
|
||||
+
|
||||
+/* Headers availability */
|
||||
+#define PJ_HAS_ARPA_INET_H 1
|
||||
+#define PJ_HAS_ASSERT_H 1
|
||||
+#define PJ_HAS_CTYPE_H 1
|
||||
+#define PJ_HAS_ERRNO_H 1
|
||||
+#define PJ_HAS_NETDB_H 1
|
||||
+#define PJ_HAS_NETINET_IN_H 1
|
||||
+#define PJ_HAS_NETINET_IP_H 1
|
||||
+#define PJ_HAS_SETJMP_H 1
|
||||
+#define PJ_HAS_STDARG_H 1
|
||||
+#define PJ_HAS_STDDEF_H 1
|
||||
+#define PJ_HAS_STDIO_H 1
|
||||
+#define PJ_HAS_STDLIB_H 1
|
||||
+#define PJ_HAS_STRING_H 1
|
||||
+#define PJ_HAS_SYS_IOCTL_H 1
|
||||
+#define PJ_HAS_SYS_SELECT_H 1
|
||||
+#define PJ_HAS_SYS_SOCKET_H 1
|
||||
+#define PJ_HAS_SYS_TIME_H 1
|
||||
+#define PJ_HAS_SYS_TIMEB_H 1
|
||||
+#define PJ_HAS_SYS_TYPES_H 1
|
||||
+#define PJ_HAS_TIME_H 1
|
||||
+#define PJ_HAS_UNISTD_H 1
|
||||
+
|
||||
+#define PJ_HAS_SOCKLEN_T 1
|
||||
+#define PJ_HAS_ERRNO_VAR 1
|
||||
+#define PJ_HAS_SO_ERROR 1
|
||||
+
|
||||
+#define PJ_BLOCKING_ERROR_VAL EAGAIN
|
||||
+#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS
|
||||
+#define PJ_HAS_HIGH_RES_TIMER 1
|
||||
+#define PJ_HAS_MALLOC 1
|
||||
+
|
||||
+#define PJ_ATOMIC_VALUE_TYPE long
|
||||
+#define PJ_EMULATE_RWMUTEX 0
|
||||
+#define PJ_THREAD_SET_STACK_SIZE 0
|
||||
+#define PJ_THREAD_ALLOCATE_STACK 0
|
||||
+
|
||||
+#define PJ_HAS_THREADS (1)
|
||||
+#define PJ_OS_HAS_CHECK_STACK 0
|
||||
+#define PJSIP_UDP_SO_SNDBUF_SIZE 65335
|
||||
+#define PJSIP_UDP_SO_RCVBUF_SIZE 65335
|
||||
+#define PJ_SOCKADDR_HAS_LEN 1
|
||||
+#define PJ_IOQUEUE_MAX_HANDLES (64)
|
||||
+
|
||||
+#define PJSIP_HAS_TLS_TRANSPORT 1
|
||||
+#endif /* __PJ_COMPAT_OS_OPENBSD_H__ */
|
@ -1,14 +1,22 @@
|
||||
$OpenBSD: patch-pjlib_include_pj_compat_socket_h,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjlib/include/pj/compat/socket.h.orig Mon Apr 30 17:03:32 2007
|
||||
+++ pjlib/include/pj/compat/socket.h Wed May 23 17:51:45 2007
|
||||
@@ -48,6 +48,10 @@
|
||||
# include <sys/select.h>
|
||||
$OpenBSD: patch-pjlib_include_pj_compat_socket_h,v 1.2 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
fixes in detecting header availability
|
||||
|
||||
--- pjlib/include/pj/compat/socket.h.orig Sat Oct 24 02:00:40 2009
|
||||
+++ pjlib/include/pj/compat/socket.h Wed Mar 31 10:28:45 2010
|
||||
@@ -139,6 +139,14 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
+#if defined(__OpenBSD__)
|
||||
+# include <netinet/in_systm.h>
|
||||
+#if defined(PJ_HAS_SYS_FILIO_H) && PJ_HAS_SYS_FILIO_H != 0
|
||||
+# include <sys/filio.h>
|
||||
+#endif
|
||||
+
|
||||
#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
+#if defined(PJ_HAS_SYS_SOCKIO_H) && PJ_HAS_SYS_SOCKIO_H != 0
|
||||
+# include <sys/sockio.h>
|
||||
+#endif
|
||||
+
|
||||
|
||||
/*
|
||||
* Define common errors.
|
||||
|
@ -1,43 +0,0 @@
|
||||
$OpenBSD: patch-pjlib_include_pj_config_h,v 1.2 2007/11/06 02:50:28 deanna Exp $
|
||||
--- pjlib/include/pj/config.h.orig Thu May 3 09:31:21 2007
|
||||
+++ pjlib/include/pj/config.h Sat Nov 3 17:39:38 2007
|
||||
@@ -120,6 +120,10 @@
|
||||
* RTEMS
|
||||
*/
|
||||
# include <pj/compat/os_rtems.h>
|
||||
+
|
||||
+#elif defined(__OpenBSD__)
|
||||
+# include <pj/compat/os_openbsd.h>
|
||||
+
|
||||
#else
|
||||
# error "Please specify target os."
|
||||
#endif
|
||||
@@ -133,6 +137,28 @@
|
||||
* Autoconf configured
|
||||
*/
|
||||
#include <pj/compat/m_auto.h>
|
||||
+
|
||||
+#elif defined(__OpenBSD__)
|
||||
+#include <sys/param.h>
|
||||
+#include <machine/endian.h>
|
||||
+#define PJ_M_NAME MACHINE
|
||||
+#if defined(__LP64__)
|
||||
+#define PJ_POOL_ALIGNMENT 8
|
||||
+#else
|
||||
+#define PJ_POOL_ALIGNMENT 4
|
||||
+#endif
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
+#define PJ_HAS_PENTIUM 1
|
||||
+#else
|
||||
+#define PJ_HAS_PENTIUM 0
|
||||
+#endif
|
||||
+#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
+#define PJ_IS_LITTLE_ENDIAN 1
|
||||
+#define PJ_IS_BIG_ENDIAN 0
|
||||
+#else
|
||||
+#define PJ_IS_LITTLE_ENDIAN 0
|
||||
+#define PJ_IS_BIG_ENDIAN 1
|
||||
+#endif
|
||||
|
||||
#elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
|
||||
defined(_X86_) || defined(x86) || defined(__i386__) || \
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-pjlib_include_pj_sock_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
|
||||
--- pjlib/include/pj/sock.h.orig Sat Nov 3 19:52:52 2007
|
||||
+++ pjlib/include/pj/sock.h Sat Nov 3 20:03:22 2007
|
||||
@@ -207,8 +207,6 @@ struct pj_sockaddr_in
|
||||
char sin_zero[8]; /**< Padding. */
|
||||
};
|
||||
|
||||
-#undef s6_addr
|
||||
-
|
||||
/**
|
||||
* This structure describes IPv6 address.
|
||||
*/
|
||||
@@ -221,7 +219,7 @@ typedef struct pj_in6_addr
|
||||
pj_uint32_t u6_addr32[4]; /**< u6_addr32 */
|
||||
} in6_u;
|
||||
/** Shortcut to access in6_u.u6_addr8. */
|
||||
-#define s6_addr in6_u.u6_addr8
|
||||
+#define pj_s6_addr in6_u.u6_addr8
|
||||
/** Shortcut to access in6_u.u6_addr16. */
|
||||
#define s6_addr16 in6_u.u6_addr16
|
||||
/** Shortcut to access in6_u.u6_addr32. */
|
24
telephony/pjsua/patches/patch-pjlib_src_pj_guid_simple_c
Normal file
24
telephony/pjsua/patches/patch-pjlib_src_pj_guid_simple_c
Normal file
@ -0,0 +1,24 @@
|
||||
$OpenBSD: patch-pjlib_src_pj_guid_simple_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
better GUID generation on OpenBSD
|
||||
|
||||
--- pjlib/src/pj/guid_simple.c.orig Tue Dec 23 18:27:53 2008
|
||||
+++ pjlib/src/pj/guid_simple.c Wed Mar 31 10:28:45 2010
|
||||
@@ -67,10 +67,12 @@ PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *
|
||||
pj_assert(PJ_GUID_STRING_LENGTH % 2 == 0);
|
||||
|
||||
for (p=str->ptr, end=p+PJ_GUID_STRING_LENGTH; p<end; ) {
|
||||
- /* Assumes rand() only has 16bit randomness */
|
||||
- unsigned short val = pj_rand();
|
||||
- *p++ = guid_chars[(val >> 8) & 63];
|
||||
- *p++ = guid_chars[(val & 0xFF) & 63];
|
||||
+ pj_uint32_t rand_val = pj_rand();
|
||||
+ pj_uint32_t rand_idx = RAND_MAX;
|
||||
+
|
||||
+ for ( ; rand_idx>0 && p<end; rand_idx>>=8, rand_val>>=8, p++) {
|
||||
+ *p = guid_chars[(rand_val & 0xFF) & 63];
|
||||
+ }
|
||||
}
|
||||
|
||||
str->slen = PJ_GUID_STRING_LENGTH;
|
39
telephony/pjsua/patches/patch-pjlib_src_pj_os_core_unix_c
Normal file
39
telephony/pjsua/patches/patch-pjlib_src_pj_os_core_unix_c
Normal file
@ -0,0 +1,39 @@
|
||||
$OpenBSD: patch-pjlib_src_pj_os_core_unix_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix undefined sched_get_priority_max() and sched_get_priority_min()
|
||||
on OpenBSD
|
||||
protect both functions with #ifdef _POSIX_PRIORITY_SCHEDULING and
|
||||
return 0 if __OpenBSD__ macro is declared
|
||||
|
||||
--- pjlib/src/pj/os_core_unix.c.orig Wed Aug 5 12:58:02 2009
|
||||
+++ pjlib/src/pj/os_core_unix.c Wed Mar 31 10:28:45 2010
|
||||
@@ -308,7 +308,14 @@ PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread
|
||||
if (rc != 0)
|
||||
return -1;
|
||||
|
||||
+#if defined _POSIX_PRIORITY_SCHEDULING
|
||||
return sched_get_priority_min(policy);
|
||||
+#elif defined __OpenBSD__
|
||||
+ return 0;
|
||||
+#else
|
||||
+ pj_assert("pj_thread_get_prio_min() not supported!");
|
||||
+ return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -325,7 +332,14 @@ PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread
|
||||
if (rc != 0)
|
||||
return -1;
|
||||
|
||||
+#if defined _POSIX_PRIORITY_SCHEDULING
|
||||
return sched_get_priority_max(policy);
|
||||
+#elif defined __OpenBSD__
|
||||
+ return 0;
|
||||
+#else
|
||||
+ pj_assert("pj_thread_get_prio_max() not supported!");
|
||||
+ return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
$OpenBSD: patch-pjlib_src_pjlib-test_activesock_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
reduce the loop in PJLIB activesock test
|
||||
|
||||
--- pjlib/src/pjlib-test/activesock.c.orig Fri Jan 8 10:53:31 2010
|
||||
+++ pjlib/src/pjlib-test/activesock.c Wed Mar 31 10:28:45 2010
|
||||
@@ -337,7 +337,7 @@ static pj_bool_t tcp_on_data_sent(pj_activesock_t *aso
|
||||
|
||||
static int tcp_perf_test(void)
|
||||
{
|
||||
- enum { COUNT=100000 };
|
||||
+ enum { COUNT=10000 };
|
||||
pj_pool_t *pool = NULL;
|
||||
pj_ioqueue_t *ioqueue = NULL;
|
||||
pj_sock_t sock1=PJ_INVALID_SOCKET, sock2=PJ_INVALID_SOCKET;
|
||||
@@ -436,6 +436,15 @@ static int tcp_perf_test(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+#ifndef PJ_SYMBIAN
|
||||
+ for (;;) {
|
||||
+ pj_time_val timeout = {0, 10};
|
||||
+ if (pj_ioqueue_poll(ioqueue, &timeout) < 1)
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
}
|
||||
|
||||
/* Wait until everything has been sent/received */
|
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-pjlib_src_pjlib-test_ioq_unreg_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
fix bug in ioqueue unregistration test which caused assertion error
|
||||
in destroying mutex on OpenBSD
|
||||
|
||||
--- pjlib/src/pjlib-test/ioq_unreg.c.orig Thu Jul 2 10:24:22 2009
|
||||
+++ pjlib/src/pjlib-test/ioq_unreg.c Wed Mar 31 10:28:45 2010
|
||||
@@ -93,6 +93,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
|
||||
if (PJ_TIME_VAL_GTE(now, time_to_unregister)) {
|
||||
sock_data.unregistered = 1;
|
||||
pj_ioqueue_unregister(key);
|
||||
+ pj_mutex_unlock(sock_data.mutex);
|
||||
return;
|
||||
}
|
||||
}
|
23
telephony/pjsua/patches/patch-pjmedia_build_Makefile
Normal file
23
telephony/pjsua/patches/patch-pjmedia_build_Makefile
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-pjmedia_build_Makefile,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
|
||||
--- pjmedia/build/Makefile.orig Tue Nov 10 06:26:37 2009
|
||||
+++ pjmedia/build/Makefile Wed Mar 31 10:28:45 2010
|
||||
@@ -1,7 +1,6 @@
|
||||
include ../../build.mak
|
||||
|
||||
THIRD_PARTY:=$(PJDIR)/third_party
|
||||
-PA_DIR := $(THIRD_PARTY)/build/portaudio/src
|
||||
|
||||
SRTP_INC=$(CC_INC)$(THIRD_PARTY)/build/srtp \
|
||||
$(CC_INC)$(THIRD_PARTY)/srtp/crypto/include \
|
||||
@@ -41,6 +40,7 @@ export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJMEDIA_LI
|
||||
$(subst /,$(HOST_PSEP),$(PJNATH_LIB)) \
|
||||
-L$(PJDIR)/third_party/lib \
|
||||
$(APP_THIRD_PARTY_LIBS) \
|
||||
+ $(APP_THIRD_PARTY_EXT) \
|
||||
$(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
|
||||
$(LDFLAGS)
|
||||
|
21
telephony/pjsua/patches/patch-pjmedia_build_os-auto_mak_in
Normal file
21
telephony/pjsua/patches/patch-pjmedia_build_os-auto_mak_in
Normal file
@ -0,0 +1,21 @@
|
||||
$OpenBSD: patch-pjmedia_build_os-auto_mak_in,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
|
||||
--- pjmedia/build/os-auto.mak.in.orig Wed Jun 3 14:29:35 2009
|
||||
+++ pjmedia/build/os-auto.mak.in Wed Mar 31 10:28:45 2010
|
||||
@@ -86,7 +86,13 @@ endif
|
||||
# PortAudio
|
||||
#
|
||||
ifneq ($(findstring pa,$(AC_PJMEDIA_SND)),)
|
||||
+ifeq (@ac_external_pa@,1)
|
||||
+# External PA
|
||||
+export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1
|
||||
+else
|
||||
+# Our PA in third_party
|
||||
export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1
|
||||
+endif
|
||||
endif
|
||||
|
||||
#
|
@ -1,17 +0,0 @@
|
||||
$OpenBSD: patch-pjmedia_build_os-openbsd_mak,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjmedia/build/os-openbsd.mak.orig Sat Jun 2 19:16:29 2007
|
||||
+++ pjmedia/build/os-openbsd.mak Sat Jun 2 19:37:26 2007
|
||||
@@ -0,0 +1,13 @@
|
||||
+AC_PJMEDIA_SND=pa_unix
|
||||
+AC_PA_USE_ALSA=0
|
||||
+
|
||||
+export CODEC_OBJS += l16.o
|
||||
+export CODEC_OBJS += gsm.o
|
||||
+export CFLAGS += -I$(THIRD_PARTY)/build/speex -I$(THIRD_PARTY)/speex/include
|
||||
+export CODEC_OBJS += speex_codec.o
|
||||
+export PJMEDIA_OBJS += echo_speex.o
|
||||
+export CODEC_OBJS += ilbc.o
|
||||
+export CFLAGS += -I$(THIRD_PARTY)/build/portaudio \
|
||||
+ -I$(THIRD_PARTY)/portaudio/include \
|
||||
+ -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_PORTAUDIO_SOUND
|
||||
+export SOUND_OBJS = pasound.o
|
@ -0,0 +1,22 @@
|
||||
$OpenBSD: patch-pjmedia_include_pjmedia-codec_config_auto_h_in,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
|
||||
--- pjmedia/include/pjmedia-codec/config_auto.h.in.orig Wed Apr 15 16:45:41 2009
|
||||
+++ pjmedia/include/pjmedia-codec/config_auto.h.in Wed Mar 31 10:28:45 2010
|
||||
@@ -42,12 +42,14 @@
|
||||
#undef PJMEDIA_HAS_GSM_CODEC
|
||||
#endif
|
||||
|
||||
+#undef PJMEDIA_EXTERNAL_GSM_CODEC
|
||||
|
||||
/* Speex codec */
|
||||
#ifndef PJMEDIA_HAS_SPEEX_CODEC
|
||||
#undef PJMEDIA_HAS_SPEEX_CODEC
|
||||
#endif
|
||||
|
||||
+#undef PJMEDIA_EXTERNAL_SPEEX_CODEC
|
||||
|
||||
/* iLBC codec */
|
||||
#ifndef PJMEDIA_HAS_ILBC_CODEC
|
@ -0,0 +1,45 @@
|
||||
$OpenBSD: patch-pjmedia_src_pjmedia-audiodev_pa_dev_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
fix a bug with PaUtil_SetDebugPrintFunction() and external portaudio
|
||||
|
||||
--- pjmedia/src/pjmedia-audiodev/pa_dev.c.orig Wed Jun 3 14:29:35 2009
|
||||
+++ pjmedia/src/pjmedia-audiodev/pa_dev.c Wed Mar 31 10:28:45 2010
|
||||
@@ -30,6 +30,11 @@
|
||||
#define THIS_FILE "pa_dev.c"
|
||||
#define DRIVER_NAME "PA"
|
||||
|
||||
+/* Enable call to PaUtil_SetDebugPrintFunction, but this is not always
|
||||
+ * available across all PortAudio versions (?)
|
||||
+ */
|
||||
+/*#define USE_PA_DEBUG_PRINT */
|
||||
+
|
||||
struct pa_aud_factory
|
||||
{
|
||||
pjmedia_aud_dev_factory base;
|
||||
@@ -404,6 +409,7 @@ static int PaRecorderPlayerCallback( const void *input
|
||||
return rc;
|
||||
}
|
||||
|
||||
+#ifdef USE_PA_DEBUG_PRINT
|
||||
/* Logging callback from PA */
|
||||
static void pa_log_cb(const char *log)
|
||||
{
|
||||
@@ -415,6 +421,7 @@ static void pa_log_cb(const char *log)
|
||||
*/
|
||||
typedef void (*PaUtilLogCallback ) (const char *log);
|
||||
void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb);
|
||||
+#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -442,7 +449,9 @@ static pj_status_t pa_init(pjmedia_aud_dev_factory *f)
|
||||
|
||||
PJ_UNUSED_ARG(f);
|
||||
|
||||
+#ifdef USE_PA_DEBUG_PRINT
|
||||
PaUtil_SetDebugPrintFunction(&pa_log_cb);
|
||||
+#endif
|
||||
|
||||
err = Pa_Initialize();
|
||||
|
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-pjmedia_src_pjmedia-codec_gsm_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix header detection when using external libgsm on OpenBSD
|
||||
|
||||
--- pjmedia/src/pjmedia-codec/gsm.c.orig Sat Jun 13 17:28:37 2009
|
||||
+++ pjmedia/src/pjmedia-codec/gsm.c Wed Mar 31 16:14:16 2010
|
||||
@@ -28,12 +28,17 @@
|
||||
#include <pj/pool.h>
|
||||
#include <pj/string.h>
|
||||
#include <pj/os.h>
|
||||
-#include "../../third_party/gsm/inc/gsm.h"
|
||||
|
||||
/*
|
||||
* Only build this file if PJMEDIA_HAS_GSM_CODEC != 0
|
||||
*/
|
||||
#if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC != 0
|
||||
+
|
||||
+#if defined(PJMEDIA_EXTERNAL_GSM_CODEC) && PJMEDIA_EXTERNAL_GSM_CODEC
|
||||
+# include <gsm.h>
|
||||
+#else
|
||||
+# include "../../third_party/gsm/inc/gsm.h"
|
||||
+#endif
|
||||
|
||||
/* We removed PLC in 0.6 (and re-enabled it again in 0.9!) */
|
||||
#define PLC_DISABLED 0
|
@ -1,27 +0,0 @@
|
||||
$OpenBSD: patch-pjmedia_src_pjmedia_tonegen_c,v 1.1 2007/11/06 02:50:28 deanna Exp $
|
||||
--- pjmedia/src/pjmedia/tonegen.c.orig Sat Nov 3 20:54:49 2007
|
||||
+++ pjmedia/src/pjmedia/tonegen.c Sat Nov 3 20:58:27 2007
|
||||
@@ -16,6 +16,7 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
+#include <math.h>
|
||||
#include <pjmedia/tonegen.h>
|
||||
#include <pjmedia/errno.h>
|
||||
#include <pj/assert.h>
|
||||
@@ -44,7 +45,6 @@
|
||||
* the normal sin() generator.
|
||||
* Speed = 40.6 cycles per sample.
|
||||
*/
|
||||
-# include <math.h>
|
||||
struct gen
|
||||
{
|
||||
DATA a, s0, s1;
|
||||
@@ -99,7 +99,6 @@
|
||||
|
||||
#else
|
||||
# error "Should never get to this part"
|
||||
-# include <math.h>
|
||||
/*
|
||||
* Should never really reach here, but anyway it's provided for reference.
|
||||
* This is the good old tone generator using sin().
|
@ -1,41 +0,0 @@
|
||||
$OpenBSD: patch-pjsip-apps_src_pjsua_pjsua_app_c,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjsip-apps/src/pjsua/pjsua_app.c.orig Mon May 14 12:45:20 2007
|
||||
+++ pjsip-apps/src/pjsua/pjsua_app.c Sun Jun 3 00:32:57 2007
|
||||
@@ -3142,20 +3142,17 @@ pj_status_t app_destroy(void)
|
||||
static void stereo_demo()
|
||||
{
|
||||
pjmedia_port *conf, *splitter, *ch1;
|
||||
- unsigned clock;
|
||||
pj_status_t status;
|
||||
|
||||
/* Disable existing sound device */
|
||||
conf = pjsua_set_no_snd_dev();
|
||||
|
||||
- clock = app_config.media_cfg.clock_rate;
|
||||
-
|
||||
/* Create stereo-mono splitter/combiner */
|
||||
status = pjmedia_splitcomb_create(app_config.pool,
|
||||
- clock /* clock rate */,
|
||||
+ conf->info.clock_rate /* clock rate */,
|
||||
2 /* stereo */,
|
||||
- clock*2*10/1000/* 10ms samples * 2ch */,
|
||||
- 16 /* bits */,
|
||||
+ 2 * conf->info.samples_per_frame,
|
||||
+ conf->info.bits_per_sample,
|
||||
0 /* options */,
|
||||
&splitter);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
@@ -3182,10 +3179,10 @@ static void stereo_demo()
|
||||
|
||||
/* Create sound device */
|
||||
status = pjmedia_snd_port_create(app_config.pool, -1, -1,
|
||||
- clock /* clock rate */,
|
||||
+ conf->info.clock_rate,
|
||||
2 /* stereo */,
|
||||
- clock*2*10/1000 /* 10 ms samples * 2ch */,
|
||||
- 16 /* bits */,
|
||||
+ 2 * conf->info.samples_per_frame,
|
||||
+ conf->info.bits_per_sample,
|
||||
0, &app_config.snd);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
|
@ -1,38 +0,0 @@
|
||||
$OpenBSD: patch-pjsip-apps_src_py_pjsua_setup_py,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- pjsip-apps/src/py_pjsua/setup.py.orig Thu May 24 10:19:01 2007
|
||||
+++ pjsip-apps/src/py_pjsua/setup.py Thu May 24 12:09:57 2007
|
||||
@@ -24,11 +24,14 @@ setup(name="py_pjsua", version="0.1",
|
||||
["py_pjsua.c"],
|
||||
include_dirs=[pjproject + "pjsip/include",
|
||||
pjproject + "pjlib/include",
|
||||
- pjproject + "pjlib-util/include", pjproject + "pjmedia/include"],
|
||||
+ pjproject + "pjlib-util/include", pjproject + "pjmedia/include",
|
||||
+ pjproject + "pjnath/include"],
|
||||
library_dirs=[pjproject + "pjsip/lib",
|
||||
pjproject + "pjlib/lib",
|
||||
pjproject + "pjmedia/lib",
|
||||
- pjproject + "pjlib-util/lib"],
|
||||
+ pjproject + "pjlib-util/lib",
|
||||
+ pjproject + "pjnath/lib",
|
||||
+ pjproject + "third_party/lib"],
|
||||
libraries=[ "pjsua-" + target,
|
||||
"pjsip-ua-" + target,
|
||||
"pjsip-simple-" + target,
|
||||
@@ -37,9 +40,16 @@ setup(name="py_pjsua", version="0.1",
|
||||
"pjmedia-" + target,
|
||||
"pjmedia-codec-" + target,
|
||||
"pjlib-util-" + target,
|
||||
+ "pjnath-" + target,
|
||||
"pj-" + target,
|
||||
+ "gsmcodec-" + target,
|
||||
+ "speex-" + target,
|
||||
+ "ilbccodec-" + target,
|
||||
+ "portaudio-" + target,
|
||||
+ "resample-" + target,
|
||||
+ "pjlib-util-" + target,
|
||||
"ssl",
|
||||
"crypto",
|
||||
- "asound"]),
|
||||
+ "ossaudio"]),
|
||||
])
|
||||
|
9
telephony/pjsua/patches/patch-pjsip_include_pjsua_h
Normal file
9
telephony/pjsua/patches/patch-pjsip_include_pjsua_h
Normal file
@ -0,0 +1,9 @@
|
||||
$OpenBSD: patch-pjsip_include_pjsua_h,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
missing include
|
||||
|
||||
--- pjsip/include/pjsua.h.orig Wed Mar 31 10:28:45 2010
|
||||
+++ pjsip/include/pjsua.h Wed Mar 31 10:28:45 2010
|
||||
@@ -0,0 +1 @@
|
||||
+#include <pjsua-lib/pjsua.h>
|
@ -0,0 +1,63 @@
|
||||
$OpenBSD: patch-pjsip_src_pjsip_sip_transport_udp_c,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
remove the code that silently set SO_SNDBUF/SO_RCVBUF as it's not
|
||||
compatible with all platforms
|
||||
|
||||
--- pjsip/src/pjsip/sip_transport_udp.c.orig Tue Mar 17 12:25:52 2009
|
||||
+++ pjsip/src/pjsip/sip_transport_udp.c Wed Mar 31 10:28:45 2010
|
||||
@@ -50,12 +50,19 @@
|
||||
*
|
||||
* More experiments are needed probably.
|
||||
*/
|
||||
+/* 2010/01/14
|
||||
+ * Too many people complained about seeing "Error setting SNDBUF" log,
|
||||
+ * so lets just remove this. People who want to have SNDBUF set can
|
||||
+ * still do so by declaring these two macros in config_site.h
|
||||
+ */
|
||||
#ifndef PJSIP_UDP_SO_SNDBUF_SIZE
|
||||
-# define PJSIP_UDP_SO_SNDBUF_SIZE (24*1024*1024)
|
||||
+/*# define PJSIP_UDP_SO_SNDBUF_SIZE (24*1024*1024)*/
|
||||
+# define PJSIP_UDP_SO_SNDBUF_SIZE 0
|
||||
#endif
|
||||
|
||||
#ifndef PJSIP_UDP_SO_RCVBUF_SIZE
|
||||
-# define PJSIP_UDP_SO_RCVBUF_SIZE (24*1024*1024)
|
||||
+/*# define PJSIP_UDP_SO_RCVBUF_SIZE (24*1024*1024)*/
|
||||
+# define PJSIP_UDP_SO_RCVBUF_SIZE 0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -550,10 +557,13 @@ static void udp_set_socket(struct udp_transport *tp,
|
||||
pj_sock_t sock,
|
||||
const pjsip_host_port *a_name)
|
||||
{
|
||||
+#if PJSIP_UDP_SO_RCVBUF_SIZE || PJSIP_UDP_SO_SNDBUF_SIZE
|
||||
long sobuf_size;
|
||||
pj_status_t status;
|
||||
+#endif
|
||||
|
||||
/* Adjust socket rcvbuf size */
|
||||
+#if PJSIP_UDP_SO_RCVBUF_SIZE
|
||||
sobuf_size = PJSIP_UDP_SO_RCVBUF_SIZE;
|
||||
status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_RCVBUF(),
|
||||
&sobuf_size, sizeof(sobuf_size));
|
||||
@@ -563,8 +573,10 @@ static void udp_set_socket(struct udp_transport *tp,
|
||||
PJ_LOG(4,(THIS_FILE, "Error setting SO_RCVBUF: %s [%d]", errmsg,
|
||||
status));
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* Adjust socket sndbuf size */
|
||||
+#if PJSIP_UDP_SO_SNDBUF_SIZE
|
||||
sobuf_size = PJSIP_UDP_SO_SNDBUF_SIZE;
|
||||
status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_SNDBUF(),
|
||||
&sobuf_size, sizeof(sobuf_size));
|
||||
@@ -574,6 +586,7 @@ static void udp_set_socket(struct udp_transport *tp,
|
||||
PJ_LOG(4,(THIS_FILE, "Error setting SO_SNDBUF: %s [%d]", errmsg,
|
||||
status));
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* Set the socket. */
|
||||
tp->sock = sock;
|
@ -0,0 +1,41 @@
|
||||
$OpenBSD: patch-third_party_build_os-auto_mak_in,v 1.1 2010/04/02 11:48:24 dcoppa Exp $
|
||||
|
||||
fix from upstream:
|
||||
enable use of system libraries for gsm, speex and portaudio
|
||||
|
||||
--- third_party/build/os-auto.mak.in.orig Wed Apr 15 16:45:41 2009
|
||||
+++ third_party/build/os-auto.mak.in Wed Mar 31 10:28:45 2010
|
||||
@@ -1,21 +1,33 @@
|
||||
|
||||
ifneq (@ac_no_gsm_codec@,1)
|
||||
+ifeq (@ac_external_gsm@,1)
|
||||
+# External
|
||||
+else
|
||||
DIRS += gsm
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifneq (@ac_no_ilbc_codec@,1)
|
||||
DIRS += ilbc
|
||||
endif
|
||||
|
||||
ifneq (@ac_no_speex_codec@,1)
|
||||
+ifeq (@ac_external_speex@,1)
|
||||
+# External speex
|
||||
+else
|
||||
DIRS += speex
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifneq (@ac_no_g7221_codec@,1)
|
||||
DIRS += g7221
|
||||
endif
|
||||
|
||||
ifneq ($(findstring pa,@ac_pjmedia_snd@),)
|
||||
+ifeq (@ac_external_pa@,1)
|
||||
+# External PA
|
||||
+else
|
||||
DIRS += portaudio
|
||||
+endif
|
||||
endif
|
||||
|
@ -1,9 +0,0 @@
|
||||
$OpenBSD: patch-third_party_build_os-openbsd_mak,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- third_party/build/os-openbsd.mak.orig Sat Jun 2 19:16:29 2007
|
||||
+++ third_party/build/os-openbsd.mak Sat Jun 2 19:16:29 2007
|
||||
@@ -0,0 +1,5 @@
|
||||
+DIRS = resample
|
||||
+DIRS += portaudio
|
||||
+DIRS += gsm
|
||||
+DIRS += speex
|
||||
+DIRS += ilbc
|
@ -1,9 +0,0 @@
|
||||
$OpenBSD: patch-third_party_build_portaudio_os-openbsd_mak,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
--- third_party/build/portaudio/os-openbsd.mak.orig Sat Jun 2 19:16:29 2007
|
||||
+++ third_party/build/portaudio/os-openbsd.mak Sat Jun 2 19:16:29 2007
|
||||
@@ -0,0 +1,5 @@
|
||||
+PORTAUDIO_OBJS += pa_unix_oss.o pa_unix_util.o \
|
||||
+ pa_unix_hostapis.o
|
||||
+
|
||||
+AC_PJMEDIA_SND=pa_unix
|
||||
+export CFLAGS += -DPA_USE_OSS=1
|
@ -1,255 +0,0 @@
|
||||
$OpenBSD: patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c,v 1.3 2008/06/18 21:16:39 todd Exp $
|
||||
--- third_party/portaudio/src/hostapi/oss/pa_unix_oss.c.orig Sun Mar 25 15:20:31 2007
|
||||
+++ third_party/portaudio/src/hostapi/oss/pa_unix_oss.c Wed Jun 18 14:37:03 2008
|
||||
@@ -8,6 +8,8 @@
|
||||
* Dominic Mazzoni
|
||||
* Arve Knudsen
|
||||
*
|
||||
+ * Updated to Id: pa_unix_oss.c 1278 2007-09-12 17:39:48Z aknudsen $
|
||||
+ *
|
||||
* Based on the Open Source API proposed by Ross Bencina
|
||||
* Copyright (c) 1999-2002 Ross Bencina, Phil Burk
|
||||
*
|
||||
@@ -32,19 +34,19 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
- * The text above constitutes the entire PortAudio license; however,
|
||||
+ * The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
- * they can be incorporated into the canonical version. It is also
|
||||
- * requested that these non-binding requests be included along with the
|
||||
+ * they can be incorporated into the canonical version. It is also
|
||||
+ * requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file
|
||||
- @ingroup hostaip_src
|
||||
+ @ingroup hostapi_src
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -63,18 +65,8 @@
|
||||
#include <limits.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
-#ifdef HAVE_SYS_SOUNDCARD_H
|
||||
-# include <sys/soundcard.h>
|
||||
-# define DEVICE_NAME_BASE "/dev/dsp"
|
||||
-#elif defined(HAVE_LINUX_SOUNDCARD_H)
|
||||
-# include <linux/soundcard.h>
|
||||
-# define DEVICE_NAME_BASE "/dev/dsp"
|
||||
-#elif defined(HAVE_MACHINE_SOUNDCARD_H)
|
||||
-# include <machine/soundcard.h> /* JH20010905 */
|
||||
+# include <soundcard.h>
|
||||
# define DEVICE_NAME_BASE "/dev/audio"
|
||||
-#else
|
||||
-# error No sound card header file
|
||||
-#endif
|
||||
|
||||
#include "portaudio.h"
|
||||
#include "pa_util.h"
|
||||
@@ -84,6 +76,7 @@
|
||||
#include "pa_cpuload.h"
|
||||
#include "pa_process.h"
|
||||
#include "pa_unix_util.h"
|
||||
+#include "pa_debugprint.h"
|
||||
|
||||
static int sysErr_;
|
||||
static pthread_t mainThread_;
|
||||
@@ -113,7 +106,7 @@ static pthread_t mainThread_;
|
||||
*/
|
||||
static int Get_AFMT_S16_NE( void )
|
||||
{
|
||||
- long testData = 1;
|
||||
+ long testData = 1;
|
||||
char *ptr = (char *) &testData;
|
||||
int isLittle = ( *ptr == 1 ); /* Does address point to least significant byte? */
|
||||
return isLittle ? AFMT_S16_LE : AFMT_S16_BE;
|
||||
@@ -384,7 +377,7 @@ static PaError QueryDirection( const char *deviceName,
|
||||
{
|
||||
maxNumChannels = (stereo) ? 2 : 1;
|
||||
}
|
||||
- PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels ))
|
||||
+ PA_DEBUG(( "%s: use SNDCTL_DSP_STEREO, maxNumChannels = %d\n", __FUNCTION__, maxNumChannels ));
|
||||
}
|
||||
|
||||
/* During channel negotiation, the last ioctl() may have failed. This can
|
||||
@@ -402,8 +395,12 @@ static PaError QueryDirection( const char *deviceName,
|
||||
sr = 44100;
|
||||
if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 )
|
||||
{
|
||||
- result = paUnanticipatedHostError;
|
||||
- goto error;
|
||||
+ sr = 48000;
|
||||
+ if( ioctl( devHandle, SNDCTL_DSP_SPEED, &sr ) < 0 )
|
||||
+ {
|
||||
+ result = paUnanticipatedHostError;
|
||||
+ goto error;
|
||||
+ }
|
||||
}
|
||||
|
||||
*defaultSampleRate = sr;
|
||||
@@ -507,9 +504,9 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta
|
||||
/* Find devices by calling QueryDevice on each
|
||||
* potential device names. When we find a valid one,
|
||||
* add it to a linked list.
|
||||
- * A: Can there only be 10 devices? */
|
||||
+ * A: Set an arbitrary of 100 devices, should probably be a smarter way. */
|
||||
|
||||
- for( i = 0; i < 10; i++ )
|
||||
+ for( i = 0; i < 100; i++ )
|
||||
{
|
||||
char deviceName[32];
|
||||
PaDeviceInfo *deviceInfo;
|
||||
@@ -809,9 +806,11 @@ static PaError OpenDevices( const char *idevName, cons
|
||||
ENSURE_( *idev = open( idevName, flags ), paDeviceUnavailable );
|
||||
PA_ENSURE( ModifyBlocking( *idev, 1 ) ); /* Blocking */
|
||||
|
||||
+#ifndef __OpenBSD__
|
||||
/* Initially disable */
|
||||
enableBits = ~PCM_ENABLE_INPUT;
|
||||
ENSURE_( ioctl( *idev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError );
|
||||
+#endif
|
||||
}
|
||||
if( odevName )
|
||||
{
|
||||
@@ -820,9 +819,11 @@ static PaError OpenDevices( const char *idevName, cons
|
||||
ENSURE_( *odev = open( odevName, flags ), paDeviceUnavailable );
|
||||
PA_ENSURE( ModifyBlocking( *odev, 1 ) ); /* Blocking */
|
||||
|
||||
+#ifndef __OpenBSD__
|
||||
/* Initially disable */
|
||||
enableBits = ~PCM_ENABLE_OUTPUT;
|
||||
ENSURE_( ioctl( *odev, SNDCTL_DSP_SETTRIGGER, &enableBits ), paUnanticipatedHostError );
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -848,6 +849,7 @@ static PaError PaOssStream_Initialize( PaOssStream *st
|
||||
memset( stream, 0, sizeof (PaOssStream) );
|
||||
stream->isStopped = 1;
|
||||
|
||||
+ ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError );
|
||||
PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) );
|
||||
|
||||
if( inputParameters && outputParameters )
|
||||
@@ -884,7 +886,6 @@ static PaError PaOssStream_Initialize( PaOssStream *st
|
||||
&ossApi->blockingStreamInterface, callback, userData );
|
||||
}
|
||||
|
||||
- ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError );
|
||||
|
||||
error:
|
||||
return result;
|
||||
@@ -975,8 +976,8 @@ static int CalcHigherLogTwo( int n )
|
||||
return log2;
|
||||
}
|
||||
|
||||
-static PaError PaOssStreamComponent_Configure( PaOssStreamComponent *component, double sampleRate, unsigned long framesPerBuffer,
|
||||
- StreamMode streamMode, PaOssStreamComponent *master )
|
||||
+static PaError PaOssStreamComponent_Configure( PaOssStreamComponent *component, double sampleRate, unsigned long
|
||||
+ framesPerBuffer, StreamMode streamMode, PaOssStreamComponent *master )
|
||||
{
|
||||
PaError result = paNoError;
|
||||
int temp, nativeFormat;
|
||||
@@ -986,7 +987,7 @@ static PaError PaOssStreamComponent_Configure( PaOssSt
|
||||
int frgmt;
|
||||
int numBufs;
|
||||
int bytesPerBuf;
|
||||
- double bufSz;
|
||||
+ unsigned long bufSz;
|
||||
unsigned long fragSz;
|
||||
audio_buf_info bufInfo;
|
||||
|
||||
@@ -998,21 +999,21 @@ static PaError PaOssStreamComponent_Configure( PaOssSt
|
||||
* The hardware need not respect the requested fragment size, so we may have to adapt.
|
||||
*/
|
||||
if( framesPerBuffer == paFramesPerBufferUnspecified )
|
||||
- {
|
||||
- bufSz = component->latency * sampleRate;
|
||||
+ {
|
||||
+ bufSz = (unsigned long)(component->latency * sampleRate);
|
||||
fragSz = bufSz / 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
fragSz = framesPerBuffer;
|
||||
- bufSz = component->latency * sampleRate + fragSz; /* Latency + 1 buffer */
|
||||
+ bufSz = (unsigned long)(component->latency * sampleRate) + fragSz; /* Latency + 1 buffer */
|
||||
}
|
||||
|
||||
PA_ENSURE( GetAvailableFormats( component, &availableFormats ) );
|
||||
hostFormat = PaUtil_SelectClosestAvailableFormat( availableFormats, component->userFormat );
|
||||
|
||||
/* OSS demands at least 2 buffers, and 16 bytes per buffer */
|
||||
- numBufs = PA_MAX( bufSz / fragSz, 2 );
|
||||
+ numBufs = (int)PA_MAX( bufSz / fragSz, 2 );
|
||||
bytesPerBuf = PA_MAX( fragSz * Pa_GetSampleSize( hostFormat ) * chans, 16 );
|
||||
|
||||
/* The fragment parameters are encoded like this:
|
||||
@@ -1119,7 +1120,8 @@ static PaError PaOssStream_Configure( PaOssStream *str
|
||||
if( stream->capture )
|
||||
{
|
||||
PaOssStreamComponent *component = stream->capture;
|
||||
- PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In, NULL );
|
||||
+ PA_ENSURE( PaOssStreamComponent_Configure( component, sampleRate, framesPerBuffer, StreamMode_In,
|
||||
+ NULL ) );
|
||||
|
||||
assert( component->hostChannelCount > 0 );
|
||||
assert( component->hostFrames > 0 );
|
||||
@@ -1187,6 +1189,7 @@ static PaError OpenStream( struct PaUtilHostApiReprese
|
||||
const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0;
|
||||
int bpInitialized = 0;
|
||||
double inLatency = 0., outLatency = 0.;
|
||||
+ int i = 0;
|
||||
|
||||
/* validate platform specific flags */
|
||||
if( (streamFlags & paPlatformSpecificFlags) != 0 )
|
||||
@@ -1222,7 +1225,14 @@ static PaError OpenStream( struct PaUtilHostApiReprese
|
||||
return paInvalidChannelCount;
|
||||
}
|
||||
}
|
||||
-
|
||||
+
|
||||
+#if 0
|
||||
+ /* Round framesPerBuffer to the next power-of-two to make OSS happy. */
|
||||
+ framesPerBuffer &= INT_MAX;
|
||||
+ for (i = 1; framesPerBuffer > i; i <<= 1) ;
|
||||
+ framesPerBuffer = i;
|
||||
+#endif
|
||||
+
|
||||
/* allocate and do basic initialization of the stream structure */
|
||||
PA_UNLESS( stream = (PaOssStream*)PaUtil_AllocateMemory( sizeof(PaOssStream) ), paInsufficientMemory );
|
||||
PA_ENSURE( PaOssStream_Initialize( stream, inputParameters, outputParameters, streamCallback, userData, streamFlags, ossHostApi ) );
|
||||
@@ -1594,7 +1604,8 @@ static void *PaOSS_AudioThreadProc( void *userData )
|
||||
*/
|
||||
if( !initiateProcessing )
|
||||
{
|
||||
- PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) ); /* Wait on available frames */
|
||||
+ /* Wait on available frames */
|
||||
+ PA_ENSURE( PaOssStream_WaitForFrames( stream, &framesAvail ) );
|
||||
assert( framesAvail % stream->framesPerHostBuffer == 0 );
|
||||
}
|
||||
else
|
||||
@@ -1933,11 +1944,11 @@ static signed long GetStreamReadAvailable( PaStream* s
|
||||
static signed long GetStreamWriteAvailable( PaStream* s )
|
||||
{
|
||||
PaOssStream *stream = (PaOssStream*)s;
|
||||
- int delay = 0;
|
||||
+ struct count_info delay;
|
||||
|
||||
- if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 )
|
||||
+ if( ioctl( stream->playback->fd, SNDCTL_DSP_GETOPTR, &delay ) < 0 )
|
||||
return paUnanticipatedHostError;
|
||||
-
|
||||
- return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback );
|
||||
+
|
||||
+ return (PaOssStreamComponent_BufferSize( stream->playback ) - delay.ptr) / PaOssStreamComponent_FrameSize( stream->playback );
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
$OpenBSD: patch-third_party_speex_libspeex__kiss_fft_guts_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
|
||||
--- third_party/speex/libspeex/_kiss_fft_guts.h.orig Sat Nov 3 16:43:08 2007
|
||||
+++ third_party/speex/libspeex/_kiss_fft_guts.h Sat Nov 3 16:44:10 2007
|
||||
@@ -12,8 +12,8 @@ Redistribution and use in source and binary forms, wit
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
-#define MIN(a,b) ((a)<(b) ? (a):(b))
|
||||
-#define MAX(a,b) ((a)>(b) ? (a):(b))
|
||||
+#define SPEEX_MIN(a,b) ((a)<(b) ? (a):(b))
|
||||
+#define SPEEX_MAX(a,b) ((a)>(b) ? (a):(b))
|
||||
|
||||
/* kiss_fft.h
|
||||
defines kiss_fft_scalar as either short or a float type
|
||||
@@ -130,8 +130,8 @@ struct kiss_fft_state{
|
||||
|
||||
|
||||
#ifdef FIXED_POINT
|
||||
-# define KISS_FFT_COS(phase) floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase))))
|
||||
-# define KISS_FFT_SIN(phase) floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase))))
|
||||
+# define KISS_FFT_COS(phase) floor(SPEEX_MIN(32767,SPEEX_MAX(-32767,.5+32768 * cos (phase))))
|
||||
+# define KISS_FFT_SIN(phase) floor(SPEEX_MIN(32767,SPEEX_MAX(-32767,.5+32768 * sin (phase))))
|
||||
# define HALF_OF(x) ((x)>>1)
|
||||
#elif defined(USE_SIMD)
|
||||
# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )
|
@ -1,29 +0,0 @@
|
||||
$OpenBSD: patch-third_party_speex_libspeex_stack_alloc_h,v 1.1 2007/11/06 02:50:28 deanna Exp $
|
||||
--- third_party/speex/libspeex/stack_alloc.h.orig Sat Nov 3 16:37:45 2007
|
||||
+++ third_party/speex/libspeex/stack_alloc.h Sat Nov 3 16:38:22 2007
|
||||
@@ -93,19 +93,19 @@
|
||||
|
||||
#include <valgrind/memcheck.h>
|
||||
|
||||
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
|
||||
+#define SPEEX_ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
|
||||
|
||||
-#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
|
||||
+#define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),SPEEX_ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
|
||||
|
||||
-#define PUSHS(stack, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(long)),VALGRIND_MAKE_WRITABLE(stack, (sizeof(type))),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
|
||||
+#define PUSHS(stack, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),SPEEX_ALIGN((stack),sizeof(long)),VALGRIND_MAKE_WRITABLE(stack, (sizeof(type))),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
|
||||
|
||||
#else
|
||||
|
||||
-#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
|
||||
+#define SPEEX_ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
|
||||
|
||||
-#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
|
||||
+#define PUSH(stack, size, type) (SPEEX_ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
|
||||
|
||||
-#define PUSHS(stack, type) (ALIGN((stack),sizeof(long)),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
|
||||
+#define PUSHS(stack, type) (SPEEX_ALIGN((stack),sizeof(long)),(stack)+=(sizeof(type)),(type*)((stack)-(sizeof(type))))
|
||||
|
||||
#endif
|
||||
|
@ -1,2 +1,2 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2007/10/27 04:34:23 deanna Exp $
|
||||
bin/pjsua
|
||||
@comment $OpenBSD: PLIST,v 1.2 2010/04/02 11:48:24 dcoppa Exp $
|
||||
@bin bin/pjsua
|
||||
|
Loading…
x
Reference in New Issue
Block a user