Commit 16ee0f20 authored by smorlat's avatar smorlat
Browse files

enable/disable self view



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@193 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent c857c51b
......@@ -1423,6 +1423,7 @@ void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call){
if (video_params->relay_session_id!=NULL)
video_stream_set_relay_session_id(lc->videostream,video_params->relay_session_id);
video_stream_set_sent_video_size(lc->videostream,linphone_core_get_preferred_video_size(lc));
video_stream_enable_self_view(lc->videostream,lc->video_conf.selfview);
if (lc->video_conf.display && lc->video_conf.capture)
video_stream_start(lc->videostream,
call->profile, video_params->remoteaddr, video_params->remoteport,
......@@ -2001,6 +2002,17 @@ bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc){
return lc->video_conf.show_local;
}
void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val){
lc->video_conf.selfview=val;
if (lc->videostream){
video_stream_enable_self_view(lc->videostream,val);
}
}
bool_t linphone_core_self_view_enabled(const LinphoneCore *lc){
return lc->video_conf.selfview;
}
int linphone_core_set_video_device(LinphoneCore *lc, const char *id){
MSWebCam *olddev=lc->video_conf.device;
if (id!=NULL){
......
......@@ -116,6 +116,7 @@ typedef struct video_config{
bool_t capture;
bool_t show_local;
bool_t display;
bool_t selfview; /*during calls*/
}video_config_t;
typedef struct ui_config
......@@ -692,6 +693,8 @@ void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char
void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val);
bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc);
void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
/* returns a null terminated static array of string describing the webcams */
......
......@@ -379,6 +379,11 @@ void linphone_gtk_set_audio_only(){
linphone_core_enable_video(linphone_gtk_get_core(),FALSE,FALSE);
}
void linphone_gtk_enable_self_view(GtkWidget *w){
linphone_core_enable_self_view(linphone_gtk_get_core(),
gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w)));
}
void linphone_gtk_used_identity_changed(GtkWidget *w){
int active=gtk_combo_box_get_active(GTK_COMBO_BOX(w));
char *sel=gtk_combo_box_get_active_text(GTK_COMBO_BOX(w));
......
This diff is collapsed.
......@@ -124,6 +124,7 @@ struct _VideoStream
MSFilter *rtpsend;
OrtpEvQueue *evq;
MSVideoSize sent_vsize;
int corner; /*for selfview*/
bool_t adapt_bitrate;
};
......@@ -140,6 +141,7 @@ void video_stream_iterate(VideoStream *stream);
void video_stream_send_vfu(VideoStream *stream);
void video_stream_stop(VideoStream * stream);
void video_stream_set_sent_video_size(VideoStream *stream, MSVideoSize vsize);
void video_stream_enable_self_view(VideoStream *stream, bool_t val);
VideoStream * video_preview_start(MSWebCam *device, MSVideoSize vsize);
void video_preview_stop(VideoStream *stream);
......
......@@ -179,6 +179,13 @@ void video_stream_set_relay_session_id(VideoStream *stream, const char *id){
ms_filter_call_method(stream->rtpsend, MS_RTP_SEND_SET_RELAY_SESSION_ID,(void*)id);
}
void video_stream_enable_self_view(VideoStream *stream, bool_t val){
MSFilter *out=stream->output;
stream->corner=val ? 0 : -1;
if (out){
ms_filter_call_method(out,MS_VIDEO_OUT_SET_CORNER,&stream->corner);
}
}
void video_stream_enable_adaptive_bitrate_control(VideoStream *s, bool_t yesno){
s->adapt_bitrate=yesno;
......@@ -281,6 +288,7 @@ int video_stream_start (VideoStream *stream, RtpProfile *profile, const char *re
ms_filter_call_method(stream->output,MS_FILTER_SET_VIDEO_SIZE,&disp_size);
ms_filter_call_method(stream->output,MS_VIDEO_OUT_AUTO_FIT,&tmp);
ms_filter_call_method(stream->output,MS_FILTER_SET_PIX_FMT,&format);
ms_filter_call_method(stream->output,MS_VIDEO_OUT_SET_CORNER,&stream->corner);
if (pt->recv_fmtp!=NULL)
ms_filter_call_method(stream->decoder,MS_FILTER_ADD_FMTP,(void*)pt->recv_fmtp);
......
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