From 34e84d785998d96a4d46b31b66fbc0ec3d11c905 Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 27 Apr 2009 09:22:26 +0000 Subject: [PATCH] add evrcb0 wizard in progress improve theora packer add \n to dtmf printout. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@440 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/NEWS | 4 + linphone/console/linphonec.c | 2 +- linphone/coreapi/linphonecore.c | 1 - linphone/coreapi/linphonecore.h | 3 + linphone/coreapi/sipsetup.c | 8 ++ linphone/coreapi/sipsetup.h | 1 + linphone/gtk-glade/main.c | 19 ++- linphone/gtk-glade/main.glade | 152 +++++++++++++---------- linphone/gtk-glade/setupwizard.c | 18 ++- linphone/mediastreamer2/acinclude.m4 | 21 ++++ linphone/mediastreamer2/configure.ac | 52 +++++++- linphone/mediastreamer2/src/theora.c | 19 ++- linphone/oRTP/include/ortp/payloadtype.h | 1 + linphone/oRTP/src/avprofile.c | 10 ++ 14 files changed, 235 insertions(+), 76 deletions(-) diff --git a/linphone/NEWS b/linphone/NEWS index c3355328b..29b4cdcab 100644 --- a/linphone/NEWS +++ b/linphone/NEWS @@ -1,3 +1,7 @@ +linphone-3.1.2 -- + * make it work with lastest ffmpeg swscale + * improve theora packer + linphone-3.1.1 -- April 14, 2009 * fix crash when opening property box, in some rare case * windows version uses the new libmsdscap plugin (video capture using directshow) diff --git a/linphone/console/linphonec.c b/linphone/console/linphonec.c index 6618ce3b5..69742f09f 100644 --- a/linphone/console/linphonec.c +++ b/linphone/console/linphonec.c @@ -300,7 +300,7 @@ linphonec_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf){ - printf("Receiving tone %c",dtmf); + printf("Receiving tone %c\n",dtmf); } static void diff --git a/linphone/coreapi/linphonecore.c b/linphone/coreapi/linphonecore.c index cea010d91..01b078e33 100644 --- a/linphone/coreapi/linphonecore.c +++ b/linphone/coreapi/linphonecore.c @@ -2333,7 +2333,6 @@ void linphone_core_stop_waiting(LinphoneCore *lc){ } } - void net_config_uninit(LinphoneCore *lc) { net_config_t *config=&lc->net_conf; diff --git a/linphone/coreapi/linphonecore.h b/linphone/coreapi/linphonecore.h index bb95b7a9b..7b9afc816 100644 --- a/linphone/coreapi/linphonecore.h +++ b/linphone/coreapi/linphonecore.h @@ -762,6 +762,9 @@ The "show" callback is called for the other linphone, causing gui to show up. The method returns 0 if an already running linphone was found*/ int linphone_core_wake_up_possible_already_running_instance(const char *config_file); +/*returns the list of registered SipSetup (linphonecore plugins) */ +const MSList * linphone_core_get_sip_setups(LinphoneCore *lc); + void linphone_core_uninit(LinphoneCore *lc); void linphone_core_destroy(LinphoneCore *lc); diff --git a/linphone/coreapi/sipsetup.c b/linphone/coreapi/sipsetup.c index 56ea93946..790474f77 100644 --- a/linphone/coreapi/sipsetup.c +++ b/linphone/coreapi/sipsetup.c @@ -49,6 +49,10 @@ void sip_setup_register_all(void){ } } +const MSList * linphone_core_get_sip_setups(LinphoneCore *lc){ + return registered_sip_setups; +} + SipSetup *sip_setup_lookup(const char *type_name){ MSList *elem; for(elem=registered_sip_setups;elem!=NULL;elem=elem->next){ @@ -94,6 +98,10 @@ SipSetupContext *sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig return obj; } +unsigned int sip_setup_get_capabilities(SipSetup *s){ + return s->capabilities; +} + int sip_setup_context_get_capabilities(SipSetupContext *ctx){ return ctx->funcs->capabilities; } diff --git a/linphone/coreapi/sipsetup.h b/linphone/coreapi/sipsetup.h index 0e39debc7..6cde352cb 100644 --- a/linphone/coreapi/sipsetup.h +++ b/linphone/coreapi/sipsetup.h @@ -100,6 +100,7 @@ void sip_setup_register(SipSetup *ss); void sip_setup_register_all(void); SipSetup *sip_setup_lookup(const char *type_name); void sip_setup_unregister_all(void); +unsigned int sip_setup_get_capabilities(SipSetup *s); SipSetupContext * sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg); int sip_setup_context_create_account(SipSetupContext *ctx, const char *uri, const char *passwd); diff --git a/linphone/gtk-glade/main.c b/linphone/gtk-glade/main.c index e11f0dc8b..84a9390e7 100644 --- a/linphone/gtk-glade/main.c +++ b/linphone/gtk-glade/main.c @@ -794,6 +794,18 @@ static void linphone_gtk_check_menu_items(void){ audio_only ? "audio_only_item" : "video_item")), TRUE); } +static gboolean linphone_gtk_can_manage_accounts(){ + LinphoneCore *lc=linphone_gtk_get_core(); + const MSList *elem; + for(elem=linphone_core_get_sip_setups(lc);elem!=NULL;elem=elem->next){ + SipSetup *ss=(SipSetup*)elem->data; + if (sip_setup_get_capabilities(ss) & SIP_SETUP_CAP_ACCOUNT_MANAGER){ + return TRUE; + } + } + return FALSE; +} + static void linphone_gtk_configure_main_window(){ static gboolean config_loaded=FALSE; static const char *title; @@ -809,7 +821,10 @@ static void linphone_gtk_configure_main_window(){ config_loaded=TRUE; } linphone_gtk_configure_window(w,"main_window"); - if (title) gtk_window_set_title(GTK_WINDOW(w),title); + if (title) { + gtk_window_set_title(GTK_WINDOW(w),title); + gtk_menu_item_set_label(GTK_MENU_ITEM(linphone_gtk_get_widget(w,"main_menu")),title); + } if (start_call_icon){ GdkPixbuf *pbuf=create_pixbuf(start_call_icon); gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"start_call_icon")),pbuf); @@ -826,6 +841,8 @@ static void linphone_gtk_configure_main_window(){ tmp=g_strdup(home); g_object_set_data(G_OBJECT(menu_item),"home",tmp); } + if (!linphone_gtk_can_manage_accounts()) + gtk_widget_hide(linphone_gtk_get_widget(w,"run_assistant")); } static void linphone_gtk_init_main_window(){ diff --git a/linphone/gtk-glade/main.glade b/linphone/gtk-glade/main.glade index e408f8d87..99c662ca6 100644 --- a/linphone/gtk-glade/main.glade +++ b/linphone/gtk-glade/main.glade @@ -1,7 +1,7 @@ - - - + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK linphone2.png @@ -15,19 +15,33 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _View - True + Linphone True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + + Assistant + True + False + + + + True + gtk-preferences + 1 + + + + + + + gtk-preferences True - gtk-preferences True True @@ -35,22 +49,28 @@ + Call history True - Call history - True + False - + True - gtk-info + gtk-justify-fill + 1 - + + True + + + + + gtk-quit True - gtk-quit True True @@ -113,9 +133,9 @@ + gtk-help True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-help True True @@ -124,22 +144,24 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Show debug messages True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Show debug window - True + False - - gtk-dialog-info + + True + gtk-info + 1 + gtk-about True - gtk-about True True @@ -147,14 +169,15 @@ + Homepage True - Homepage - True + False - + True - gtk-info + gtk-home + 1 @@ -166,6 +189,7 @@ False + 0 @@ -192,13 +216,15 @@ True + + 0 + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 @@ -210,6 +236,9 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-close + + 0 + @@ -227,7 +256,7 @@ False False - GTK_PACK_END + end 2 @@ -237,7 +266,6 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 @@ -249,6 +277,9 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-go-forward + + 0 + @@ -266,7 +297,7 @@ False False - GTK_PACK_END + end 1 @@ -288,6 +319,7 @@ False + 0 @@ -319,6 +351,7 @@ 12 + 0 @@ -361,24 +394,25 @@ Online users False + 0 True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic 120 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + @@ -404,6 +438,7 @@ Online users 8 + 0 @@ -429,12 +464,11 @@ Online users True + D True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - D - 0 3 @@ -447,12 +481,11 @@ Online users + # True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - # - 0 2 @@ -465,12 +498,11 @@ Online users + 0 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - 0 1 @@ -483,12 +515,11 @@ Online users + * True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - * - 0 3 @@ -499,12 +530,11 @@ Online users + C True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - C - 0 3 @@ -517,12 +547,11 @@ Online users + 9 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 9 - 0 2 @@ -535,12 +564,11 @@ Online users + 8 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 0 1 @@ -553,12 +581,11 @@ Online users + 7 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 7 - 0 2 @@ -569,12 +596,11 @@ Online users + B True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - B - 0 3 @@ -587,12 +613,11 @@ Online users + 6 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 0 2 @@ -605,12 +630,11 @@ Online users + 5 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - 0 1 @@ -623,12 +647,11 @@ Online users + 4 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - 0 1 @@ -639,12 +662,11 @@ Online users + A True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - A - 0 3 @@ -655,12 +677,11 @@ Online users + 3 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 0 2 @@ -671,12 +692,11 @@ Online users + 2 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - 0 1 @@ -687,12 +707,11 @@ Online users + 1 True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 @@ -718,6 +737,7 @@ Online users False False + 0 @@ -755,13 +775,15 @@ Online users + + 0 + True True True - 0 diff --git a/linphone/gtk-glade/setupwizard.c b/linphone/gtk-glade/setupwizard.c index 46c92cb40..1546ef036 100644 --- a/linphone/gtk-glade/setupwizard.c +++ b/linphone/gtk-glade/setupwizard.c @@ -65,7 +65,15 @@ GtkWidget *create_finish_page(){ return vbox; } -GtkWidget * linphone_gtk_create_setup_wizard(void){ +static int next_page_handler(int curpage, gpointer data){ + return curpage+1; +} + +static void linphone_gtk_assistant_closed(GtkWidget *w){ + gtk_widget_destroy(w); +} + +GtkWidget * linphone_gtk_create_assistant(void){ GtkWidget *w=gtk_assistant_new(); GtkWidget *p1=create_intro(); GtkWidget *p2=create_setup_signin_choice(); @@ -74,15 +82,23 @@ GtkWidget * linphone_gtk_create_setup_wizard(void){ gtk_assistant_append_page(GTK_ASSISTANT(w),p1); gtk_assistant_set_page_type(GTK_ASSISTANT(w),p1,GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_title(GTK_ASSISTANT(w),p1,_("Welcome to the account setup assistant")); + gtk_assistant_set_page_complete(GTK_ASSISTANT(w),p1,TRUE); gtk_assistant_append_page(GTK_ASSISTANT(w),p2); gtk_assistant_set_page_type(GTK_ASSISTANT(w),p2,GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_title(GTK_ASSISTANT(w),p2,_("Account setup assistant")); + gtk_assistant_set_page_complete(GTK_ASSISTANT(w),p2,TRUE); gtk_assistant_append_page(GTK_ASSISTANT(w),p3); gtk_assistant_set_page_type(GTK_ASSISTANT(w),p3,GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_title(GTK_ASSISTANT(w),p3,_("Account setup assistant - enter your information")); gtk_assistant_append_page(GTK_ASSISTANT(w),p4); gtk_assistant_set_page_type(GTK_ASSISTANT(w),p4,GTK_ASSISTANT_PAGE_SUMMARY); gtk_assistant_set_page_title(GTK_ASSISTANT(w),p4,_("Now ready !")); + + gtk_assistant_set_forward_page_func(GTK_ASSISTANT(w),next_page_handler,w,NULL); + g_signal_connect(G_OBJECT(w),"close",(GCallback)linphone_gtk_assistant_closed,NULL); + g_signal_connect(G_OBJECT(w),"cancel",(GCallback)linphone_gtk_assistant_closed,NULL); + gtk_widget_show(w); + return w; } diff --git a/linphone/mediastreamer2/acinclude.m4 b/linphone/mediastreamer2/acinclude.m4 index d596f7f64..09ae71f6c 100644 --- a/linphone/mediastreamer2/acinclude.m4 +++ b/linphone/mediastreamer2/acinclude.m4 @@ -108,9 +108,30 @@ AC_DEFUN([MS_CHECK_VIDEO],[ fi fi + AC_ARG_ENABLE(theora, + [ --disable-theora Disable theora support], + [case "${enableval}" in + yes) theora=true ;; + no) theora=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-theora) ;; + esac],[theora=true]) + + if test x$theora = xtrue; then PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7 ], [have_theora=yes], [have_theora=no]) + fi + + AC_ARG_ENABLE(x11, + [ --disable-x11 Disable X11 support], + [case "${enableval}" in + yes) enable_x11=true ;; + no) enable_x11=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;; + esac],[enable_x11=true]) + + if test "$enable_x11" = "true"; then AC_CHECK_HEADERS(X11/Xlib.h) + fi VIDEO_CFLAGS=" $FFMPEG_CFLAGS -DVIDEO_ENABLED" VIDEO_LIBS=" $FFMPEG_LIBS $SWSCALE_LIBS" diff --git a/linphone/mediastreamer2/configure.ac b/linphone/mediastreamer2/configure.ac index 214d0c068..ff26e2e2a 100644 --- a/linphone/mediastreamer2/configure.ac +++ b/linphone/mediastreamer2/configure.ac @@ -152,6 +152,15 @@ dnl ********************************* found_sound=no +AC_ARG_ENABLE(oss, + [ --enable-oss Disable oss support], + [case "${enableval}" in + yes) oss=true ;; + no) oss=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;; + esac],[oss=true]) + +if "$oss" = "true"; then AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h) if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \ test "${ac_cv_header_soundcard_h}" = "yes" || \ @@ -159,6 +168,7 @@ if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \ test "${ac_cv_header_machine_soundcard_h}" = "yes"; then found_sound=yes fi +fi AM_CONDITIONAL(BUILD_OSS, test x$found_sound = xyes) @@ -188,12 +198,12 @@ AM_CONDITIONAL(BUILD_ALSA, test x$alsa_enabled = xtrue) AC_ARG_ENABLE(artsc, - [ --enable-artsc Turn on artsc (kde) sound input/output (auto) ], + [ --enable-artsc Turn on artsc (kde<4) sound input/output (no) ], [case "${enableval}" in yes) artsc=true ;; no) artsc=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;; - esac],[artsc=true]) + esac],[artsc=no]) arts_enabled=false @@ -280,6 +290,16 @@ fi AM_CONDITIONAL(BUILD_MACAQSND, test x$macaqsnd_enabled = xtrue) +AC_ARG_ENABLE(jack, + [ --disable-jack Disable jack support], + [case "${enableval}" in + yes) jack=true ;; + no) jack=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-jack) ;; + esac],[jack=true]) + +if test x$jack = xtrue; then + dnl Check for samplerate libraries dnl Check for jack libraries (sound output plugin) PKG_CHECK_MODULES(JACK,jack >= 0.15.0, @@ -306,6 +326,8 @@ fi AC_SUBST(JACK_CFLAGS) AC_SUBST(JACK_LIBS) +fi + if test "$found_sound" = "no"; then AC_MSG_ERROR([Could not find a support sound driver API]) fi @@ -315,6 +337,16 @@ dnl ************************************* dnl check for various codecs libraries dnl ************************************* +AC_ARG_ENABLE(speex, + [ --disable-speex Disable speex support], + [case "${enableval}" in + yes) speex=true ;; + no) speex=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-speex) ;; + esac],[speex=true]) + +if test x$speex = xtrue; then + dnl check for installed version of speex PKG_CHECK_MODULES(SPEEX, speex >= 1.2beta3, [ AC_DEFINE(HAVE_SPEEX_NOISE,1,[tells whether the noise arg of speex_echo_cancel can be used]) ], @@ -331,9 +363,22 @@ PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2beta3, ) AC_SUBST(SPEEX_CFLAGS) AC_SUBST(SPEEX_LIBS) + +fi + AM_CONDITIONAL(BUILD_SPEEX, test x$build_speex = xyes ) AM_CONDITIONAL(BUILD_RESAMPLE, test x$build_resample = xyes ) +AC_ARG_ENABLE(gsm, + [ --disable-gsm Disable gsm support], + [case "${enableval}" in + yes) gsm=true ;; + no) gsm=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-gsm) ;; + esac],[gsm=true]) + +if test x$gsm = xtrue; then + dnl check for gsm build_gsm=no AC_ARG_WITH( gsm, @@ -350,6 +395,9 @@ if test x"$gsmdir" != xno ; then else build_gsm=no fi + +fi + AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes ) MS_CHECK_VIDEO diff --git a/linphone/mediastreamer2/src/theora.c b/linphone/mediastreamer2/src/theora.c index 356ef66d7..ffcc9d3f6 100644 --- a/linphone/mediastreamer2/src/theora.c +++ b/linphone/mediastreamer2/src/theora.c @@ -31,6 +31,7 @@ typedef struct EncState{ uint64_t start_time; uint64_t conf_time; unsigned int mtu; + unsigned int nframes; } EncState; static void enc_init(MSFilter *f){ @@ -63,6 +64,7 @@ static void enc_init(MSFilter *f){ s->start_time=0; s->conf_time=0; s->mtu=ms_get_payload_max_size()-6; + s->nframes=0; f->data=s; } @@ -121,7 +123,7 @@ static int enc_set_br(MSFilter *f, void*data){ vsize.width=s->tinfo.width; vsize.height=s->tinfo.height; fps=s->tinfo.fps_numerator; - s->tinfo.target_bitrate=codecbr*0.8; + s->tinfo.target_bitrate=codecbr*0.9; s->tinfo.keyframe_data_target_bitrate=codecbr; /*those default settings would need to be affined*/ if (br>=1024000){ @@ -237,7 +239,7 @@ static void enc_preprocess(MSFilter *f){ s->yuv.uv_stride=s->tinfo.width/2; create_packed_conf(s); s->conf_time=0; - s->start_time=f->ticker->time; + s->nframes=0; } static void enc_postprocess(MSFilter *f){ @@ -306,8 +308,9 @@ bool_t need_send_conf(EncState *s, uint64_t elapsed){ } #else /*send immediately then 10 seconds later */ - if ( (elapsed<1000 && s->conf_time==0) - || (elapsed>10000 && s->conf_time==1)){ + if ( (elapsed==0 && s->conf_time==0) + || (elapsed>=3000 && s->conf_time==1) + || (elapsed>=10000 && s->conf_time==2)){ s->conf_time++; return TRUE; } @@ -321,10 +324,16 @@ static void enc_process(MSFilter *f){ EncState *s=(EncState*)f->data; uint64_t timems=f->ticker->time; uint32_t timestamp=timems*90; - uint64_t elapsed=timems-s->start_time; + uint64_t elapsed; + + while((im=ms_queue_get(f->inputs[0]))!=NULL){ /*for the firsts frames only send theora packed conf*/ om=NULL; + if (s->nframes==0){ + s->start_time=timems; + } + elapsed=timems-s->start_time; if (need_send_conf(s,elapsed)){ if (s->packed_conf) { diff --git a/linphone/oRTP/include/ortp/payloadtype.h b/linphone/oRTP/include/ortp/payloadtype.h index 2d7709488..91e11d509 100644 --- a/linphone/oRTP/include/ortp/payloadtype.h +++ b/linphone/oRTP/include/ortp/payloadtype.h @@ -183,6 +183,7 @@ VAR_DECLSPEC PayloadType payload_type_amr; VAR_DECLSPEC PayloadType payload_type_amrwb; VAR_DECLSPEC PayloadType payload_type_truespeech; VAR_DECLSPEC PayloadType payload_type_evrc0; +VAR_DECLSPEC PayloadType payload_type_evrcb0; /* video */ VAR_DECLSPEC PayloadType payload_type_mpv; diff --git a/linphone/oRTP/src/avprofile.c b/linphone/oRTP/src/avprofile.c index a751ce95f..cd86eb29d 100644 --- a/linphone/oRTP/src/avprofile.c +++ b/linphone/oRTP/src/avprofile.c @@ -412,6 +412,16 @@ PayloadType payload_type_evrc0={ CHANNELS(1) }; +PayloadType payload_type_evrcb0={ + TYPE(PAYLOAD_AUDIO_PACKETIZED), + CLOCK_RATE(8000), + BITS_PER_SAMPLE(0), + ZERO_PATTERN(NULL), + PATTERN_LENGTH(0), + NORMAL_BITRATE(0), + MIME_TYPE ("EVRCB0"), + CHANNELS(1) +}; PayloadType payload_type_h263_1998={ TYPE( PAYLOAD_VIDEO),