static void check_payload_type_numbers(LinphoneCall *call1, LinphoneCall *call2, int expected_number){ const LinphoneCallParams *params=linphone_call_get_current_params(call1); const PayloadType *pt=linphone_call_params_get_used_audio_codec(params); CU_ASSERT_PTR_NOT_NULL(pt); if (pt){ CU_ASSERT_TRUE(linphone_core_get_payload_type_number(linphone_call_get_core(call1),pt)==expected_number); } params=linphone_call_get_current_params(call2); pt=linphone_call_params_get_used_audio_codec(params); CU_ASSERT_PTR_NOT_NULL(pt); if (pt){ CU_ASSERT_TRUE(linphone_core_get_payload_type_number(linphone_call_get_core(call1),pt)==expected_number); } }
void linphone_gtk_update_video_button(LinphoneCall *call){ GtkWidget *call_view=(GtkWidget*)linphone_call_get_user_pointer(call); GtkWidget *button; const LinphoneCallParams *params=linphone_call_get_current_params(call); gboolean has_video=linphone_call_params_video_enabled(params); if (call_view==NULL) return; button=linphone_gtk_get_widget(call_view,"video_button"); gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_stock(has_video ? GTK_STOCK_REMOVE : GTK_STOCK_ADD,GTK_ICON_SIZE_BUTTON)); g_object_set_data(G_OBJECT(button),"adding_video",GINT_TO_POINTER(!has_video)); if (!linphone_core_video_supported(linphone_call_get_core(call))){ gtk_widget_set_sensitive(button,FALSE); return; } if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),"signal_connected"))==0){ g_signal_connect(G_OBJECT(button),"clicked",(GCallback)video_button_clicked,call); g_object_set_data(G_OBJECT(button),"signal_connected",GINT_TO_POINTER(1)); } GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"conf_frame"); gtk_widget_set_sensitive(button,linphone_call_get_state(call)==LinphoneCallStreamsRunning); if(conf_frame!=NULL){ gtk_widget_set_sensitive(button,FALSE); } }
static void video_button_clicked(GtkWidget *button, LinphoneCall *call) { gboolean adding=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),"adding_video")); LinphoneCore *lc=linphone_call_get_core(call); LinphoneCallParams *params=linphone_call_params_copy(linphone_call_get_current_params(call)); gtk_widget_set_sensitive(button,FALSE); linphone_call_params_enable_video(params,adding); linphone_core_update_call(lc,call,params); linphone_call_params_destroy(params); }