/pidgin/main: dfadb1bef243: media: add videoscale before video sink

Jakub Adam jakub.adam at ktknet.cz
Tue May 3 12:44:00 EDT 2016


Changeset: dfadb1bef243f76a107ffc6d39f91bc031306863
Author:	 Jakub Adam <jakub.adam at ktknet.cz>
Date:	 2016-04-21 09:40 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/dfadb1bef243

Description:

media: add videoscale before video sink

Fixes issue with ximagesink displaying only a corner cut-out of larger
webcam video.

In addition, a patch for ximagesink is needed, ETA GStreamer 1.9.0:

https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=59d7f9c62ee95dfbb5b450476f73a717e03b7b8c

diffstat:

 libpurple/mediamanager.c |  9 ++++++---
 pidgin/gtkprefs.c        |  7 +++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (67 lines):

diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -1389,7 +1389,7 @@ purple_media_manager_create_output_windo
 				(participant == ow->participant)) &&
 				!strcmp(session_id, ow->session_id)) {
 			GstBus *bus;
-			GstElement *queue, *convert;
+			GstElement *queue, *convert, *scale;
 			GstElement *tee = purple_media_get_tee(media,
 					session_id, participant);
 
@@ -1398,6 +1398,7 @@ purple_media_manager_create_output_windo
 
 			queue = gst_element_factory_make("queue", NULL);
 			convert = gst_element_factory_make("videoconvert", NULL);
+			scale = gst_element_factory_make("videoscale", NULL);
 			ow->sink = purple_media_manager_get_element(
 					manager, PURPLE_MEDIA_RECV_VIDEO,
 					ow->media, ow->session_id,
@@ -1418,7 +1419,7 @@ purple_media_manager_create_output_windo
 			}
 
 			gst_bin_add_many(GST_BIN(GST_ELEMENT_PARENT(tee)),
-					queue, convert, ow->sink, NULL);
+					queue, convert, scale, ow->sink, NULL);
 
 			bus = gst_pipeline_get_bus(GST_PIPELINE(
 					manager->priv->pipeline));
@@ -1427,9 +1428,11 @@ purple_media_manager_create_output_windo
 			gst_object_unref(bus);
 
 			gst_element_set_state(ow->sink, GST_STATE_PLAYING);
+			gst_element_set_state(scale, GST_STATE_PLAYING);
 			gst_element_set_state(convert, GST_STATE_PLAYING);
 			gst_element_set_state(queue, GST_STATE_PLAYING);
-			gst_element_link(convert, ow->sink);
+			gst_element_link(scale, ow->sink);
+			gst_element_link(convert, scale);
 			gst_element_link(queue, convert);
 			gst_element_link(tee, queue);
 		}
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -3687,16 +3687,19 @@ create_video_pipeline(void)
 	GstElement *pipeline;
 	GstElement *src, *sink;
 	GstElement *videoconvert;
+	GstElement *videoscale;
 
 	pipeline = gst_pipeline_new("videotest");
 	src = create_test_element(PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC);
 	sink = create_test_element(PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK);
 	videoconvert = gst_element_factory_make("videoconvert", NULL);
+	videoscale = gst_element_factory_make("videoscale", NULL);
 
 	g_object_set_data(G_OBJECT(pipeline), "sink", sink);
 
-	gst_bin_add_many(GST_BIN(pipeline), src, videoconvert, sink, NULL);
-	gst_element_link_many(src, videoconvert, sink, NULL);
+	gst_bin_add_many(GST_BIN(pipeline), src, videoconvert, videoscale, sink,
+			NULL);
+	gst_element_link_many(src, videoconvert, videoscale, sink, NULL);
 
 	return pipeline;
 }



More information about the Commits mailing list