Commit 2f6ce2d6 authored by smorlat's avatar smorlat

improve doxygen generation

msvolume work in progress.



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@354 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 566bc6f8
......@@ -405,6 +405,13 @@ AC_SUBST(PACKAGE_DATA_DIR)
dnl check for video4linux headers
AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
dnl ##################################################
dnl # Check for doxygen
dnl ##################################################
AC_PATH_PROG(DOXYGEN,doxygen,false)
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
dnl ##################################################
dnl # Check for ESP Packager
......@@ -480,6 +487,6 @@ build/wince/Makefile
mediastreamer.pc
mediastreamer2.spec
help/Makefile
help/DoxyFile
help/Doxyfile
help/doxygen.dox
)
......@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
PROJECT_NAME = mediastreamer2
PROJECT_NUMBER = @MEDIASTREAMER_VERSION@
OUTPUT_DIRECTORY = help/doc
OUTPUT_DIRECTORY = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
......@@ -80,8 +80,9 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = help/ \
include/
INPUT = . \
../include/ \
../src
FILE_PATTERNS = *.h \
*.c \
*.dox
......@@ -89,7 +90,7 @@ RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = .
EXAMPLE_PATH = ../
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
......@@ -188,7 +189,7 @@ ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = include/
INCLUDE_PATH = ../include/mediastreamer2
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED = DOXYGEN
EXPAND_AS_DEFINED =
......
EXTRA_DIST = DoxyFile.in doxygen.dox.in
EXTRA_DIST = Doxyfile.in doxygen.dox.in
all: DoxyFile doxygen.dox
#html doc
if HAVE_DOXYGEN
SOURCES=$(top_srcdir)/include/mediastreamer2/*.h $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h
# doxdir & pkgdocdir are not always defined by automake
docdir=$(datadir)/doc
pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION)
doc_htmldir=$(pkgdocdir)/html
doc_html_DATA = $(top_builddir)/help/doc/html/html.tar
$(doc_html_DATA): $(top_builddir)/help/doc/html/index.html
cd $(<D) && tar cf html.tar *
$(top_builddir)/help/doc/html/index.html: $(SOURCES) Doxyfile Makefile.am
rm -rf doc
$(DOXYGEN) Doxyfile
install-data-hook:
cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar
uninstall-hook:
cd $(DESTDIR)$(doc_htmldir) && rm -rf html
endif
doc-clean:
rm -rf doc
......@@ -38,6 +38,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* set a gain */
#define MS_VOLUME_SET_GAIN MS_FILTER_METHOD(MS_VOLUME_ID,2,float)
#define MS_VOLUME_GET_EA_STATE MS_FILTER_METHOD(MS_VOLUME_ID,3, int)
#define MS_VOLUME_SET_PEER MS_FILTER_METHOD(MS_VOLUME_ID,4, MSFilter )
extern MSFilterDesc ms_volume_desc;
#endif
......@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* @defgroup mediastreamer2_soundcard Sound Card API - manage audio capture/play filters.
* @defgroup mediastreamer2_webcam Camera API - manage video capture devices
* @ingroup mediastreamer2_api
* @{
*/
......@@ -86,12 +86,6 @@ typedef struct _MSWebCam MSWebCam;
extern "C"{
#endif
/**
* @defgroup mediastreamer2_webcammanager WebCam Manager API
* @ingroup mediastreamer2_webcam
* @{
*/
/**
* Retreive a webcam manager object.
*
......@@ -151,14 +145,6 @@ void ms_web_cam_manager_add_cam(MSWebCamManager *m, MSWebCam *c);
*/
void ms_web_cam_manager_register_desc(MSWebCamManager *m, MSWebCamDesc *desc);
/** @} */
/**
* @defgroup mediastreamer2_webcamfilter Sound Card Filter API
* @ingroup mediastreamer2_webcam
* @{
*/
/**
* Create an INPUT filter based on the selected camera.
*
......@@ -215,9 +201,6 @@ const char *ms_web_cam_get_name(const MSWebCam *obj);
const char *ms_web_cam_get_string_id(MSWebCam *obj);
/** @} */
/*specific methods for static image:*/
void ms_static_image_set_default_image(const char *path);
......
......@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static const float max_e=32767*32767;
static const float coef=0.1;
static const float gain_k=0.2;
static const float noise_thres=0.1;
......@@ -32,6 +33,7 @@ typedef struct Volume{
float gain;
float static_gain;
MSFilter *peer;
bool_t ea_active;
}Volume;
static void volume_init(MSFilter *f){
......@@ -39,6 +41,7 @@ static void volume_init(MSFilter *f){
v->energy=0;
v->norm_en=0;
v->static_gain=v->gain=1;
v->ea_active=FALSE;
f->data=v;
}
......@@ -63,20 +66,54 @@ static int volume_get_linear(MSFilter *f, void *arg){
static void volume_echo_avoider_process(Volume *v){
float peer_e;
float gain;
ms_filter_call_method(v->peer,MS_VOLUME_GET_LINEAR,&peer_e);
if (peer_e>noise_thres){
/*lower our output*/
v->gain=v->static_gain*(1-peer_e);
}else v->gain=v->static_gain;
if (v->ea_active){
if (peer_e>noise_thres){
/*lower our output*/
gain=v->static_gain*(1-peer_e);
}else {
gain=v->static_gain;
v->ea_active=FALSE;
}
}else{
int peer_active=FALSE;
ms_filter_call_method(v->peer,MS_VOLUME_GET_EA_STATE,&peer_active);
if (peer_e>noise_thres && ! peer_active){
/*lower our output*/
gain=v->static_gain*(1-peer_e);
v->ea_active=TRUE;
}else gain=v->static_gain;
}
v->gain=(v->gain*(1-gain_k)) + (gain_k*coef);
}
static void volume_set_gain(MSFilter *f, void *arg){
static int volume_set_gain(MSFilter *f, void *arg){
float *farg=(float*)arg;
Volume *v=(Volume*)f->data;
v->gain=v->static_gain=*farg;
return 0;
}
static int volume_get_ea_state(MSFilter *f, void *arg){
int *barg=(int*)arg;
Volume *v=(Volume*)f->data;
*barg=v->ea_active;
return 0;
}
static int volume_set_peer(MSFilter *f, void *arg){
MSFilter *p=(MSFilter*)arg;
Volume *v=(Volume*)f->data;
v->peer=p;
return 0;
}
static inline int16_t saturate(float val){
return (val>32767) ? 32767 : ( (val<-32767) ? -32767 : val);
}
static void volume_process(MSFilter *f){
mblk_t *m;
int16_t *sample;
......@@ -89,6 +126,17 @@ static void volume_process(MSFilter *f){
float s=*sample;
en=(s*s*coef) + (1.0-coef)*en;
}
if (v->peer){
volume_echo_avoider_process(v);
}
if (v->gain!=1){
for ( sample=(int16_t*)m->b_rptr;
sample<(int16_t*)m->b_wptr;
++sample){
float s=*sample;
*sample=saturate(s*v->gain);
}
}
ms_queue_put(f->outputs[0],m);
}
v->energy=en;
......@@ -98,6 +146,8 @@ static MSFilterMethod methods[]={
{ MS_VOLUME_GET , volume_get },
{ MS_VOLUME_GET_LINEAR , volume_get_linear },
{ MS_VOLUME_SET_GAIN , volume_set_gain },
{ MS_VOLUME_GET_EA_STATE , volume_get_ea_state },
{ MS_VOLUME_SET_PEER , volume_set_peer },
{ 0 , NULL }
};
......
......@@ -7,6 +7,7 @@ SUBDIRS=src build include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ortp.pc
SOURCES=include/ortp/*.h src/*.c src/*.h
#html doc
if HAVE_DOXYGEN
......@@ -29,7 +30,7 @@ install-data-hook:
cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar && rm -f html.tar
uninstall-hook:
cd $(DESTDIR)$(doc_htmldir) && rm -rf *
cd $(DESTDIR)$(doc_htmldir) && rm -rf html
endif
......
......@@ -247,7 +247,7 @@ echo "$ORTPDEPS_CFLAGS" > ortp.defs
dnl ##################################################
dnl # Check for gtk-doc.
dnl # Check for doxygen
dnl ##################################################
AC_PATH_PROG(DOXYGEN,doxygen,false)
......
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