#ifdef VIDEO_ENABLED
// If video enabled, check ZRTP encryption in videostream
- const LinphoneCallParams *params=linphone_call_get_current_params(call);
- if (params->has_video && !call->videostream_encrypted) {
- return FALSE;
+ {
+ const LinphoneCallParams *params=linphone_call_get_current_params(call);
+ if (params->has_video && !call->videostream_encrypted) {
+ return FALSE;
+ }
}
#endif
#ifdef VIDEO_ENABLED
static void linphone_call_videostream_encryption_changed(void *data, bool_t encrypted){
- ms_message("Video stream is %s", encrypted ? "encrypted" : "not encrypted");
-
LinphoneCall *call = (LinphoneCall *)data;
+
+ ms_message("Video stream is %s", encrypted ? "encrypted" : "not encrypted");
call->videostream_encrypted=encrypted;
propagate_encryption_changed(call);
}
#ifdef VIDEO_ENABLED
// Enable video encryption
- const LinphoneCallParams *params=linphone_call_get_current_params(call);
- if (params->has_video) {
- ms_message("Trying to enable encryption on video stream");
- OrtpZrtpParams params;
- params.zid_file=NULL; //unused
- video_stream_enable_zrtp(call->videostream,call->audiostream,¶ms);
+ {
+ const LinphoneCallParams *params=linphone_call_get_current_params(call);
+ if (params->has_video) {
+ OrtpZrtpParams params;
+ ms_message("Trying to enable encryption on video stream");
+ params.zid_file=NULL; //unused
+ video_stream_enable_zrtp(call->videostream,call->audiostream,¶ms);
+ }
}
#endif
}
const char *rtcp_addr=vstream->rtcp_addr[0]!='\0' ? vstream->rtcp_addr : call->resultdesc->addr;
call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt);
if (used_pt!=-1){
- call->current_params.video_codec = rtp_profile_get_payload(call->video_profile, used_pt);
VideoStreamDir dir=VideoStreamSendRecv;
MSWebCam *cam=lc->video_conf.device;
bool_t is_inactive=FALSE;
+ call->current_params.video_codec = rtp_profile_get_payload(call->video_profile, used_pt);
call->current_params.has_video=TRUE;
video_stream_enable_adaptive_bitrate_control(call->videostream,
void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_muted, bool_t send_ringbacktone){
LinphoneCore *lc=call->core;
- call->current_params.audio_codec = NULL;
- call->current_params.video_codec = NULL;
-
LinphoneAddress *me=linphone_core_get_primary_contact_parsed(lc);
char *cname;
bool_t use_arc=linphone_core_adaptive_rate_control_enabled(lc);
SalProtoRtpAvp,SalVideo);
#endif
+ call->current_params.audio_codec = NULL;
+ call->current_params.video_codec = NULL;
+
if ((call->audiostream == NULL) && (call->videostream == NULL)) {
ms_fatal("start_media_stream() called without prior init !");
return;
**/
int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
int err=0;
+#ifdef VIDEO_ENABLED
+ bool_t has_video = FALSE;
+#endif
if (params!=NULL){
linphone_call_set_state(call,LinphoneCallUpdating,"Updating call");
#ifdef VIDEO_ENABLED
- bool_t has_video = call->params.has_video;
+ has_video = call->params.has_video;
// Video removing
if((call->videostream != NULL) && !params->has_video) {
* If not set the core will create its own window.
**/
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id){
- lc->preview_window_id=id;
#ifdef VIDEO_ENABLED
LinphoneCall *call=linphone_core_get_current_call(lc);
+ lc->preview_window_id=id;
if (call!=NULL && call->videostream){
video_stream_set_native_preview_window_id(call->videostream,id);
}else if (lc->previewstream){
**/
void linphone_core_show_video(LinphoneCore *lc, bool_t show){
#ifdef VIDEO_ENABLED
- ms_error("linphone_core_show_video %d", show);
LinphoneCall *call=linphone_core_get_current_call(lc);
+ ms_error("linphone_core_show_video %d", show);
if (call!=NULL && call->videostream){
video_stream_show_video(call->videostream,show);
}
ms_message("%s : rotation=%d\n", __FUNCTION__, rotation);
lc->device_rotation = rotation;
#ifdef VIDEO_ENABLED
- LinphoneCall *call=linphone_core_get_current_call(lc);
- if (call!=NULL && call->videostream){
- video_stream_set_device_rotation(call->videostream,rotation);
+ {
+ LinphoneCall *call=linphone_core_get_current_call(lc);
+ if (call!=NULL && call->videostream){
+ video_stream_set_device_rotation(call->videostream,rotation);
+ }
}
#endif
}
g_return_if_fail(w!=NULL);
gtk_notebook_remove_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),w));
+ linphone_chat_room_mark_as_read(cr);
linphone_gtk_friend_list_update_chat_picture();
g_object_set_data(G_OBJECT(friendlist),"chatview",NULL);
from=g_object_get_data(G_OBJECT(w),"from_message");
gtk_widget_show_all(w);
}
+static gboolean scroll_to_end(GtkTextView *w){
+ GtkTextBuffer *buffer=gtk_text_view_get_buffer(w);
+ GtkTextIter iter;
+ gtk_text_buffer_get_end_iter(buffer,&iter);
+ GtkTextMark *mark=gtk_text_buffer_create_mark(buffer,NULL,&iter,FALSE);
+ gtk_text_view_scroll_mark_onscreen(w,mark);
+ return FALSE;
+}
+
void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
gboolean me,LinphoneChatRoom *cr,LinphoneChatMessage *msg, gboolean hist){
GtkTextView *text=GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"textview"));
}
gtk_text_buffer_get_end_iter(buffer,&iter);
gtk_text_buffer_insert(buffer,&iter,"\n",-1);
- GtkTextMark *mark=gtk_text_buffer_create_mark(buffer,NULL,&iter,FALSE);
- gtk_text_view_scroll_mark_onscreen(text,mark);
+ g_idle_add((GSourceFunc)scroll_to_end,text);
ms_free(from_str);
}
colorb.blue = 61952;
with_str=linphone_address_as_string_uri_only(with);
- linphone_chat_room_mark_as_read(cr);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text),GTK_WRAP_WORD_CHAR);
gtk_text_view_set_editable(GTK_TEXT_VIEW(text),FALSE);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text),FALSE);
}
LinphoneChatRoom * linphone_gtk_create_chatroom(const LinphoneAddress *with){
- LinphoneChatRoom *cr=linphone_core_create_chat_room(linphone_gtk_get_core(),linphone_address_as_string(with));
- if (!cr) return NULL;
+ char *tmp=linphone_address_as_string(with);
+ LinphoneChatRoom *cr=linphone_core_create_chat_room(linphone_gtk_get_core(),tmp);
+ ms_free(tmp);
return cr;
}
GtkTextIter end;
GtkTextBuffer *text_buffer;
- linphone_chat_room_mark_as_read(cr);
text_buffer=gtk_text_view_get_buffer(text_view);
gtk_text_buffer_get_bounds(text_buffer, &start, &end);
gtk_text_buffer_delete (text_buffer, &start, &end);
messages=linphone_chat_room_get_history(cr,NB_MSG_HIST);
g_object_set_data(G_OBJECT(chat_view),"from_message",g_strdup(uri_str));
display_history_message(chat_view,messages,uri);
+ gtk_text_buffer_get_end_iter(text_buffer,&end);
+ gtk_text_view_scroll_to_iter(text_view,&end,0,FALSE,1.0,0);
}
ms_free(from_str);
ms_free(uri_str);
linphone_chat_room_destroy(cr);
}
-void linphone_gtk_chat_close(GtkWidget *button){
- GtkWidget *w=gtk_widget_get_toplevel(button);
- gtk_widget_destroy(w);
-}
-
void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
LinphoneChatMessage *msg ) {
GtkWidget *friendlist=linphone_gtk_get_widget ( main_window,"contact_list" );
GtkWidget *w;
gboolean send=TRUE;
- GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" );
+ /*GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" );*/
char *from=linphone_address_as_string ( linphone_chat_message_get_from ( msg ) );
w= ( GtkWidget* ) g_object_get_data ( G_OBJECT ( friendlist ),"chatview" );
g_object_set_data ( G_OBJECT ( friendlist ),"from",from );
}
-#ifdef HAVE_GTK_OSXs
+#ifdef HAVE_GTK_OSX
/* Notified when a new message is sent */
linphone_gtk_status_icon_set_blinking ( TRUE );
#else
}
#endif
if ( send ) {
- if ( gtk_notebook_get_current_page ( notebook ) !=gtk_notebook_page_num ( notebook,w ) ) {
- linphone_gtk_show_friends();
- } else {
- linphone_chat_room_mark_as_read ( room );
- }
linphone_gtk_push_text ( w,linphone_chat_message_get_from ( msg ),
FALSE,room,msg,FALSE );
- } else {
- linphone_gtk_show_friends();
}
+ linphone_gtk_show_friends();
+
}
} else {
linphone_gtk_load_chatroom(cr,uri,page);
}
+ linphone_chat_room_mark_as_read(cr);
gtk_notebook_set_current_page(notebook,gtk_notebook_page_num(notebook,page));
linphone_gtk_friend_list_update_chat_picture();
g_idle_add((GSourceFunc)grab_focus,linphone_gtk_get_widget(page,"text_entry"));
static int get_friend_weight(const LinphoneFriend *lf){
int w=0;
+ LinphoneCore *lc=linphone_gtk_get_core();
+ LinphoneChatRoom *cr=linphone_core_get_chat_room(lc,linphone_friend_get_address(lf));
+
+ if (cr && linphone_chat_room_get_unread_messages_count(cr)>0){
+ w+=2000;
+ }
+
switch(linphone_friend_get_status(lf)){
case LinphoneStatusOnline:
w+=1000;
-Subproject commit 3f06cd60f1864b8c811e0f4e4590991802ce5ea7
+Subproject commit 58745e5866d325c07255bf34225c8b621e87870b