SHA256
1
0
forked from pool/pidgin

Accepting request 322594 from GNOME:Apps

OBS-URL: https://build.opensuse.org/request/show/322594
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pidgin?expand=0&rev=109
This commit is contained in:
Dominique Leuenberger 2015-08-15 09:38:18 +00:00 committed by Git OBS Bridge
parent efb6b3b6b4
commit 062c447346
9 changed files with 3076 additions and 5 deletions

View File

@ -0,0 +1,350 @@
# HG changeset patch
# User David Woodhouse <David.Woodhouse@intel.com>
# Date 1425675783 0
# Node ID 6b4576edf2a694ab55d0d06d3643c44601a75b15
# Parent 714ba418d0aa5ba0cc4cc3b9db37296cd2bbf041
Add out-of-band DTMF support and dialpad to use it
This is a backport of e4c122196b08 from the trunk. It adds the UI and
farstream backend support for sending DTMF.
Fixes #15575
diff --git a/libpurple/media.c b/libpurple/media.c
--- a/libpurple/media.c
+++ b/libpurple/media.c
@@ -1439,3 +1439,46 @@
}
#endif /* USE_GSTREAMER */
+gboolean
+purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id,
+ gchar dtmf, guint8 volume, guint16 duration)
+{
+#ifdef USE_VV
+ PurpleAccount *account = NULL;
+ PurpleConnection *gc = NULL;
+ PurplePlugin *prpl = NULL;
+ PurplePluginProtocolInfo *prpl_info = NULL;
+ PurpleMediaBackendIface *backend_iface = NULL;
+
+ if (media)
+ {
+ account = purple_media_get_account(media);
+ backend_iface = PURPLE_MEDIA_BACKEND_GET_INTERFACE(media->priv->backend);
+ }
+ if (account)
+ gc = purple_account_get_connection(account);
+ if (gc)
+ prpl = purple_connection_get_prpl(gc);
+ if (prpl)
+ prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+
+ if (dtmf == 'a')
+ dtmf = 'A';
+ else if (dtmf == 'b')
+ dtmf = 'B';
+ else if (dtmf == 'c')
+ dtmf = 'C';
+ else if (dtmf == 'd')
+ dtmf = 'D';
+
+ g_return_val_if_fail(strchr("0123456789ABCD#*", dtmf), FALSE);
+
+ if (backend_iface && backend_iface->send_dtmf
+ && backend_iface->send_dtmf(media->priv->backend,
+ session_id, dtmf, volume, duration))
+ {
+ return TRUE;
+ }
+#endif
+ return FALSE;
+}
diff --git a/libpurple/media.h b/libpurple/media.h
--- a/libpurple/media.h
+++ b/libpurple/media.h
@@ -437,6 +437,21 @@
*/
void purple_media_remove_output_windows(PurpleMedia *media);
+/**
+ * Sends a DTMF signal out-of-band.
+ *
+ * @param media The media instance to send a DTMF signal to.
+ * @param sess_id The session id of the session to send the DTMF signal on.
+ * @param dtmf The character representing the DTMF in the range [0-9#*A-D].
+ * @param volume The power level expressed in dBm0 after dropping the sign
+ * in the range of 0 to 63. A larger value represents a lower volume.
+ * @param duration The duration of the tone in milliseconds.
+ *
+ * @since 2.11
+ */
+gboolean purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id,
+ gchar dtmf, guint8 volume, guint16 duration);
+
#ifdef __cplusplus
}
#endif
diff --git a/libpurple/media/backend-fs2.c b/libpurple/media/backend-fs2.c
--- a/libpurple/media/backend-fs2.c
+++ b/libpurple/media/backend-fs2.c
@@ -94,6 +94,9 @@
static void purple_media_backend_fs2_set_params(PurpleMediaBackend *self,
guint num_params, GParameter *params);
static const gchar **purple_media_backend_fs2_get_available_params(void);
+static gboolean purple_media_backend_fs2_send_dtmf(
+ PurpleMediaBackend *self, const gchar *sess_id,
+ gchar dtmf, guint8 volume, guint16 duration);
static void free_stream(PurpleMediaBackendFs2Stream *stream);
static void free_session(PurpleMediaBackendFs2Session *session);
@@ -499,6 +502,7 @@
iface->set_send_codec = purple_media_backend_fs2_set_send_codec;
iface->set_params = purple_media_backend_fs2_set_params;
iface->get_available_params = purple_media_backend_fs2_get_available_params;
+ iface->send_dtmf = purple_media_backend_fs2_send_dtmf;
}
static FsMediaType
@@ -2436,6 +2440,65 @@
return supported_params;
}
+static gboolean
+send_dtmf_callback(gpointer userdata)
+{
+ FsSession *session = userdata;
+
+ fs_session_stop_telephony_event(session);
+
+ return FALSE;
+}
+static gboolean
+purple_media_backend_fs2_send_dtmf(PurpleMediaBackend *self,
+ const gchar *sess_id, gchar dtmf, guint8 volume,
+ guint16 duration)
+{
+ PurpleMediaBackendFs2Session *session;
+ FsDTMFEvent event;
+
+ g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE);
+
+ session = get_session(PURPLE_MEDIA_BACKEND_FS2(self), sess_id);
+ if (session == NULL)
+ return FALSE;
+
+ /* Convert DTMF char into FsDTMFEvent enum */
+ switch(dtmf) {
+ case '0': event = FS_DTMF_EVENT_0; break;
+ case '1': event = FS_DTMF_EVENT_1; break;
+ case '2': event = FS_DTMF_EVENT_2; break;
+ case '3': event = FS_DTMF_EVENT_3; break;
+ case '4': event = FS_DTMF_EVENT_4; break;
+ case '5': event = FS_DTMF_EVENT_5; break;
+ case '6': event = FS_DTMF_EVENT_6; break;
+ case '7': event = FS_DTMF_EVENT_7; break;
+ case '8': event = FS_DTMF_EVENT_8; break;
+ case '9': event = FS_DTMF_EVENT_9; break;
+ case '*': event = FS_DTMF_EVENT_STAR; break;
+ case '#': event = FS_DTMF_EVENT_POUND; break;
+ case 'A': event = FS_DTMF_EVENT_A; break;
+ case 'B': event = FS_DTMF_EVENT_B; break;
+ case 'C': event = FS_DTMF_EVENT_C; break;
+ case 'D': event = FS_DTMF_EVENT_D; break;
+ default:
+ return FALSE;
+ }
+
+ if (!fs_session_start_telephony_event(session->session,
+ event, volume)) {
+ return FALSE;
+ }
+
+ if (duration <= 50) {
+ fs_session_stop_telephony_event(session->session);
+ } else {
+ purple_timeout_add(duration, send_dtmf_callback,
+ session->session);
+ }
+
+ return TRUE;
+}
#else
GType
purple_media_backend_fs2_get_type(void)
diff --git a/libpurple/media/backend-iface.h b/libpurple/media/backend-iface.h
--- a/libpurple/media/backend-iface.h
+++ b/libpurple/media/backend-iface.h
@@ -71,6 +71,9 @@
void (*set_params) (PurpleMediaBackend *self,
guint num_params, GParameter *params);
const gchar **(*get_available_params) (void);
+ gboolean (*send_dtmf) (PurpleMediaBackend *self,
+ const gchar *sess_id, gchar dtmf, guint8 volume,
+ guint16 duration);
};
/**
diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c
--- a/pidgin/gtkmedia.c
+++ b/pidgin/gtkmedia.c
@@ -41,6 +41,7 @@
#ifdef _WIN32
#include <gdk/gdkwin32.h>
#endif
+#include <gdk/gdkkeysyms.h>
#include <gst/interfaces/xoverlay.h>
@@ -759,6 +760,136 @@
}
static void
+phone_dtmf_pressed_cb(GtkButton *button, gpointer user_data)
+{
+ PidginMedia *gtkmedia = user_data;
+ gint num;
+ gchar *sid;
+
+ num = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "dtmf-digit"));
+ sid = g_object_get_data(G_OBJECT(button), "session-id");
+
+ purple_media_send_dtmf(gtkmedia->priv->media, sid, num, 25, 50);
+}
+
+static inline GtkWidget *
+phone_create_button(const gchar *text_hi, const gchar *text_lo)
+{
+ GtkWidget *button;
+ GtkWidget *label_hi;
+ GtkWidget *label_lo;
+ GtkWidget *grid;
+ const gchar *text_hi_local;
+
+ if (text_hi)
+ text_hi_local = _(text_hi);
+ else
+ text_hi_local = "";
+
+ grid = gtk_vbox_new(TRUE, 0);
+
+ button = gtk_button_new();
+ label_hi = gtk_label_new(text_hi_local);
+ gtk_misc_set_alignment(GTK_MISC(label_hi), 0.5, 0.5);
+ gtk_box_pack_end(GTK_BOX(grid), label_hi, FALSE, TRUE, 0);
+ label_lo = gtk_label_new(text_lo);
+ gtk_misc_set_alignment(GTK_MISC(label_lo), 0.5, 0.5);
+ gtk_label_set_use_markup(GTK_LABEL(label_lo), TRUE);
+ gtk_box_pack_end(GTK_BOX(grid), label_lo, FALSE, TRUE, 0);
+ gtk_container_add(GTK_CONTAINER(button), grid);
+
+ return button;
+}
+
+static struct phone_label {
+ gchar *subtext;
+ gchar *text;
+ gchar chr;
+} phone_labels[] = {
+ {"<b>1</b>", NULL, '1'},
+ /* Translators note: These are the letters on the keys of a numeric
+ keypad; translate according to §7.2.4 of
+ http://www.etsi.org/deliver/etsi_es/202100_202199/202130/01.01.01_60/es_20213 */
+ /* Letters on the '2' key of a numeric keypad */
+ {"<b>2</b>", N_("ABC"), '2'},
+ /* Letters on the '3' key of a numeric keypad */
+ {"<b>3</b>", N_("DEF"), '3'},
+ /* Letters on the '4' key of a numeric keypad */
+ {"<b>4</b>", N_("GHI"), '4'},
+ /* Letters on the '5' key of a numeric keypad */
+ {"<b>5</b>", N_("JKL"), '5'},
+ /* Letters on the '6' key of a numeric keypad */
+ {"<b>6</b>", N_("MNO"), '6'},
+ /* Letters on the '7' key of a numeric keypad */
+ {"<b>7</b>", N_("PQRS"), '7'},
+ /* Letters on the '8' key of a numeric keypad */
+ {"<b>8</b>", N_("TUV"), '8'},
+ /* Letters on the '9' key of a numeric keypad */
+ {"<b>9</b>", N_("WXYZ"), '9'},
+ {"<b>*</b>", NULL, '*'},
+ {"<b>0</b>", NULL, '0'},
+ {"<b>#</b>", NULL, '#'},
+ {NULL, NULL, 0}
+};
+
+static gboolean
+pidgin_media_dtmf_key_press_event_cb(GtkWidget *widget,
+ GdkEvent *event, gpointer user_data)
+{
+ PidginMedia *gtkmedia = user_data;
+ GdkEventKey *key = (GdkEventKey *) event;
+
+ if (event->type != GDK_KEY_PRESS) {
+ return FALSE;
+ }
+
+ if ((key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9) ||
+ key->keyval == GDK_KEY_asterisk ||
+ key->keyval == GDK_KEY_numbersign) {
+ gchar *sid = g_object_get_data(G_OBJECT(widget), "session-id");
+
+ purple_media_send_dtmf(gtkmedia->priv->media, sid, key->keyval, 25, 50);
+ }
+
+ return FALSE;
+}
+
+static GtkWidget *
+pidgin_media_add_dtmf_widget(PidginMedia *gtkmedia,
+ PurpleMediaSessionType type, const gchar *_sid)
+{
+ GtkWidget *grid = gtk_table_new(4, 3, TRUE);
+ GtkWidget *button;
+ gint index = 0;
+ GtkWindow *win = &gtkmedia->parent;
+
+ /* Add buttons */
+ for (index = 0; phone_labels[index].subtext != NULL; index++) {
+ button = phone_create_button(phone_labels[index].text,
+ phone_labels[index].subtext);
+ g_signal_connect(button, "pressed",
+ G_CALLBACK(phone_dtmf_pressed_cb), gtkmedia);
+ g_object_set_data(G_OBJECT(button), "dtmf-digit",
+ GINT_TO_POINTER(phone_labels[index].chr));
+ g_object_set_data_full(G_OBJECT(button), "session-id",
+ g_strdup(_sid), g_free);
+ gtk_table_attach(GTK_TABLE(grid), button, index % 3,
+ index % 3 + 1, index / 3, index / 3 + 1,
+ GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
+ 2, 2);
+ }
+
+ g_signal_connect(G_OBJECT(win), "key-press-event",
+ G_CALLBACK(pidgin_media_dtmf_key_press_event_cb), gtkmedia);
+ g_object_set_data_full(G_OBJECT(win), "session-id",
+ g_strdup(_sid), g_free);
+
+ gtk_widget_show_all(grid);
+
+ return grid;
+}
+
+static void
pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia, const gchar *sid)
{
GtkWidget *send_widget = NULL, *recv_widget = NULL, *button_widget = NULL;
@@ -888,7 +1019,11 @@
gtk_box_pack_end(GTK_BOX(recv_widget),
pidgin_media_add_audio_widget(gtkmedia,
- PURPLE_MEDIA_SEND_AUDIO, NULL), FALSE, FALSE, 0);
+ PURPLE_MEDIA_SEND_AUDIO, sid), FALSE, FALSE, 0);
+
+ gtk_box_pack_end(GTK_BOX(recv_widget),
+ pidgin_media_add_dtmf_widget(gtkmedia,
+ PURPLE_MEDIA_SEND_AUDIO, sid), FALSE, FALSE, 0);
}
if (type & PURPLE_MEDIA_AUDIO &&

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
# HG changeset patch
# User Youness Alaoui <kakaroto@kakaroto.homelinux.net>
# Date 1404874798 14400
# Node ID b52be4fef1ded825e262095480915f2c675a5694
# Parent 2b41ba1fde8a80a4f2d715874a0b02449d4b66ad
Fix gstreamer elements references
In backend-fs2, the create_src will unref the src after it's done with
it, if we simply return the created source, it will segfault.
The issue never happened before because every source so far also has
the UNIQUE flag, which causes it to go in a different branch of the
code which does ref the element and add it to the bin.
Refs #16315
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -443,7 +443,11 @@
if (src) {
GstElement *capsfilter = gst_bin_get_by_name(GST_BIN(src), "prpl_video_caps");
- g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL);
+ if (capsfilter) {
+ g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL);
+ gst_object_unref (capsfilter);
+ }
+ gst_object_unref (src);
}
g_free(id);
@@ -550,6 +554,11 @@
} else {
ret = purple_media_element_info_call_create(info,
media, session_id, participant);
+ if (element_type & PURPLE_MEDIA_ELEMENT_SRC) {
+ gst_object_ref(ret);
+ gst_bin_add(GST_BIN(purple_media_manager_get_pipeline(manager)),
+ ret);
+ }
}
if (ret == NULL)

View File

@ -0,0 +1,52 @@
# HG changeset patch
# User Jakub Adam <jakub.adam@ktknet.cz>
# Date 1407847148 -7200
# Node ID 7767aaeade6404396204794f9bc75d9a2cb723f0
# Parent 8e4fa54f166211ffd6cd869cca611e8d64ea1fdf
media: make "init-media" signal handler optional
Change the logic so that the PurpleMedia instance isn't disposed when
"init-media" has no connected handlers.
We want the media object freed only when some signal callback function
explicitly returns FALSE, indicating an error during the initialization.
This is mostly useful for the imminent addition of private media streams.
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -334,7 +334,7 @@
{
#ifdef USE_VV
PurpleMedia *media;
- gboolean signal_ret;
+ guint signal_id;
media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
"manager", manager,
@@ -343,12 +343,17 @@
"initiator", initiator,
NULL));
- g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0,
- media, account, remote_user, &signal_ret);
+ signal_id = purple_media_manager_signals[INIT_MEDIA];
- if (signal_ret == FALSE) {
- g_object_unref(media);
- return NULL;
+ if (g_signal_has_handler_pending(manager, signal_id, 0, FALSE)) {
+ gboolean signal_ret;
+
+ g_signal_emit(manager, signal_id, 0, media, account, remote_user,
+ &signal_ret);
+ if (signal_ret == FALSE) {
+ g_object_unref(media);
+ return NULL;
+ }
}
manager->priv->medias = g_list_append(manager->priv->medias, media);

View File

@ -0,0 +1,290 @@
# HG changeset patch
# User Youness Alaoui <kakaroto@kakaroto.homelinux.net>
# Date 1404764862 14400
# Node ID d729a9b2126594df3e38647e926ac7c0a7db807b
# Parent 7767aaeade6404396204794f9bc75d9a2cb723f0
Add Private media API
Creating a private media can be useful for plugins that want to create a
PurpleMedia for internal use without the front-end being notified of its
creation.
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -86,6 +86,7 @@
GstElement *pipeline;
PurpleMediaCaps ui_caps;
GList *medias;
+ GList *private_medias;
GList *elements;
GList *output_windows;
gulong next_output_window_id;
@@ -111,6 +112,7 @@
enum {
INIT_MEDIA,
+ INIT_PRIVATE_MEDIA,
UI_CAPS_CHANGED,
LAST_SIGNAL
};
@@ -161,6 +163,15 @@
G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
G_TYPE_POINTER, G_TYPE_STRING);
+ purple_media_manager_signals[INIT_PRIVATE_MEDIA] =
+ g_signal_new ("init-private-media",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ purple_smarshal_BOOLEAN__OBJECT_POINTER_STRING,
+ G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA,
+ G_TYPE_POINTER, G_TYPE_STRING);
+
purple_media_manager_signals[UI_CAPS_CHANGED] = g_signal_new ("ui-caps-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
@@ -177,6 +188,7 @@
{
media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media);
media->priv->medias = NULL;
+ media->priv->private_medias = NULL;
media->priv->next_output_window_id = 1;
#ifdef USE_VV
media->priv->backend_type = PURPLE_TYPE_MEDIA_BACKEND_FS2;
@@ -198,6 +210,10 @@
g_list_delete_link(priv->medias, priv->medias)) {
g_object_unref(priv->medias->data);
}
+ for (; priv->private_medias; priv->private_medias =
+ g_list_delete_link(priv->private_medias, priv->private_medias)) {
+ g_object_unref(priv->private_medias->data);
+ }
for (; priv->elements; priv->elements =
g_list_delete_link(priv->elements, priv->elements)) {
g_object_unref(priv->elements->data);
@@ -325,12 +341,13 @@
}
#endif /* USE_GSTREAMER */
-PurpleMedia *
-purple_media_manager_create_media(PurpleMediaManager *manager,
- PurpleAccount *account,
- const char *conference_type,
- const char *remote_user,
- gboolean initiator)
+static PurpleMedia *
+create_media(PurpleMediaManager *manager,
+ PurpleAccount *account,
+ const char *conference_type,
+ const char *remote_user,
+ gboolean initiator,
+ gboolean private)
{
#ifdef USE_VV
PurpleMedia *media;
@@ -343,7 +360,9 @@
"initiator", initiator,
NULL));
- signal_id = purple_media_manager_signals[INIT_MEDIA];
+ signal_id = private ?
+ purple_media_manager_signals[INIT_PRIVATE_MEDIA] :
+ purple_media_manager_signals[INIT_MEDIA];
if (g_signal_has_handler_pending(manager, signal_id, 0, FALSE)) {
gboolean signal_ret;
@@ -356,26 +375,33 @@
}
}
- manager->priv->medias = g_list_append(manager->priv->medias, media);
+ if (private)
+ manager->priv->private_medias = g_list_append(
+ manager->priv->private_medias, media);
+ else
+ manager->priv->medias = g_list_append(manager->priv->medias, media);
return media;
#else
return NULL;
#endif
}
-GList *
-purple_media_manager_get_media(PurpleMediaManager *manager)
+static GList *
+get_media(PurpleMediaManager *manager, gboolean private)
{
#ifdef USE_VV
- return manager->priv->medias;
+ if (private)
+ return manager->priv->private_medias;
+ else
+ return manager->priv->medias;
#else
return NULL;
#endif
}
-GList *
-purple_media_manager_get_media_by_account(PurpleMediaManager *manager,
- PurpleAccount *account)
+static GList *
+get_media_by_account(PurpleMediaManager *manager,
+ PurpleAccount *account, gboolean private)
{
#ifdef USE_VV
GList *media = NULL;
@@ -383,7 +409,10 @@
g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
- iter = manager->priv->medias;
+ if (private)
+ iter = manager->priv->private_medias;
+ else
+ iter = manager->priv->medias;
for (; iter; iter = g_list_next(iter)) {
if (purple_media_get_account(iter->data) == account) {
media = g_list_prepend(media, iter->data);
@@ -397,21 +426,73 @@
}
void
-purple_media_manager_remove_media(PurpleMediaManager *manager,
- PurpleMedia *media)
+purple_media_manager_remove_media(PurpleMediaManager *manager, PurpleMedia *media)
{
#ifdef USE_VV
GList *list;
+ GList **medias;
g_return_if_fail(manager != NULL);
- list = g_list_find(manager->priv->medias, media);
+ if ((list = g_list_find(manager->priv->medias, media))) {
+ medias = &manager->priv->medias;
+ } else if ((list = g_list_find(manager->priv->private_medias, media))) {
+ medias = &manager->priv->private_medias;
+ }
+
if (list)
- manager->priv->medias =
- g_list_delete_link(manager->priv->medias, list);
+ *medias = g_list_delete_link(*medias, list);
#endif
}
+PurpleMedia *
+purple_media_manager_create_media(PurpleMediaManager *manager,
+ PurpleAccount *account,
+ const char *conference_type,
+ const char *remote_user,
+ gboolean initiator)
+{
+ return create_media (manager, account, conference_type,
+ remote_user, initiator, FALSE);
+}
+
+GList *
+purple_media_manager_get_media(PurpleMediaManager *manager)
+{
+ return get_media (manager, FALSE);
+}
+
+GList *
+purple_media_manager_get_media_by_account(PurpleMediaManager *manager,
+ PurpleAccount *account)
+{
+ return get_media_by_account (manager, account, FALSE);
+}
+
+PurpleMedia *
+purple_media_manager_create_private_media(PurpleMediaManager *manager,
+ PurpleAccount *account,
+ const char *conference_type,
+ const char *remote_user,
+ gboolean initiator)
+{
+ return create_media (manager, account, conference_type,
+ remote_user, initiator, TRUE);
+}
+
+GList *
+purple_media_manager_get_private_media(PurpleMediaManager *manager)
+{
+ return get_media (manager, TRUE);
+}
+
+GList *
+purple_media_manager_get_private_media_by_account(PurpleMediaManager *manager,
+ PurpleAccount *account)
+{
+ return get_media_by_account (manager, account, TRUE);
+}
+
#ifdef USE_VV
static void
request_pad_unlinked_cb(GstPad *pad, GstPad *peer, gpointer user_data)
diff --git a/libpurple/mediamanager.h b/libpurple/mediamanager.h
--- a/libpurple/mediamanager.h
+++ b/libpurple/mediamanager.h
@@ -130,6 +130,56 @@
PurpleMedia *media);
/**
+ * Creates a private media session. A private media session is a
+ * media session which is private to the caller. It is meant to be
+ * used by plugins to create a media session that the front-end does
+ * not get notified about. It is useful especially for sessions with a
+ * type of PURPLE_MEDIA_APPLICATION which the front-end wouldn't know
+ * how to handle.
+ *
+ * @param manager The media manager to create the session under.
+ * @param account The account to create the session on.
+ * @param conference_type The conference type to feed into Farsight2.
+ * @param remote_user The remote user to initiate the session with.
+ * @param initiator TRUE if the local user is the initiator of this media
+ * call, FALSE otherwise.
+ *
+ * @return A newly created media session.
+ *
+ * @since 2.11.0
+ */
+PurpleMedia *purple_media_manager_create_private_media(
+ PurpleMediaManager *manager,
+ PurpleAccount *account,
+ const char *conference_type,
+ const char *remote_user,
+ gboolean initiator);
+
+/**
+ * Gets all of the private media sessions.
+ *
+ * @param manager The media manager to get all of the sessions from.
+ *
+ * @return A list of all the private media sessions.
+ *
+ * @since 2.11.0
+ */
+GList *purple_media_manager_get_private_media(PurpleMediaManager *manager);
+
+/**
+ * Gets all of the private media sessions for a given account.
+ *
+ * @param manager The media manager to get the sessions from.
+ * @param account The account the sessions are on.
+ *
+ * @return A list of the private media sessions on the given account.
+ *
+ * @since 2.11.0
+ */
+GList *purple_media_manager_get_private_media_by_account(
+ PurpleMediaManager *manager, PurpleAccount *account);
+
+/**
* Signals that output windows should be created for the chosen stream.
*
* This shouldn't be called outside of mediamanager.c and media.c

View File

@ -0,0 +1,23 @@
# HG changeset patch
# User Youness Alaoui <kakaroto@kakaroto.homelinux.net>
# Date 1404159462 14400
# Node ID 2b41ba1fde8a80a4f2d715874a0b02449d4b66ad
# Parent f02f7d1fb4d545c6d7353745094e1afcf0428ca9
Fix send-video enum typo
Refs #16315
diff --git a/libpurple/media/enum-types.c b/libpurple/media/enum-types.c
--- a/libpurple/media/enum-types.c
+++ b/libpurple/media/enum-types.c
@@ -175,7 +175,7 @@
{ PURPLE_MEDIA_RECV_VIDEO,
"PURPLE_MEDIA_RECV_VIDEO", "recv-video" },
{ PURPLE_MEDIA_SEND_VIDEO,
- "PURPLE_MEDIA_SEND_VIDEO", "send-audio" },
+ "PURPLE_MEDIA_SEND_VIDEO", "send-video" },
{ PURPLE_MEDIA_AUDIO,
"PURPLE_MEDIA_AUDIO", "audio" },
{ PURPLE_MEDIA_VIDEO,

1128
pidgin-port-to-gst-1.0.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Tue Aug 11 17:16:56 UTC 2015 - zaitor@opensuse.org
- Add a Recommends: gstreamer-plugins-good, this plugin provides
wav support that pidgin needs.
-------------------------------------------------------------------
Tue Jun 30 14:50:50 UTC 2015 - dimstar@opensuse.org
- Re-attempt port to GStreamer 1.0 (based on work by David):
+ Add patches, from upstream:
- pidgin-port-to-gst-1.0.patch
- pidgin-2.10.11-gst-references.patch
- pidgin-2.10.11-add-dtmf-support.patch
- pidgin-2.10.11-application-media.patch
- pidgin-2.10.11-init-media-optional.patch
- pidgin-2.10.11-send-video-enum.patch
- pidgin-2.10.11-private-media.patch
+ Replace gstreamer-0_10-devel and
gstreamer-0_10-plugins-base-devel BuildRequires with
pkgconfig(gstreamer-1.0), pkgconfig(gstreamer-video-1.0) and
pkgconfig(farstream-0.2).
+ Switch --disable-vv configure paramter to --enable-vv.
+ Pass --with-gstreamer=1.0 to configure.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 20 10:04:54 UTC 2015 - tbehrens@suse.com Tue Jan 20 10:04:54 UTC 2015 - tbehrens@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package pidgin # spec file for package pidgin
# #
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -23,7 +23,6 @@ Release: 0
Summary: Multiprotocol Instant Messaging Client Summary: Multiprotocol Instant Messaging Client
License: GPL-2.0+ License: GPL-2.0+
Group: Productivity/Networking/Instant Messenger Group: Productivity/Networking/Instant Messenger
# FIXME: Remove unconditional --disable-vv parameter from configure once pidgin is ported to farstream 0.2
Url: http://pidgin.im/ Url: http://pidgin.im/
Source: http://downloads.sourceforge.net/project/pidgin/Pidgin/2.10.11/%{name}-%{version}.tar.gz Source: http://downloads.sourceforge.net/project/pidgin/Pidgin/2.10.11/%{name}-%{version}.tar.gz
Source1: %{name}-prefs.xml Source1: %{name}-prefs.xml
@ -35,6 +34,19 @@ Patch3: %{name}-gnome-keyring.patch
Patch4: %{name}-fix-perl-build.patch Patch4: %{name}-fix-perl-build.patch
# PATCH-FIX-UPSTREAM pidgin-crash-missing-gst-registry.patch bnc#866455 pidgin.im#16224 cxiong@suse.com -- Fix crash when GST registry cache file is missing. # PATCH-FIX-UPSTREAM pidgin-crash-missing-gst-registry.patch bnc#866455 pidgin.im#16224 cxiong@suse.com -- Fix crash when GST registry cache file is missing.
Patch6: pidgin-crash-missing-gst-registry.patch Patch6: pidgin-crash-missing-gst-registry.patch
Patch7: pidgin-2.10.11-send-video-enum.patch
# PATCH-FEATURE-UPSTREAM pidgin-2.10.11-gst-references.patch dimstar@opensuse.org -- http://hg.pidgin.im/pidgin/main/rev/b52be4fef1de
Patch8: pidgin-2.10.11-gst-references.patch
# PATCH-FEATURE-UPSTREAM pidgin-2.10.11-add-dtmf-support.patch dimstar@opensuse.org -- http://hg.pidgin.im/pidgin/main/rev/6b4576edf2a6
Patch9: pidgin-2.10.11-add-dtmf-support.patch
# PATCH-FEATURE-UPSTREAM pidgin-port-to-gst-1.0.patch dimstar@opensuse.org -- Port to GStreamer 1.0 / farstream 0.2; taken from https://pidgin.im/pipermail/devel/2015-March/023645.html
Patch10: pidgin-port-to-gst-1.0.patch
# PATCH-FIX-UPSTREAM pidgin-2.10.11-init-media-optional.patch dimstar@opensuse.org -- make "init-media" signal handler optional
Patch11: pidgin-2.10.11-init-media-optional.patch
# PATCH-FIX-UPSTREAM pidgin-2.10.11-private-media.patch dimstar@opensuse.org -- Add Private media API.
Patch12: pidgin-2.10.11-private-media.patch
# PATCH-FIX-UPSTREAM pidgin-2.10.11-application-media.patch dimstar@opensuse.org -- Add application media type and APIs, pidgin.im#16315
Patch13: pidgin-2.10.11-application-media.patch
BuildRequires: NetworkManager-devel BuildRequires: NetworkManager-devel
# Can use external libzephyr. # Can use external libzephyr.
BuildRequires: cyrus-sasl-devel BuildRequires: cyrus-sasl-devel
@ -44,8 +56,6 @@ BuildRequires: doxygen
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gconf2-devel BuildRequires: gconf2-devel
BuildRequires: graphviz BuildRequires: graphviz
BuildRequires: gstreamer-0_10-devel
BuildRequires: gstreamer-0_10-plugins-base-devel
BuildRequires: gtk-doc BuildRequires: gtk-doc
BuildRequires: gtkspell-devel BuildRequires: gtkspell-devel
BuildRequires: intltool BuildRequires: intltool
@ -66,6 +76,9 @@ BuildRequires: silc-toolkit-devel
BuildRequires: startup-notification-devel BuildRequires: startup-notification-devel
BuildRequires: tk-devel BuildRequires: tk-devel
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
BuildRequires: pkgconfig(farstream-0.2)
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-video-1.0)
Requires: perl-base = %{perl_version} Requires: perl-base = %{perl_version}
%if 0%{?suse_version} <= 1110 %if 0%{?suse_version} <= 1110
Recommends: %{name}-emoticons-nld Recommends: %{name}-emoticons-nld
@ -108,6 +121,7 @@ Requires: ca-certificates-mozilla
%else %else
Requires: openssl-certs Requires: openssl-certs
%endif %endif
Recommends: gstreamer-plugins-good
%description %description
Pidgin is a chat program which lets you log in to accounts on multiple Pidgin is a chat program which lets you log in to accounts on multiple
@ -255,6 +269,13 @@ translation-update-upstream
%if 0%{?suse_version} >= 1310 %if 0%{?suse_version} >= 1310
%patch6 -p1 %patch6 -p1
%endif %endif
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
# Change Myanmar/Myanmar to Myanmar. # Change Myanmar/Myanmar to Myanmar.
mv -f po/my_MM.po po/my.po mv -f po/my_MM.po po/my.po
@ -273,13 +294,14 @@ autoreconf -fi
--enable-cyrus-sasl \ --enable-cyrus-sasl \
--enable-dbus \ --enable-dbus \
--enable-gstreamer \ --enable-gstreamer \
--with-gstreamer=1.0 \
%if 0%{?suse_version} <= 1110 %if 0%{?suse_version} <= 1110
--enable-gnome-keyring \ --enable-gnome-keyring \
%endif %endif
--enable-nm \ --enable-nm \
--enable-dbus \ --enable-dbus \
--enable-devhelp \ --enable-devhelp \
--disable-vv \ --enable-vv \
--with-tclconfig=%{_libdir} \ --with-tclconfig=%{_libdir} \
--with-tkconfig=%{_libdir} \ --with-tkconfig=%{_libdir} \
--with-system-ssl-certs=%{_sysconfdir}/ssl/certs/ --with-system-ssl-certs=%{_sysconfdir}/ssl/certs/