Commit 7b62f331 authored by Simon Morlat's avatar Simon Morlat
Browse files

repair linphone, broken by previous commit implementing stream directions.

parent 72bf8d52
......@@ -33,9 +33,8 @@ SalMediaProto get_proto_from_call_params(const LinphoneCallParams *params) {
return SalProtoRtpAvp;
}
static SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirection cpdir) {
SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirection cpdir) {
switch (cpdir) {
default:
case LinphoneCallParamsMediaDirectionInactive:
return SalStreamInactive;
case LinphoneCallParamsMediaDirectionSendOnly:
......@@ -47,6 +46,19 @@ static SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirectio
}
}
LinphoneCallParamsMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir){
switch (dir) {
case SalStreamInactive:
return LinphoneCallParamsMediaDirectionInactive;
case SalStreamSendOnly:
return LinphoneCallParamsMediaDirectionSendOnly;
case SalStreamRecvOnly:
return LinphoneCallParamsMediaDirectionRecvOnly;
case SalStreamSendRecv:
return LinphoneCallParamsMediaDirectionSendRecv;
}
}
SalStreamDir get_audio_dir_from_call_params(const LinphoneCallParams *params) {
return sal_dir_from_call_params_dir(linphone_call_params_get_audio_direction(params));
}
......@@ -91,6 +103,8 @@ void linphone_call_params_enable_low_bandwidth(LinphoneCallParams *cp, bool_t en
void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled){
cp->has_video=enabled;
if (cp->video_dir==LinphoneCallParamsMediaDirectionInactive)
cp->video_dir=LinphoneCallParamsMediaDirectionSendRecv;
}
const char *linphone_call_params_get_custom_header(const LinphoneCallParams *params, const char *header_name){
......@@ -229,7 +243,10 @@ static void _linphone_call_params_destroy(LinphoneCallParams *cp){
}
LinphoneCallParams * linphone_call_params_new(void) {
return belle_sip_object_new(LinphoneCallParams);
LinphoneCallParams *cp=belle_sip_object_new(LinphoneCallParams);
cp->audio_dir=LinphoneCallParamsMediaDirectionSendRecv;
cp->video_dir=LinphoneCallParamsMediaDirectionSendRecv;
return cp;
}
/* DEPRECATED */
......
......@@ -1384,6 +1384,7 @@ void linphone_call_unref(LinphoneCall *obj){
* Returns current parameters associated to the call.
**/
const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
SalMediaDescription *md=call->resultdesc;
#ifdef VIDEO_ENABLED
VideoStream *vstream;
#endif
......@@ -1419,6 +1420,12 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
} else {
call->current_params->avpf_rr_interval = 0;
}
if (md){
SalStreamDescription *sd=sal_media_description_find_best_stream(md,SalAudio);
call->current_params->audio_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneCallParamsMediaDirectionInactive;
sd=sal_media_description_find_best_stream(md,SalVideo);
call->current_params->video_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneCallParamsMediaDirectionInactive;
}
return call->current_params;
}
......
......@@ -1105,6 +1105,9 @@ void linphone_core_notify_log_collection_upload_progress_indication(LinphoneCore
void set_mic_gain_db(AudioStream *st, float gain);
void set_playback_gain_db(AudioStream *st, float gain);
LinphoneCallParamsMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir);
SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirection cpdir);
#ifdef ANDROID
void linphone_core_wifi_lock_acquire(LinphoneCore *lc);
void linphone_core_wifi_lock_release(LinphoneCore *lc);
......
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