Merge branch 'dev_refactor_cpp' into dev_content_cpp

This commit is contained in:
Sylvain Berfini 2018-03-19 17:58:53 +01:00
commit fa37a0cd50
5 changed files with 12 additions and 44 deletions

View file

@ -975,7 +975,7 @@ linphonec_idle_call ()
linphone_core_iterate(opm);
if (answer_call){
fprintf (stdout, "-------auto answering to call-------\n" );
linphone_core_accept_call(opm,NULL);
linphone_core_accept_call(opm, linphone_core_get_current_call(opm));
answer_call=FALSE;
}
/* auto call handling */

View file

@ -156,11 +156,11 @@ static char *argv_to_line(int argc, char *argv[]) {
}
#endif
#define MAX_ARGS 10
#define MAX_ARGS 20
#ifndef _WIN32
static void spawn_linphonec(int argc, char *argv[]){
char * args[MAX_ARGS];
char * args[MAX_ARGS+1];
int i,j;
pid_t pid;
j=0;
@ -168,10 +168,10 @@ static void spawn_linphonec(int argc, char *argv[]){
args[j++]="--pipe";
args[j++]="-c";
args[j++]="/dev/null";
for(i=0;i<argc;++i){
for(i=0;i<argc && i<MAX_ARGS;++i){
args[j++]=argv[i];
}
args[j++]=NULL;
args[j]=NULL;
#ifdef __uClinux__
pid = vfork();

View file

@ -20,7 +20,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
#include <ctype.h>
#include "linphone/api/c-content.h"
#include <bctoolbox/defs.h>
#include "linphone/core_utils.h"
#include "linphone/core.h"
#include "linphone/lpconfig.h"
@ -1547,11 +1547,12 @@ void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatP
}
void linphone_proxy_config_notify_publish_state_changed(LinphoneProxyConfig *cfg, LinphonePublishState state) {
if (cfg->presence_publish_event != NULL) {
switch (state) {
case LinphonePublishCleared:
linphone_proxy_config_set_etag(cfg,NULL);
BCTBX_NO_BREAK;
case LinphonePublishError:
linphone_event_unref(cfg->presence_publish_event);
cfg->presence_publish_event = NULL;
@ -1561,7 +1562,7 @@ void linphone_proxy_config_notify_publish_state_changed(LinphoneProxyConfig *cfg
break;
default:
break;
}
}
}

View file

@ -2660,7 +2660,7 @@ void MediaSessionPrivate::startAudioStream (CallSession::State targetState, bool
if (playcard) {
ms_snd_card_set_stream_type(playcard, MS_SND_CARD_STREAM_VOICE);
}
media_stream_set_max_network_bitrate(&audioStream->ms, linphone_core_get_upload_bandwidth(q->getCore()->getCCore()) * 1000);
bool useEc = captcard && linphone_core_echo_cancellation_enabled(q->getCore()->getCCore());
audio_stream_enable_echo_canceller(audioStream, useEc);
if (playcard && (stream->max_rate > 0))
@ -2899,6 +2899,7 @@ void MediaSessionPrivate::startVideoStream (CallSession::State targetState) {
getCurrentParams()->getPrivate()->setUsedVideoCodec(rtp_profile_get_payload(videoProfile, usedPt));
getCurrentParams()->enableVideo(true);
rtp_session_enable_rtcp_mux(videoStream->ms.sessions.rtp_session, vstream->rtcp_mux);
media_stream_set_max_network_bitrate(&videoStream->ms, linphone_core_get_upload_bandwidth(q->getCore()->getCCore()) * 1000);
if (q->getCore()->getCCore()->video_conf.preview_vsize.width != 0)
video_stream_set_preview_size(videoStream, q->getCore()->getCCore()->video_conf.preview_vsize);
video_stream_set_fps(videoStream, linphone_core_get_preferred_framerate(q->getCore()->getCCore()));

View file

@ -211,40 +211,6 @@ static void subscribe_failure_handle_by_app(void) {
linphone_core_manager_destroy(pauline);
}
/*static void publish_with_network_state_changes(void) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneProxyConfig* proxy;
LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_publish_state_changed(cbs, linphone_publish_state_changed);
_linphone_core_add_callbacks(marie->lc, cbs,TRUE);
linphone_core_cbs_unref(cbs);
proxy = linphone_core_get_default_proxy_config(marie->lc);
linphone_proxy_config_edit(proxy);
linphone_proxy_config_enable_publish(proxy,TRUE);
linphone_proxy_config_done(proxy);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,1));
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,1));
linphone_core_set_network_reachable(marie->lc, FALSE);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneRegistrationNone,1));
BC_ASSERT_FALSE(wait_for_until(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2,1000));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,1,int,"%i");
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishError,0,int,"%i");
linphone_core_set_network_reachable(marie->lc, TRUE);
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2));
BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,2));
linphone_core_manager_stop(marie);
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,1,int,"%i"); //yes it is 3 because when we change the expires, a new LinphoneEvent is created
BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,2,int,"%i");
linphone_core_manager_destroy(marie);
}*/
static void simple_subscribe(void) {
LinphoneCoreManager* marie = presence_linphone_core_manager_new("marie");
LinphoneCoreManager* pauline = presence_linphone_core_manager_new("pauline");
@ -548,7 +514,7 @@ test_t presence_tests[] = {
/*TEST_ONE_TAG("Call with presence", call_with_presence, "LeaksMemory"),*/
TEST_NO_TAG("Unsubscribe while subscribing", unsubscribe_while_subscribing),
TEST_NO_TAG("Presence information", presence_information),
TEST_ONE_TAG("App managed presence failure", subscribe_failure_handle_by_app, "LeaksMemory"),
TEST_ONE_TAG("App managed presence failure", subscribe_failure_handle_by_app,"presence"),
TEST_NO_TAG("Presence SUBSCRIBE forked", subscribe_presence_forked),
TEST_NO_TAG("Presence SUBSCRIBE expired", subscribe_presence_expired),
};