Commit 4e245d3a authored by jehan's avatar jehan

remove IOS IO unit ringer sound card. enable aqsound for IOS 5 to fix ringing issue in FG mode

parent 3e62df33
......@@ -134,16 +134,23 @@ if test $GCC = yes && test $wall_werror = yes; then
fi
macosx_found=no
ios_found=false
mingw32ce_found=no
dnl add thread flags
case $target_os in
*darwin*)
MSPLUGINS_CFLAGS=""
MSPLUGINS_LIBS="-dynamiclib"
case $host_alias in
i386-apple*)
ios_found=yes
;;
armv6-apple*)
ios_found=yes
;;
armv7-apple*)
ios_found=yes
;;
x86_64-apple*)
macosx_found=yes
LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio "
;;
;;
*mingw32ce)
CFLAGS="$CFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -D_WIN32_WCE -DORTP_STATIC"
CXXFLAGS="$CXXFLAGS -DINET6 -DORTP_INET6 -D_WIN32_WINNT=0x0501 -DORTP_STATIC -D_WIN32_WCE"
......@@ -167,7 +174,11 @@ dnl ORTP_STATIC to tell ortp not to export its variable with dllexport, as if we
;;
esac
if test "$macosx_found" == "yes" || test "$ios_found" == "yes" ; then
MSPLUGINS_CFLAGS=""
MSPLUGINS_LIBS="-dynamiclib"
LIBS="$LIBS -framework CoreFoundation -framework AudioToolbox -framework CoreAudio "
fi
dnl localization tools
IT_PROG_INTLTOOL([0.40], [no-xml])
......@@ -366,13 +377,17 @@ AC_ARG_ENABLE(macsnd,
*) AC_MSG_ERROR(bad value ${enableval} for --enable-macsnd) ;;
esac],[macsnd=true])
macaqsnd_default=false;
if test "$ios_found" = "yes" ; then
macaqsnd_default=true;
fi
AC_ARG_ENABLE(macaqsnd,
[ --enable-macaqsnd Turn on native macosx Audio Queue sound support (default=no)],
[case "${enableval}" in
yes) macaqsnd=true ;;
no) macaqsnd=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-macaqsnd) ;;
esac],[macaqsnd=false])
esac],[macaqsnd=$macaqsnd_default])
......@@ -383,32 +398,18 @@ if test "$macosx_found" = "yes" ; then
LIBS="$LIBS -framework Carbon -framework AudioUnit"
found_sound=yes
fi
if test "$macaqsnd" = "true"; then
AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
found_sound=yes
macaqsnd=true
fi
fi
if test "$macaqsnd" = "true"; then
AC_DEFINE(__MAC_AQ_ENABLED__,1,[defined if native macosx AQ sound support is available])
found_sound=yes
macaqsnd=true
fi
AM_CONDITIONAL(BUILD_MACSND, test x$macsnd_enabled = xtrue)
AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd = xtrue)
AC_ARG_ENABLE(iounit,
[ --enable-iounit Turn on native iOS audio unit support (default=no)],
[case "${enableval}" in
yes) iounit=true ;;
no) iounit=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-iounit) ;;
esac],[iounit=false])
if test "$iounit" = "true"; then
AC_DEFINE(__MACIOUNIT_ENABLED__,1,[defined if native apple iounit support is available])
iounit_enabled=true
found_sound=yes
fi
AM_CONDITIONAL(BUILD_MACIOUNIT, test x$iounit_enabled = xtrue)
AM_CONDITIONAL(BUILD_IOSIOUNIT, test x$ios_found = xyes)
AC_ARG_ENABLE(jack,
[ --disable-jack Disable jack support],
......
......@@ -112,7 +112,7 @@ if BUILD_MACSND
libmediastreamer_la_SOURCES+=macsnd.c
endif
if BUILD_MACIOUNIT
if BUILD_IOSIOUNIT
libmediastreamer_la_SOURCES+=msiounit.c
endif
......
......@@ -69,6 +69,7 @@ extern void libmsandroidopengldisplay_init(void);
#ifdef ANDROID
#include <android/log.h>
#endif
#include "msprivate.h"
#if defined(WIN32) && !defined(_WIN32_WCE)
static MSList *ms_plugins_loaded_list;
......@@ -464,7 +465,7 @@ extern MSSndCardDesc aq_card_desc;
extern MSSndCardDesc pulse_card_desc;
#endif
#ifdef __IOSIOUNIT_ENABLED__
#if TARGET_OS_IPHONE
extern MSSndCardDesc au_card_desc;
#endif
......@@ -501,7 +502,7 @@ static MSSndCardDesc * ms_snd_card_descs[]={
&pulse_card_desc,
#endif
#ifdef __IOSIOUNIT_ENABLED__
#if TARGET_OS_IPHONE
&au_card_desc,
#endif
#ifdef ANDROID
......@@ -751,3 +752,25 @@ void ms_get_cur_time(MSTimeSpec *ret){
ret->tv_nsec=ts.tv_nsec;
#endif
}
struct _MSConcealerContext {
uint64_t sample_time;
int plc_count;
};
void ms_concealer_context_init(MSConcealerContext* obj){
obj->sample_time=0;
obj->plc_count=0;
}
void ms_concealer_context_update_sampling_time(MSConcealerContext* obj,unsigned int delta) {
obj->sample_time+=delta;
}
bool_t ms_concealer_context_is_concealement_required(MSConcealerContext* obj,uint64_t current_time) {
if (obj->sample_time < current_time) {
obj->plc_count++;
return TRUE;
} else {
if (obj->plc_count) {
ms_warning("Did packet loss concealment for ",obj->plc_count*20);
}
}
}
......@@ -166,8 +166,8 @@ static void au_detect(MSSndCardManager *m){
ms_debug("au_detect");
MSSndCard *card=au_card_new(AU_CARD_RECEIVER);
ms_snd_card_manager_add_card(m,card);
card=au_card_new(AU_CARD_SPEAKER);
ms_snd_card_manager_add_card(m,card);
//card=au_card_new(AU_CARD_SPEAKER); //Disabled because iounit cannot be used in play only mode on IOS 5.0
//ms_snd_card_manager_add_card(m,card);
}
static OSStatus au_read_cb (
......
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2012 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef msprivate_h
#define msprivate_h
#include "ortp/port.h"
typedef struct _MSConcealerContext MSConcealerContext;
void ms_concealer_context_init(MSConcealerContext* obj);
void ms_concealer_context_update_sampling_time(MSConcealerContext* obj,unsigned int delta);
bool_t ms_concealer_context_is_concealement_required(MSConcealerContext* obj,uint64_t current_time);
#endif
\ No newline at end of file
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