media: don't let Farstream use VA-API elements release-2.x.y

Mon, 16 May 2016 14:52:58 +0200

author
Jakub Adam <jakub.adam@ktknet.cz>
date
Mon, 16 May 2016 14:52:58 +0200
branch
release-2.x.y
changeset 37794
1645cfba41c8
parent 37793
b02b90cece86
child 37795
d9aac4128ad2

media: don't let Farstream use VA-API elements

Video Acceleration API isn't well supported in Farstream and produces
errors during video calls, however a high Rank of vaapi GStreamer
elements causes them to be picked as preferred video encoders and
decoders when available in the system.

For now, set the rank of all elements from vaapi plugin to NONE, so that
they are ignored.

Backport of Pidgin 3 commit 1e3a33f69fab.

libpurple/media/backend-fs2.c file | annotate | diff | comparison | revisions
--- a/libpurple/media/backend-fs2.c	Fri Jun 17 07:11:46 2016 +0200
+++ b/libpurple/media/backend-fs2.c	Mon May 16 14:52:58 2016 +0200
@@ -533,6 +533,8 @@
 purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass)
 {
 	GObjectClass *gobject_class = (GObjectClass*)klass;
+	GList *features;
+	GList *it;
 
 	gobject_class->dispose = purple_media_backend_fs2_dispose;
 	gobject_class->finalize = purple_media_backend_fs2_finalize;
@@ -544,6 +546,15 @@
 	g_object_class_override_property(gobject_class, PROP_MEDIA, "media");
 
 	g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private));
+
+	/* VA-API elements aren't well supported in Farstream. Ignore them. */
+	features = gst_registry_get_feature_list_by_plugin(gst_registry_get(),
+			"vaapi");
+	for (it = features; it; it = it->next) {
+		gst_plugin_feature_set_rank((GstPluginFeature *)it->data,
+				GST_RANK_NONE);
+	}
+	gst_plugin_feature_list_free(features);
 }
 
 static void

mercurial