pidgin.vv: 2c1ae01e: Added the connection property back to Pu...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Feb 25 00:25:25 EST 2009


-----------------------------------------------------------------
Revision: 2c1ae01ec290ce8bbd6b336a4ba6acde8c3e3790
Ancestor: c289064bd8e0b9122bb43987ea3076e4d25c603c
Author: maiku at soc.pidgin.im
Date: 2009-02-25T01:58:57
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/2c1ae01ec290ce8bbd6b336a4ba6acde8c3e3790

Modified files:
        libpurple/media.c libpurple/media.h libpurple/mediamanager.c

ChangeLog: 

Added the connection property back to PurpleMedia.

-------------- next part --------------
============================================================
--- libpurple/media.c	ee4a1d9dc1ff90721c5c5e147b89f186c6b9b16a
+++ libpurple/media.c	73d3dd7c631f1261754acd989c8b27c71e5cfa5a
@@ -87,6 +87,7 @@ struct _PurpleMediaPrivate
 struct _PurpleMediaPrivate
 {
 	PurpleMediaManager *manager;
+	PurpleConnection *pc;
 	FsConference *conference;
 	gboolean initiator;
 
@@ -135,6 +136,7 @@ enum {
 enum {
 	PROP_0,
 	PROP_MANAGER,
+	PROP_CONNECTION,
 	PROP_CONFERENCE,
 	PROP_INITIATOR,
 };
@@ -196,6 +198,12 @@ purple_media_class_init (PurpleMediaClas
 			PURPLE_TYPE_MEDIA_MANAGER,
 			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
+	g_object_class_install_property(gobject_class, PROP_CONNECTION,
+			g_param_spec_pointer("connection",
+			"PurpleConnection",
+			"The connection this media session is on.",
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
 	g_object_class_install_property(gobject_class, PROP_CONFERENCE,
 			g_param_spec_object("conference",
 			"Farsight conference",
@@ -407,6 +415,9 @@ purple_media_set_property (GObject *obje
 
 			purple_media_setup_pipeline(media);
 			break;
+		case PROP_CONNECTION:
+			media->priv->pc = g_value_get_pointer(value);
+			break;
 		case PROP_CONFERENCE: {
 			if (media->priv->conference)
 				gst_object_unref(media->priv->conference);
@@ -437,6 +448,9 @@ purple_media_get_property (GObject *obje
 		case PROP_MANAGER:
 			g_value_set_object(value, media->priv->manager);
 			break;
+		case PROP_CONNECTION:
+			g_value_set_pointer(value, media->priv->pc);
+			break;
 		case PROP_CONFERENCE:
 			g_value_set_object(value, media->priv->conference);
 			break;
@@ -1360,6 +1374,15 @@ purple_media_get_pipeline(PurpleMedia *m
 	return purple_media_manager_get_pipeline(media->priv->manager);
 }
 
+PurpleConnection *
+purple_media_get_connection(PurpleMedia *media)
+{
+	PurpleConnection *pc;
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
+	g_object_get(G_OBJECT(media), "connection", &pc, NULL);
+	return pc;
+}
+
 void
 purple_media_error(PurpleMedia *media, const gchar *error, ...)
 {
============================================================
--- libpurple/media.h	3ce7821835d856470067defa7e62a22b79bd1c59
+++ libpurple/media.h	69e24f1fc03a3f12b1a6791c763b91617feacfe8
@@ -383,6 +383,15 @@ GstElement *purple_media_get_pipeline(Pu
 GstElement *purple_media_get_pipeline(PurpleMedia *media);
 
 /**
+ * Gets the PurpleConnection this media session is on.
+ *
+ * @param media The media session to retrieve the connection from.
+ *
+ * @return The connection retrieved.
+ */
+PurpleConnection *purple_media_get_connection(PurpleMedia *media);
+
+/**
  * Signals an error in the media session.
  *
  * @param media The media object to set the state on.
============================================================
--- libpurple/mediamanager.c	dcb14912e1d1fb5d26794eee952a83a44293ec02
+++ libpurple/mediamanager.c	0e52593880048b45eaf1aa1112a7f6b8551fe616
@@ -239,6 +239,7 @@ purple_media_manager_create_media(Purple
 
 	media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
 			     "manager", manager,
+			     "connection", gc,
 			     "conference", conference,
 			     "initiator", initiator,
 			     NULL));


More information about the Commits mailing list