Commit 4a0d7392 authored by Simon Morlat's avatar Simon Morlat

Merge branch 'master' of belledonne-communications.com:linphone-private

parents f5cf118d 1deb060b
......@@ -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'})/' < $< > $@
......@@ -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
......
......@@ -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"
......@@ -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
......
......@@ -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;
......
......@@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <AudioToolbox/AudioToolbox.h>
#if !defined(__AudioHardware_h__)
#if (!defined(__AudioHardware_h__) & !defined(__IPHONE_3_0))
#include "AudioHardware.h"
#endif
......
......@@ -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,6 +113,15 @@ bool_t ms_is_ipv6(const char *remote){
return ret;
}
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(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){
RtpSession *rtpr;
rtpr=rtp_session_new(RTP_SESSION_SENDRECV);
......@@ -223,7 +234,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 +290,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 +320,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->read_resampler,stream->soundread,stream->rtpsend);
}
if (stream->write_resampler){
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 */
/*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 +354,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 +414,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 +521,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)
......@@ -516,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);
}
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment