bump to 1.12, merge improved lantiq aud_dev driver

SVN-Revision: 30520
This commit is contained in:
John Crispin 2012-02-14 15:05:55 +00:00
parent d82c9a1b15
commit b0a11ba9fe
7 changed files with 1605 additions and 1145 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=pjsip
PKG_VERSION:=1.10
PKG_RELEASE:=3
PKG_VERSION:=1.12
PKG_RELEASE:=1
PKG_SOURCE:=pjproject-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.pjsip.org/release/$(PKG_VERSION)/
PKG_MD5SUM:=e215d0637d3422d49a63c2cde6673951
PKG_MD5SUM:=1db8e5a5dd73b216409b15afa34651a4
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
@ -69,14 +69,15 @@ CONFIGURE_ARGS += \
EXTRA_CFLAGS:=-I$(STAGING_DIR)/usr/include/drv_tapi -I$(STAGING_DIR)/usr/include/drv_vmmc
endif
Package/pjsip-oss=$(call Package/pjsip-template,oss,)
Package/pjsip-oss=$(call Package/pjsip-template,oss,BROKEN)
Package/pjsip-ltq-tapi=$(call Package/pjsip-template,ltq-tapi,@TARGET_lantiq +TARGET_lantiq:kmod-ltq-tapi +TARGET_lantiq:kmod-ltq-vmmc)
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
ifneq ($(USE_LOCAL),)
define Build/Prepare
$(PKG_UNPACK)
$(Build/Patch)
$(CP) ./src/* $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)
endef
endif
define Build/Configure
(cd $(PKG_BUILD_DIR); autoconf aconfigure.ac > aconfigure)

View File

@ -1,3 +1,15 @@
From 01108f66fd20dcdbb9fde0dd00924ee4e8c28a7c Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Sat, 28 Jan 2012 21:41:18 +0100
Subject: [PATCH 1/3] configure fixup
---
pjproject-1.12/aconfigure.ac | 13 +++++++++++--
pjproject-1.12/pjmedia/build/os-auto.mak.in | 9 ++++++++-
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/aconfigure.ac b/aconfigure.ac
index 84295b5..e34fd32 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -48,9 +48,9 @@ if test -z "$CROSS_COMPILE"; then
@ -10,13 +22,12 @@
-if test "$LD" = ""; then LD="$CC"; fi
+LD="${CROSS_COMPILE}gcc"
AC_SUBST(LD)
if test "$LDOUT" = ""; then LDOUT="-o"; fi
if test "$LDOUT" = ""; then LDOUT="-o "; fi
AC_SUBST(LDOUT)
@@ -597,6 +597,15 @@ AC_ARG_ENABLE(ext_sound,
AC_MSG_RESULT([Checking if external sound is set... yes])
@@ -604,6 +604,15 @@ AC_ARG_ENABLE(ext_sound,
fi]
)
+
+AC_ARG_ENABLE(ltq_tapi,
+ AC_HELP_STRING([--enable-ltq-tapi],
+ [PJMEDIA will use ltq tapi backend]),
@ -25,12 +36,15 @@
+ AC_MSG_RESULT([Checking if external sound is set... yes])
+ fi]
+ )
+
dnl # Include resampling small filter
AC_SUBST(ac_no_small_filter)
AC_ARG_ENABLE(small-filter,
diff --git a/pjmedia/build/os-auto.mak.in b/pjmedia/build/os-auto.mak.in
index 145f1d5..be38aeb 100644
--- a/pjmedia/build/os-auto.mak.in
+++ b/pjmedia/build/os-auto.mak.in
@@ -118,4 +118,11 @@ ifeq ($(AC_PJMEDIA_SND),external)
@@ -125,4 +125,11 @@ ifeq ($(AC_PJMEDIA_SND),external)
export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=0 -DPJMEDIA_AUDIO_DEV_HAS_WMME=0
endif
@ -43,3 +57,6 @@
+export PJMEDIA_AUDIODEV_OBJS += tapi_dev.o
+export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_TAPI_DEVICE=1
+endif
--
1.7.7.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,229 @@
From 1e0d5dbf8b7714dfd490add0e2b507fd513414f3 Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Fri, 3 Feb 2012 21:45:08 +0100
Subject: [PATCH 3/3] adds PJ_DEF(pj_status_t) pjsua_add_snd_port(int id)
---
pjproject-1.12/pjsip/include/pjsua-lib/pjsua.h | 2 +
.../pjsip/include/pjsua-lib/pjsua_internal.h | 4 +-
pjproject-1.12/pjsip/src/pjsua-lib/pjsua_media.c | 69 ++++++++++++++------
3 files changed, 54 insertions(+), 21 deletions(-)
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 85dbbbb..ad3e020 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1543,6 +1543,8 @@ PJ_DECL(pjmedia_endpt*) pjsua_get_pjmedia_endpt(void);
PJ_DECL(pj_pool_factory*) pjsua_get_pool_factory(void);
+PJ_DECL(pj_status_t) pjsua_add_snd_port(int id, pjsua_conf_port_id *p_id);
+
/*****************************************************************************
* Utilities.
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index 6c27826..4ba91ed 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -261,6 +261,8 @@ typedef struct pjsua_stun_resolve
} pjsua_stun_resolve;
+#define MAX_PORT 2
+
/**
* Global pjsua application data.
*/
@@ -336,7 +338,7 @@ struct pjsua_data
pj_bool_t aud_open_cnt;/**< How many # device is opened */
pj_bool_t no_snd; /**< No sound (app will manage it) */
pj_pool_t *snd_pool; /**< Sound's private pool. */
- pjmedia_snd_port *snd_port; /**< Sound port. */
+ pjmedia_snd_port *snd_port[MAX_PORT]; /**< Sound port. */
pj_timer_entry snd_idle_timer;/**< Sound device idle timer. */
pjmedia_master_port *null_snd; /**< Master port for null sound. */
pjmedia_port *null_port; /**< Null port. */
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 7d53cad..8a882f3 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -588,7 +588,7 @@ static void check_snd_dev_idle()
* It is idle when there is no port connection in the bridge and
* there is no active call.
*/
- if ((pjsua_var.snd_port!=NULL || pjsua_var.null_snd!=NULL) &&
+ if ((pjsua_var.snd_port[0]!=NULL || pjsua_var.null_snd!=NULL) &&
pjsua_var.snd_idle_timer.id == PJ_FALSE &&
pjmedia_conf_get_connect_count(pjsua_var.mconf) == 0 &&
call_cnt == 0 &&
@@ -2009,7 +2009,7 @@ PJ_DEF(pj_status_t) pjsua_conf_connect( pjsua_conf_port_id source,
pj_assert(status == PJ_SUCCESS);
/* Check if sound device is instantiated. */
- need_reopen = (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL &&
+ need_reopen = (pjsua_var.snd_port[0]==NULL && pjsua_var.null_snd==NULL &&
!pjsua_var.no_snd);
/* Check if sound device need to reopen because it needs to modify
@@ -2067,7 +2067,7 @@ PJ_DEF(pj_status_t) pjsua_conf_connect( pjsua_conf_port_id source,
/* The bridge version */
/* Create sound port if none is instantiated */
- if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL &&
+ if (pjsua_var.snd_port[0]==NULL && pjsua_var.null_snd==NULL &&
!pjsua_var.no_snd)
{
pj_status_t status;
@@ -2679,9 +2679,9 @@ static pj_status_t update_initial_aud_param()
pjmedia_aud_param param;
pj_status_t status;
- PJ_ASSERT_RETURN(pjsua_var.snd_port != NULL, PJ_EBUG);
+ PJ_ASSERT_RETURN(pjsua_var.snd_port[0] != NULL, PJ_EBUG);
- strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port);
+ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port[0]);
status = pjmedia_aud_stream_get_param(strm, &param);
if (status != PJ_SUCCESS) {
@@ -2747,7 +2747,7 @@ static pj_status_t open_snd_dev(pjmedia_snd_port_param *param)
1000 / param->base.clock_rate));
status = pjmedia_snd_port_create2( pjsua_var.snd_pool,
- param, &pjsua_var.snd_port);
+ param, &pjsua_var.snd_port[0]);
if (status != PJ_SUCCESS)
return status;
@@ -2805,13 +2805,13 @@ static pj_status_t open_snd_dev(pjmedia_snd_port_param *param)
}
/* Connect sound port to the bridge */
- status = pjmedia_snd_port_connect(pjsua_var.snd_port,
+ status = pjmedia_snd_port_connect(pjsua_var.snd_port[0],
conf_port );
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to connect conference port to "
"sound device", status);
- pjmedia_snd_port_destroy(pjsua_var.snd_port);
- pjsua_var.snd_port = NULL;
+ pjmedia_snd_port_destroy(pjsua_var.snd_port[0]);
+ pjsua_var.snd_port[0] = NULL;
return status;
}
@@ -2826,7 +2826,7 @@ static pj_status_t open_snd_dev(pjmedia_snd_port_param *param)
pjmedia_aud_param si;
pj_str_t tmp;
- strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port);
+ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port[0]);
status = pjmedia_aud_stream_get_param(strm, &si);
if (status == PJ_SUCCESS)
status = pjmedia_aud_dev_get_info(si.rec_id, &rec_info);
@@ -2869,12 +2869,12 @@ static pj_status_t open_snd_dev(pjmedia_snd_port_param *param)
static void close_snd_dev(void)
{
/* Close sound device */
- if (pjsua_var.snd_port) {
+ if (pjsua_var.snd_port[0]) {
pjmedia_aud_dev_info cap_info, play_info;
pjmedia_aud_stream *strm;
pjmedia_aud_param param;
- strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port);
+ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port[0]);
pjmedia_aud_stream_get_param(strm, &param);
if (pjmedia_aud_dev_get_info(param.rec_id, &cap_info) != PJ_SUCCESS)
@@ -2886,9 +2886,9 @@ static void close_snd_dev(void)
"%s sound capture device",
play_info.name, cap_info.name));
- pjmedia_snd_port_disconnect(pjsua_var.snd_port);
- pjmedia_snd_port_destroy(pjsua_var.snd_port);
- pjsua_var.snd_port = NULL;
+ pjmedia_snd_port_disconnect(pjsua_var.snd_port[0]);
+ pjmedia_snd_port_destroy(pjsua_var.snd_port[0]);
+ pjsua_var.snd_port[0] = NULL;
}
/* Close null sound device */
@@ -2968,6 +2968,35 @@ PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev,
return PJ_SUCCESS;
}
+PJ_DEF(pj_status_t) pjsua_add_snd_port(int id, pjsua_conf_port_id *p_id)
+{
+ unsigned alt_cr_cnt = 1;
+ unsigned alt_cr = 0;
+ pj_status_t status = -1;
+ pjmedia_snd_port_param param;
+ unsigned samples_per_frame;
+ pjmedia_port *port;
+ const pj_str_t name = pj_str("tapi2");
+ alt_cr = pjsua_var.media_cfg.clock_rate;
+ samples_per_frame = alt_cr *
+ pjsua_var.media_cfg.audio_frame_ptime *
+ pjsua_var.media_cfg.channel_count / 1000;
+ status = create_aud_param(&param.base,
+ pjsua_var.play_dev,
+ pjsua_var.cap_dev,
+ alt_cr,
+ pjsua_var.media_cfg.channel_count,
+ samples_per_frame, 16);
+ if (status != PJ_SUCCESS)
+ return status;
+ param.base.rec_id = id;
+ param.base.play_id = id;
+ param.options = 0;
+ status = pjmedia_snd_port_create2(pjsua_var.snd_pool,
+ &param, &pjsua_var.snd_port[id]);
+ return PJ_SUCCESS;
+}
+
/*
* Get currently active sound devices. If sound devices has not been created
@@ -3054,8 +3083,8 @@ PJ_DEF(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options)
{
pjsua_var.media_cfg.ec_tail_len = tail_ms;
- if (pjsua_var.snd_port)
- return pjmedia_snd_port_set_ec( pjsua_var.snd_port, pjsua_var.pool,
+ if (pjsua_var.snd_port[0])
+ return pjmedia_snd_port_set_ec( pjsua_var.snd_port[0], pjsua_var.pool,
tail_ms, options);
return PJ_SUCCESS;
@@ -3077,7 +3106,7 @@ PJ_DEF(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms)
*/
PJ_DEF(pj_bool_t) pjsua_snd_is_active(void)
{
- return pjsua_var.snd_port != NULL;
+ return pjsua_var.snd_port[0] != NULL;
}
@@ -3099,7 +3128,7 @@ PJ_DEF(pj_status_t) pjsua_snd_set_setting( pjmedia_aud_dev_cap cap,
if (pjsua_snd_is_active()) {
pjmedia_aud_stream *strm;
- strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port);
+ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port[0]);
status = pjmedia_aud_stream_set_cap(strm, cap, pval);
} else {
status = PJ_SUCCESS;
@@ -3137,7 +3166,7 @@ PJ_DEF(pj_status_t) pjsua_snd_get_setting( pjmedia_aud_dev_cap cap,
/* Sound is active, retrieve from device directly */
pjmedia_aud_stream *strm;
- strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port);
+ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port[0]);
return pjmedia_aud_stream_get_cap(strm, cap, pval);
} else {
/* Otherwise retrieve from internal param */
--
1.7.7.1

View File

@ -1,92 +0,0 @@
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -511,7 +511,7 @@ PJ_DEF(pj_status_t) pjsua_acc_add_local(
"<sip:%s%.*s%s:%d%s>",
beginquote,
(int)t->local_name.host.slen,
- t->local_name.host.ptr,
+ t->local_name.host.slen ? t->local_name.host.ptr : "",
endquote,
t->local_name.port,
transport_param);
@@ -1327,19 +1327,19 @@ static pj_bool_t acc_check_nat_addr(pjsu
len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE,
"<sip:%.*s%s%s%.*s%s:%d;transport=%s%.*s%s>%.*s",
(int)acc->user_part.slen,
- acc->user_part.ptr,
+ acc->user_part.slen ? acc->user_part.ptr : "",
(acc->user_part.slen? "@" : ""),
beginquote,
(int)via_addr->slen,
- via_addr->ptr,
+ via_addr->slen ? via_addr->ptr : "",
endquote,
rport,
tp->type_name,
(int)acc->cfg.contact_uri_params.slen,
- acc->cfg.contact_uri_params.ptr,
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
ob,
(int)acc->cfg.contact_params.slen,
- acc->cfg.contact_params.ptr);
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
if (len < 1) {
PJ_LOG(1,(THIS_FILE, "URI too long"));
pj_pool_release(pool);
@@ -2467,23 +2467,23 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uac
contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
"%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s",
(int)acc->display.slen,
- acc->display.ptr,
+ acc->display.slen ? acc->display.ptr : "",
(acc->display.slen?" " : ""),
(secure ? PJSUA_SECURE_SCHEME : "sip"),
(int)acc->user_part.slen,
- acc->user_part.ptr,
+ acc->user_part.slen ? acc->user_part.ptr : "",
(acc->user_part.slen?"@":""),
beginquote,
(int)local_addr.slen,
- local_addr.ptr,
+ local_addr.slen ? local_addr.ptr : "",
endquote,
local_port,
transport_param,
(int)acc->cfg.contact_uri_params.slen,
- acc->cfg.contact_uri_params.ptr,
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
ob,
(int)acc->cfg.contact_params.slen,
- acc->cfg.contact_params.ptr);
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
return PJ_SUCCESS;
}
@@ -2625,22 +2625,22 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uas
contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
"%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
(int)acc->display.slen,
- acc->display.ptr,
+ acc->display.slen ? acc->display.ptr : "",
(acc->display.slen?" " : ""),
(secure ? PJSUA_SECURE_SCHEME : "sip"),
(int)acc->user_part.slen,
- acc->user_part.ptr,
+ acc->user_part.slen ? acc->user_part.ptr : "",
(acc->user_part.slen?"@":""),
beginquote,
(int)local_addr.slen,
- local_addr.ptr,
+ local_addr.slen ? local_addr.ptr : "",
endquote,
local_port,
transport_param,
(int)acc->cfg.contact_uri_params.slen,
- acc->cfg.contact_uri_params.ptr,
+ acc->cfg.contact_uri_params.slen ? acc->cfg.contact_uri_params.ptr : "",
(int)acc->cfg.contact_params.slen,
- acc->cfg.contact_params.ptr);
+ acc->cfg.contact_params.slen ? acc->cfg.contact_params.ptr : "");
return PJ_SUCCESS;
}

View File

@ -1,23 +0,0 @@
--- a/pjmedia/src/pjmedia-audiodev/audiodev.c
+++ b/pjmedia/src/pjmedia-audiodev/audiodev.c
@@ -98,6 +98,10 @@ pjmedia_aud_dev_factory* pjmedia_symb_md
pjmedia_aud_dev_factory* pjmedia_null_audio_factory(pj_pool_factory *pf);
#endif
+#if PJMEDIA_AUDIO_DEV_HAS_TAPI_DEVICE
+pjmedia_aud_dev_factory* pjmedia_tapi_factory(pj_pool_factory *pf);
+#endif
+
#define MAX_DRIVERS 16
#define MAX_DEVS 64
@@ -409,6 +413,9 @@ PJ_DEF(pj_status_t) pjmedia_aud_subsys_i
#if PJMEDIA_AUDIO_DEV_HAS_NULL_AUDIO
aud_subsys.drv[aud_subsys.drv_cnt++].create = &pjmedia_null_audio_factory;
#endif
+#if PJMEDIA_AUDIO_DEV_HAS_TAPI_DEVICE
+ aud_subsys.drv[aud_subsys.drv_cnt++].create = &pjmedia_tapi_factory;
+#endif
/* Initialize each factory and build the device ID list */
for (i=0; i<aud_subsys.drv_cnt; ++i) {

File diff suppressed because it is too large Load Diff