set stereo=1 in opus fmtp to test stereo

rewrite ugly code
This commit is contained in:
Simon Morlat 2015-05-27 12:35:57 +02:00
parent 7f2c4c22b4
commit 5f30b8a1eb
3 changed files with 40 additions and 23 deletions

View file

@ -7006,27 +7006,44 @@ bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, Linphone
int linphone_core_set_media_encryption(LinphoneCore *lc, LinphoneMediaEncryption menc) {
const char *type="none";
int ret=0;
if (menc == LinphoneMediaEncryptionSRTP){
if (!ms_srtp_supported()){
ms_warning("SRTP not supported by library.");
type="none";
ret=-1;
}else type="srtp";
}else if (menc == LinphoneMediaEncryptionZRTP){
if (!ms_zrtp_available()){
ms_warning("ZRTP not supported by library.");
type="none";
ret=-1;
}else type="zrtp";
}else if (menc == LinphoneMediaEncryptionDTLS){
if (!ms_dtls_srtp_available()){
ms_warning("DTLS not supported by library.");
type="none";
ret=-1;
}else type="dtls";
int ret=-1;
switch(menc){
case LinphoneMediaEncryptionSRTP:
if (!ms_srtp_supported()){
ms_warning("SRTP not supported by library.");
type="none";
ret=-1;
}else{
type="srtp";
ret = 0;
}
break;
case LinphoneMediaEncryptionZRTP:
if (!ms_zrtp_available()){
ms_warning("ZRTP not supported by library.");
type="none";
ret=-1;
}else {
type="zrtp";
ret = 0;
}
break;
case LinphoneMediaEncryptionDTLS:
if (!ms_dtls_srtp_available()){
ms_warning("DTLS not supported by library.");
type="none";
ret=-1;
}else {
type="dtls";
ret = 0;
}
break;
case LinphoneMediaEncryptionNone:
type = "none";
ret = 0;
break;
}
lp_config_set_string(lc->config,"sip","media_encryption",type);
return ret;
}

@ -1 +1 @@
Subproject commit 8f955913a73028b2d22b0ff3bbd31f5207aeb872
Subproject commit e4dcc515cebd7cf1b51cb538743312df53aaf0a0

View file

@ -4088,10 +4088,10 @@ static void simple_stereo_call(const char *codec_name, int clock_rate, int bitra
ms_warning("%s not available, stereo with %s not tested.",codec_name, codec_name);
goto end;
}
payload_type_set_recv_fmtp(pt, NULL); /*remove fmtp that by default contain stereo=0*/
payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(marie->lc, pt, bitrate_override);
pt = linphone_core_find_payload_type(pauline->lc, codec_name, clock_rate, 2);
payload_type_set_recv_fmtp(pt, NULL);
payload_type_set_recv_fmtp(pt, "stereo=1;sprop-stereo=1");
if (bitrate_override) linphone_core_set_payload_type_bitrate(pauline->lc, pt, bitrate_override);
disable_all_audio_codecs_except_one(marie->lc, codec_name, clock_rate);