pidgin.next.minor: f4d00cd6: Public API allowing plugins (including p...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Fri Jan 7 22:30:49 EST 2011


----------------------------------------------------------------------
Revision: f4d00cd60a9daffa4de19396be4c3db6972fb5a0
Parent:   18c09017470e7c774d362b1828fb998da78562ca
Author:   jakub.adam at ktknet.cz
Date:     01/07/11 22:21:44
Branch:   im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/f4d00cd60a9daffa4de19396be4c3db6972fb5a0

Changelog: 

Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.

Changes against parent 18c09017470e7c774d362b1828fb998da78562ca

  patched  libpurple/media-gst.h
  patched  libpurple/mediamanager.c

-------------- next part --------------
============================================================
--- libpurple/mediamanager.c	9819df92ea6ecba80a2bab6ed0c2061097073c10
+++ libpurple/mediamanager.c	07b2e9453f9caf325931ca318e3798e7869972f3
@@ -420,7 +420,30 @@ request_pad_unlinked_cb(GstPad *pad, Gst
 
 #ifdef USE_GSTREAMER
 
-static GstCaps *
+void
+purple_media_manager_set_video_caps(PurpleMediaManager *manager, GstCaps *caps)
+{
+#ifdef USE_VV
+	if (manager->priv->video_caps)
+		gst_caps_unref(manager->priv->video_caps);
+
+	manager->priv->video_caps = caps;
+
+	if (manager->priv->pipeline && manager->priv->video_src) {
+		gchar *id = purple_media_element_info_get_id(manager->priv->video_src);
+		GstElement *src = gst_bin_get_by_name(GST_BIN(manager->priv->pipeline), id);
+
+		if (src) {
+			GstElement *capsfilter = gst_bin_get_by_name(GST_BIN(src), "prpl_video_caps");
+			g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL);
+		}
+
+		g_free(id);
+	}
+#endif
+}
+
+GstCaps *
 purple_media_manager_get_video_caps(PurpleMediaManager *manager)
 {
 #ifdef USE_VV
============================================================
--- libpurple/media-gst.h	6d852ca007508509aa0d12982e16ab2f7d986462
+++ libpurple/media-gst.h	4b2ed89f2709e7a9b4a4852f8a6cbdb878eabf35
@@ -159,6 +159,31 @@ PurpleMediaElementInfo *purple_media_man
 PurpleMediaElementInfo *purple_media_manager_get_active_element(
 		PurpleMediaManager *manager, PurpleMediaElementType type);
 
+/**
+ * Reduces media formats supported by the video source to given set.
+ *
+ * Useful to force negotiation of smaller picture resolution more suitable for
+ * use with particular codec and communication protocol without rescaling.
+ *
+ * @param manager The media manager to set the media formats.
+ * @param caps Set of allowed media formats.
+ *
+ * @since 2.8.0
+ */
+void purple_media_manager_set_video_caps(PurpleMediaManager *manager,
+		GstCaps *caps);
+
+/**
+ * Returns current set of media formats limiting the output from video source.
+ *
+ * @param manager The media manager to get the media formats from.
+ *
+ * @return @c GstCaps limiting the video source's formats.
+ *
+ * @since 2.8.0
+ */
+GstCaps *purple_media_manager_get_video_caps(PurpleMediaManager *manager);
+
 gchar *purple_media_element_info_get_id(PurpleMediaElementInfo *info);
 gchar *purple_media_element_info_get_name(PurpleMediaElementInfo *info);
 PurpleMediaElementType purple_media_element_info_get_element_type(


More information about the Commits mailing list