Commit d777e00a authored by Simon Morlat's avatar Simon Morlat

change behavior of LinphoneCall::camera_enabled

It is now an application preference, the core never modifies it.
It represents whether the camera is allowed to be sent (in case of video request).
parent 1b7e52c1
......@@ -98,7 +98,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
if (call->audiostream)
linphone_core_enable_mic(lc, linphone_core_mic_enabled(lc));
#ifdef VIDEO_ENABLED
if (call->videostream && call->camera_active)
if (call->videostream && call->camera_enabled)
video_stream_change_camera(call->videostream,lc->video_conf.device );
#endif
}
......
......@@ -99,7 +99,7 @@ void linphone_call_add_to_conf(LinphoneCall *call, bool_t muted){
LinphoneConference *conf=&lc->conf_ctx;
MSAudioEndpoint *ep;
call->params.has_video = FALSE;
call->camera_active = FALSE;
call->camera_enabled = FALSE;
ep=ms_audio_endpoint_get_from_stream(call->audiostream,TRUE);
ms_audio_conference_add_member(conf->conf,ep);
ms_audio_conference_mute_member(conf->conf,ep,muted);
......
......@@ -438,6 +438,7 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
call->media_start_time=0;
call->log=linphone_call_log_new(call, from, to);
call->owns_call_log=TRUE;
call->camera_enabled=TRUE;
linphone_core_get_audio_port_range(call->core, &min_port, &max_port);
if (min_port == max_port) {
......@@ -544,7 +545,6 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
}
}
#endif //BUILD_UPNP
call->camera_active=params->has_video;
discover_mtu(lc,linphone_address_get_domain (to));
if (params->referer){
......@@ -641,7 +641,6 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
default:
break;
}
call->camera_active=call->params.has_video;
discover_mtu(lc,linphone_address_get_domain(from));
return call;
......@@ -1084,12 +1083,12 @@ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){
if (call->videostream!=NULL && call->videostream->ms.ticker!=NULL){
LinphoneCore *lc=call->core;
MSWebCam *nowebcam=get_nowebcam_device();
if (call->camera_active!=enable && lc->video_conf.device!=nowebcam){
if (call->camera_enabled!=enable && lc->video_conf.device!=nowebcam){
video_stream_change_camera(call->videostream,
enable ? lc->video_conf.device : nowebcam);
}
}
call->camera_active=enable;
call->camera_enabled=enable;
#endif
}
......@@ -1120,10 +1119,10 @@ int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file){
}
/**
* Returns TRUE if camera pictures are sent to the remote party.
* Returns TRUE if camera pictures are allowed to be sent to the remote party.
**/
bool_t linphone_call_camera_enabled (const LinphoneCall *call){
return call->camera_active;
return call->camera_enabled;
}
/**
......@@ -1849,7 +1848,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
/*either inactive or incompatible with local capabilities*/
is_inactive=TRUE;
}
if (call->camera_active==FALSE || all_inputs_muted){
if (call->camera_enabled==FALSE || all_inputs_muted){
cam=get_nowebcam_device();
}
if (!is_inactive){
......
......@@ -2964,7 +2964,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call){
const char *subject;
call->camera_active=call->params.has_video;
if (call->ice_session != NULL) {
linphone_core_update_local_media_description_from_ice(call->localdesc, call->ice_session);
}
......@@ -3065,7 +3065,7 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
#ifdef VIDEO_ENABLED
if ((call->videostream != NULL) && (call->state == LinphoneCallStreamsRunning)) {
video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
if (call->camera_active && call->videostream->cam!=lc->video_conf.device){
if (call->camera_enabled && call->videostream->cam!=lc->video_conf.device){
video_stream_change_camera(call->videostream,lc->video_conf.device);
}else video_stream_update_video_params(call->videostream);
}
......@@ -3177,7 +3177,6 @@ int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const
call->params.has_video = FALSE;
}
call->params.has_video &= linphone_core_media_description_contains_video_stream(remote_desc);
call->camera_active=call->params.has_video;
linphone_call_make_local_media_description(lc,call);
if (call->ice_session != NULL) {
linphone_core_update_ice_from_remote_media_description(call, remote_desc);
......@@ -3298,7 +3297,6 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call,
// There might not be a md if the INVITE was lacking an SDP
// In this case we use the parameters as is.
if (md) call->params.has_video &= linphone_core_media_description_contains_video_stream(md);
call->camera_active=call->params.has_video;
linphone_call_make_local_media_description(lc,call);
sal_call_set_local_media_description(call->op,call->localdesc);
}
......
......@@ -205,7 +205,7 @@ struct _LinphoneCall
bool_t refer_pending;
bool_t media_pending;
bool_t audio_muted;
bool_t camera_active;
bool_t camera_enabled;
bool_t all_muted; /*this flag is set during early medias*/
bool_t playing_ringbacktone;
......
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