From 6265d9fff1bb353d2419401c716d09777ca5c73f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 25 Sep 2009 22:34:38 +0200 Subject: [PATCH 1/7] prepare iphone sdk compilation --- linphone/Makefile.am | 1 - linphone/configure.in | 1 - linphone/mediastreamer2/configure.ac | 2 +- linphone/mediastreamer2/src/aqsnd.c | 2 +- linphone/po/Makefile.in.in | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linphone/Makefile.am b/linphone/Makefile.am index 9dea313bf..1a8910fd5 100644 --- a/linphone/Makefile.am +++ b/linphone/Makefile.am @@ -146,4 +146,3 @@ Portfile-devel: $(top_srcdir)/scripts/Portfile-devel.tmpl dist sed -e 's/\@VERSION\@/$(LINPHONE_VERSION)/g' \ -e 's/\@LINPHONE_MD5\@/$(shell md5sum linphone-$(VERSION).tar.gz | awk {'print $$1'})/' < $< > $@ - diff --git a/linphone/configure.in b/linphone/configure.in index 11b4ea271..e054b38a8 100644 --- a/linphone/configure.in +++ b/linphone/configure.in @@ -423,7 +423,6 @@ dnl ################################################## AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) - AC_OUTPUT([ Makefile m4/Makefile diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac index 6559af89f..6ee623a16 100644 --- a/linphone/mediastreamer2/configure.ac +++ b/linphone/mediastreamer2/configure.ac @@ -134,7 +134,7 @@ case $target_os in MSPLUGINS_CFLAGS="" MSPLUGINS_LIBS="-dynamiclib" macosx_found=yes - LIBS="$LIBS -framework CoreFoundation -framework Cocoa" + LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio" ;; *mingw32ce) CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC" diff --git a/linphone/mediastreamer2/src/aqsnd.c b/linphone/mediastreamer2/src/aqsnd.c index b3317bbbd..0c7f06bd8 100644 --- a/linphone/mediastreamer2/src/aqsnd.c +++ b/linphone/mediastreamer2/src/aqsnd.c @@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -#if !defined(__AudioHardware_h__) +#if (!defined(__AudioHardware_h__) & !defined(__IPHONE_3_0)) #include "AudioHardware.h" #endif diff --git a/linphone/po/Makefile.in.in b/linphone/po/Makefile.in.in index 402a25f7a..c7e83022c 100644 --- a/linphone/po/Makefile.in.in +++ b/linphone/po/Makefile.in.in @@ -56,7 +56,7 @@ ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) From ea8fe67355229743a03e4dcdbe0717233d2991fa Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 30 Nov 2009 12:19:13 +0100 Subject: [PATCH 2/7] add resampler in case both soundread or soundwrite need one --- .../include/mediastreamer2/mediastream.h | 3 +- linphone/mediastreamer2/src/audiostream.c | 48 ++++++++++++++----- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h b/linphone/mediastreamer2/include/mediastreamer2/mediastream.h index 351ccfb77..e0b971fce 100644 --- a/linphone/mediastreamer2/include/mediastreamer2/mediastream.h +++ b/linphone/mediastreamer2/include/mediastreamer2/mediastream.h @@ -55,7 +55,8 @@ struct _AudioStream MSFilter *dtmfgen; MSFilter *ec;/*echo canceler*/ MSFilter *volsend,*volrecv; /*MSVolumes*/ - MSFilter *resampler; + MSFilter *read_resampler; + MSFilter *write_resampler; MSFilter *equalizer; uint64_t last_packet_count; time_t last_packet_time; diff --git a/linphone/mediastreamer2/src/audiostream.c b/linphone/mediastreamer2/src/audiostream.c index dccc009c1..e6379e549 100644 --- a/linphone/mediastreamer2/src/audiostream.c +++ b/linphone/mediastreamer2/src/audiostream.c @@ -111,6 +111,14 @@ bool_t ms_is_ipv6(const char *remote){ return ret; } +static void audio_stream_configure_resampler(AudioStream *st,MSFilter *from,MSFilter *to) { + int from_rate=0, to_rate=0; + ms_filter_call_method(from,MS_FILTER_GET_SAMPLE_RATE,&from_rate); + ms_filter_call_method(to,MS_FILTER_GET_SAMPLE_RATE,&to_rate); + ms_filter_call_method(st->read_resampler,MS_FILTER_SET_SAMPLE_RATE,&from_rate); + ms_filter_call_method(st->read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&to_rate); +} + RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){ RtpSession *rtpr; rtpr=rtp_session_new(RTP_SESSION_SENDRECV); @@ -223,7 +231,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char if (captcard!=NULL) stream->soundread=ms_snd_card_create_reader(captcard); else { stream->soundread=ms_filter_new(MS_FILE_PLAYER_ID); - stream->resampler=ms_filter_new(MS_RESAMPLE_ID); + stream->read_resampler=ms_filter_new(MS_RESAMPLE_ID); if (infile!=NULL) audio_stream_play(stream,infile); } if (playcard!=NULL) stream->soundwrite=ms_snd_card_create_writer(playcard); @@ -279,8 +287,17 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char } /* give the sound filters some properties */ - ms_filter_call_method(stream->soundread,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); - ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate); + if (ms_filter_call_method(stream->soundread,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate) != 0) { + /* need to add resampler*/ + if (stream->read_resampler == NULL) stream->read_resampler=ms_filter_new(MS_RESAMPLE_ID); + } + + if (ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate) != 0) { + /* need to add resampler*/ + if (stream->write_resampler == NULL) stream->write_resampler=ms_filter_new(MS_RESAMPLE_ID); + } + + tmp=1; ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_NCHANNELS, &tmp); @@ -300,15 +317,22 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char stream->equalizer=ms_filter_new(MS_EQUALIZER_ID); tmp=stream->eq_active; ms_filter_call_method(stream->equalizer,MS_EQUALIZER_SET_ACTIVE,&tmp); + /*configure resampler if needed*/ + if (stream->read_resampler){ + audio_stream_configure_resampler(stream,stream->soundread,stream->rtpsend); + } + if (stream->write_resampler){ + audio_stream_configure_resampler(stream,stream->rtprecv,stream->soundwrite); + } /* and then connect all */ /* tip: draw yourself the picture if you don't understand */ /*sending graph*/ ms_connection_helper_start(&h); ms_connection_helper_link(&h,stream->soundread,-1,0); - if (stream->resampler) - ms_connection_helper_link(&h,stream->resampler,0,0); + if (stream->read_resampler) + ms_connection_helper_link(&h,stream->read_resampler,0,0); if (stream->ec) ms_connection_helper_link(&h,stream->ec,1,1); if (stream->volsend) @@ -327,6 +351,8 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char ms_connection_helper_link(&h,stream->volrecv,0,0); if (stream->ec) ms_connection_helper_link(&h,stream->ec,0,0); + if (stream->write_resampler) + ms_connection_helper_link(&h,stream->write_resampler,0,0); ms_connection_helper_link(&h,stream->soundwrite,0,-1); /* create ticker */ @@ -385,14 +411,10 @@ void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const void audio_stream_play(AudioStream *st, const char *name){ if (ms_filter_get_id(st->soundread)==MS_FILE_PLAYER_ID){ - int from_rate=0, to_rate=0; ms_filter_call_method_noarg(st->soundread,MS_FILE_PLAYER_CLOSE); ms_filter_call_method(st->soundread,MS_FILE_PLAYER_OPEN,(void*)name); - ms_filter_call_method(st->soundread,MS_FILTER_GET_SAMPLE_RATE,&from_rate); - ms_filter_call_method(st->rtpsend,MS_FILTER_GET_SAMPLE_RATE,&to_rate); - if (st->resampler){ - ms_filter_call_method(st->resampler,MS_FILTER_SET_SAMPLE_RATE,&from_rate); - ms_filter_call_method(st->resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&to_rate); + if (st->read_resampler){ + audio_stream_configure_resampler(st,st->soundread,st->rtpsend); } ms_filter_call_method_noarg(st->soundread,MS_FILE_PLAYER_START); }else{ @@ -496,8 +518,8 @@ void audio_stream_stop(AudioStream * stream) /*dismantle the outgoing graph*/ ms_connection_helper_start(&h); ms_connection_helper_unlink(&h,stream->soundread,-1,0); - if (stream->resampler!=NULL) - ms_connection_helper_unlink(&h,stream->resampler,0,0); + if (stream->read_resampler!=NULL) + ms_connection_helper_unlink(&h,stream->read_resampler,0,0); if (stream->ec!=NULL) ms_connection_helper_unlink(&h,stream->ec,1,1); if (stream->volsend!=NULL) From a96f288f53fbc520cb73784c03e3cb5bb827a02b Mon Sep 17 00:00:00 2001 From: jehan Date: Tue, 1 Dec 2009 16:22:40 +0100 Subject: [PATCH 3/7] fix resampler configuration issue --- linphone/mediastreamer2/src/audiostream.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/linphone/mediastreamer2/src/audiostream.c b/linphone/mediastreamer2/src/audiostream.c index e6379e549..ac9222d60 100644 --- a/linphone/mediastreamer2/src/audiostream.c +++ b/linphone/mediastreamer2/src/audiostream.c @@ -61,6 +61,8 @@ void audio_stream_free(AudioStream *stream) if (stream->volsend!=NULL) ms_filter_destroy(stream->volsend); if (stream->equalizer!=NULL) ms_filter_destroy(stream->equalizer); if (stream->ticker!=NULL) ms_ticker_destroy(stream->ticker); + if (stream->read_resampler!=NULL) ms_filter_destroy(stream->read_resampler); + if (stream->write_resampler!=NULL) ms_filter_destroy(stream->write_resampler); ms_free(stream); } @@ -111,12 +113,13 @@ bool_t ms_is_ipv6(const char *remote){ return ret; } -static void audio_stream_configure_resampler(AudioStream *st,MSFilter *from,MSFilter *to) { +static void audio_stream_configure_resampler(MSFilter *resampler,MSFilter *from,MSFilter *to) { int from_rate=0, to_rate=0; ms_filter_call_method(from,MS_FILTER_GET_SAMPLE_RATE,&from_rate); ms_filter_call_method(to,MS_FILTER_GET_SAMPLE_RATE,&to_rate); - ms_filter_call_method(st->read_resampler,MS_FILTER_SET_SAMPLE_RATE,&from_rate); - ms_filter_call_method(st->read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&to_rate); + ms_filter_call_method(resampler,MS_FILTER_SET_SAMPLE_RATE,&from_rate); + ms_filter_call_method(resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&to_rate); + ms_debug("configuring from rate[%i] to rate [%i]",from_rate,to_rate); } RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6){ @@ -319,11 +322,11 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char ms_filter_call_method(stream->equalizer,MS_EQUALIZER_SET_ACTIVE,&tmp); /*configure resampler if needed*/ if (stream->read_resampler){ - audio_stream_configure_resampler(stream,stream->soundread,stream->rtpsend); + audio_stream_configure_resampler(stream->read_resampler,stream->soundread,stream->rtpsend); } if (stream->write_resampler){ - audio_stream_configure_resampler(stream,stream->rtprecv,stream->soundwrite); + audio_stream_configure_resampler(stream->write_resampler,stream->rtprecv,stream->soundwrite); } /* and then connect all */ /* tip: draw yourself the picture if you don't understand */ @@ -538,6 +541,8 @@ void audio_stream_stop(AudioStream * stream) ms_connection_helper_unlink(&h,stream->volrecv,0,0); if (stream->ec!=NULL) ms_connection_helper_unlink(&h,stream->ec,0,0); + if (stream->write_resampler!=NULL) + ms_connection_helper_unlink(&h,stream->write_resampler,0,0); ms_connection_helper_unlink(&h,stream->soundwrite,0,-1); } From 356c58591cee8e85d137f1cf5dc1412208b7f3fb Mon Sep 17 00:00:00 2001 From: jehan Date: Fri, 11 Dec 2009 10:52:48 +0100 Subject: [PATCH 4/7] no sound card becomes a warnig --- linphone/mediastreamer2/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac index 6ee623a16..a3affd4a5 100644 --- a/linphone/mediastreamer2/configure.ac +++ b/linphone/mediastreamer2/configure.ac @@ -408,7 +408,7 @@ AC_SUBST(JACK_LIBS) fi if test "$found_sound" = "no"; then - AC_MSG_ERROR([Could not find a support sound driver API]) + AC_MSG_WARN([Could not find a support sound driver API]) fi From 891e565c8de5c9fde8000884e13bc54163f4dd4c Mon Sep 17 00:00:00 2001 From: jehan Date: Mon, 18 Jan 2010 14:22:16 +0100 Subject: [PATCH 5/7] -add enable-ssl configure option to ortp --- linphone/oRTP/configure.ac | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/linphone/oRTP/configure.ac b/linphone/oRTP/configure.ac index db9d8c465..addc9ca25 100644 --- a/linphone/oRTP/configure.ac +++ b/linphone/oRTP/configure.ac @@ -269,10 +269,24 @@ if test $GCC = yes && test $wall_werror = yes; then CFLAGS="$CFLAGS -Werror " fi -AC_CHECK_HEADERS(openssl/hmac.h openssl/md5.h) +AC_ARG_ENABLE(ssl-hmac, + [ --enable-ssl-hmac=[yes/no] enables use of ssl/hmac for stun], + [case "${enableval}" in + yes) ssl_hmac_enabled=yes;; + no) ssl_hmac_enabled=no;; + *) AC_MSG_ERROR("Bad value for --enable-ssl-hmac");; + esac], + [ssl_hmac_enabled=yes]) + +if test "$ssl_hmac_enabled" = "yes" ; then + AC_CHECK_HEADERS(openssl/hmac.h openssl/md5.h) + AC_CHECK_LIB(ssl,SSL_CTX_new,[SSL_LIBS="-lssl"]) + AC_CHECK_LIB(crypto,MD5,[SSL_LIBS="$SSL_LIBS -lcrypto"]) +fi + + + -AC_CHECK_LIB(ssl,SSL_CTX_new,[SSL_LIBS="-lssl"]) -AC_CHECK_LIB(crypto,MD5,[SSL_LIBS="$SSL_LIBS -lcrypto"]) AC_SUBST(SSL_LIBS) From 4b84aa95def0719c335d165abd715dd3ac386664 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 25 Sep 2009 22:34:38 +0200 Subject: [PATCH 6/7] prepare iphone sdk compilation --- linphone/configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/linphone/configure.in b/linphone/configure.in index e054b38a8..11b4ea271 100644 --- a/linphone/configure.in +++ b/linphone/configure.in @@ -423,6 +423,7 @@ dnl ################################################## AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) + AC_OUTPUT([ Makefile m4/Makefile From 1deb060bde48516c33217df22231dd8d86208bb0 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 2 Oct 2009 11:13:20 +0200 Subject: [PATCH 7/7] fix configure.in --- linphone/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linphone/configure.in b/linphone/configure.in index 11b4ea271..eb9b47c34 100644 --- a/linphone/configure.in +++ b/linphone/configure.in @@ -353,7 +353,7 @@ AC_ARG_ENABLE(strict, ) if test "$GCC$strictness" = "yesyes" ; then - STRICT_OPTIONS="-Wall -Wp,-D_FORTIFY_SOURCE=2" + STRICT_OPTIONS="-Wall " STRICT_OPTIONS="$STRICT_OPTIONS -Werror" CFLAGS="$CFLAGS -fno-strict-aliasing" fi