Mercurial > pidgin
diff pidgin/gtkmedia.c @ 31103:4ce69a55f2c6
Add a GstCapsFilter between every video source and the rest of the pipeline.
This will force the sources to have the same capaibilties as the
"pidgindefaultvideosrc" and should reduce CPU usage as well. Refs #13095.
committer: John Bailey <rekkanoryo@rekkanoryo.org>
author | jakub.adam@ktknet.cz |
---|---|
date | Fri, 07 Jan 2011 11:38:12 +0000 |
parents | a8cc50c2279f |
children | 017b7ff5a894 a7397a3d67ef |
line wrap: on
line diff
--- a/pidgin/gtkmedia.c Thu Jan 06 20:43:12 2011 +0000 +++ b/pidgin/gtkmedia.c Fri Jan 07 11:38:12 2011 +0000 @@ -932,10 +932,9 @@ create_default_video_src(PurpleMedia *media, const gchar *session_id, const gchar *participant) { - GstElement *sendbin, *src, *videoscale, *capsfilter; + GstElement *sendbin, *src; GstPad *pad; GstPad *ghost; - GstCaps *caps; #ifdef _WIN32 /* autovideosrc doesn't pick ksvideosrc for some reason */ @@ -960,19 +959,10 @@ } sendbin = gst_bin_new("pidgindefaultvideosrc"); - videoscale = gst_element_factory_make("videoscale", NULL); - capsfilter = gst_element_factory_make("capsfilter", NULL); - /* It was recommended to set the size <= 352x288 and framerate <= 20 */ - caps = gst_caps_from_string("video/x-raw-yuv , width=[250,352] , " - "height=[200,288] , framerate=[1/1,20/1]"); - g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL); + gst_bin_add(GST_BIN(sendbin), src); - gst_bin_add_many(GST_BIN(sendbin), src, - videoscale, capsfilter, NULL); - gst_element_link_many(src, videoscale, capsfilter, NULL); - - pad = gst_element_get_static_pad(capsfilter, "src"); + pad = gst_element_get_static_pad(src, "src"); ghost = gst_ghost_pad_new("ghostsrc", pad); gst_object_unref(pad); gst_element_add_pad(sendbin, ghost);