changeset 26342:0c96ac2ea5f8

Remove purple_media_video_init_* functions.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sun, 22 Mar 2009 22:49:10 +0000
parents d01fb18be4d2
children 722527dc050f
files libpurple/media.c libpurple/media.h pidgin/gtkmedia.c
diffstat 3 files changed, 38 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Sun Mar 22 22:34:01 2009 +0000
+++ b/libpurple/media.c	Sun Mar 22 22:49:10 2009 +0000
@@ -1429,47 +1429,6 @@
 }
 
 void
-purple_media_video_init_src(GstElement **sendbin)
-{
-	GstElement *src, *videoscale, *capsfilter;
-	GstPad *pad;
-	GstPad *ghost;
-	GstCaps *caps;
-	const gchar *video_plugin = purple_prefs_get_string(
-			"/purple/media/video/plugin");
-	const gchar *video_device = purple_prefs_get_string(
-			"/purple/media/video/device");
-
-	g_return_if_fail(sendbin != NULL);
-
-	*sendbin = gst_bin_new("purplesendvideobin");
-	src = gst_element_factory_make(video_plugin, "purplevideosource");
-	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,350] , "
-			"height=[200,275] , framerate=[10/1,20/1]");
-	g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL);
-
-	gst_bin_add_many(GST_BIN(*sendbin), src, videoscale, capsfilter, NULL);
-	gst_element_link_many(src, videoscale, capsfilter, NULL);
-
-	if (!strcmp(video_plugin, "videotestsrc")) {
-		/* unless is-live is set to true it doesn't throttle videotestsrc */
-		g_object_set (G_OBJECT(src), "is-live", TRUE, NULL);
-	}
-
-	pad = gst_element_get_static_pad(capsfilter, "src");
-	ghost = gst_ghost_pad_new("ghostsrc", pad);
-	gst_object_unref(pad);
-	gst_element_add_pad(*sendbin, ghost);
-
-	if (video_device != NULL && strcmp(video_device, ""))
-		g_object_set(G_OBJECT(src), "device", video_device, NULL);
-}
-
-void
 purple_media_audio_init_recv(GstElement **recvbin, GstElement **recvlevel)
 {
 	GstElement *sink, *volume, *queue;
@@ -1497,14 +1456,6 @@
 	g_object_set(G_OBJECT(*recvlevel), "message", TRUE, NULL);
 }
 
-void
-purple_media_video_init_recv(GstElement **recvbin)
-{
-	g_return_if_fail(recvbin != NULL);
-
-	*recvbin = gst_element_factory_make("autovideosink", NULL);
-}
-
 static void
 purple_media_new_local_candidate_cb(FsStream *stream,
 				    FsCandidate *local_candidate,
--- a/libpurple/media.h	Sun Mar 22 22:34:01 2009 +0000
+++ b/libpurple/media.h	Sun Mar 22 22:49:10 2009 +0000
@@ -436,13 +436,6 @@
                                  GstElement **sendlevel);
 
 /**
- * Creates a default video source.
- *
- * @param sendbin Set to the newly created video source.
- */
-void purple_media_video_init_src(GstElement **sendbin);
-
-/**
  * Creates a default audio sink.
  *
  * @param recvbin Set to the newly created audio sink.
@@ -451,13 +444,6 @@
 void purple_media_audio_init_recv(GstElement **recvbin, GstElement **recvlevel);
 
 /**
- * Creates a default video sink.
- *
- * @param sendbin Set to the newly created video sink.
- */
-void purple_media_video_init_recv(GstElement **sendbin);
-
-/**
  * Adds a stream to a session.
  *
  * It only adds a stream to one audio session or video session as
--- a/pidgin/gtkmedia.c	Sun Mar 22 22:34:01 2009 +0000
+++ b/pidgin/gtkmedia.c	Sun Mar 22 22:49:10 2009 +0000
@@ -836,17 +836,49 @@
 static GstElement *
 create_default_video_src(void)
 {
-	GstElement *ret = NULL;
-	purple_media_video_init_src(&ret);
-	return ret;
+	GstElement *sendbin, *src, *videoscale, *capsfilter;
+	GstPad *pad;
+	GstPad *ghost;
+	GstCaps *caps;
+	const gchar *video_plugin = purple_prefs_get_string(
+			"/purple/media/video/plugin");
+	const gchar *video_device = purple_prefs_get_string(
+			"/purple/media/video/device");
+
+	sendbin = gst_bin_new("purplesendvideobin");
+	src = gst_element_factory_make(video_plugin, "purplevideosource");
+	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,350] , "
+			"height=[200,275] , framerate=[10/1,20/1]");
+	g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL);
+
+	gst_bin_add_many(GST_BIN(sendbin), src,
+			videoscale, capsfilter, NULL);
+	gst_element_link_many(src, videoscale, capsfilter, NULL);
+
+	if (!strcmp(video_plugin, "videotestsrc")) {
+		/* Set is-live to true to throttle videotestsrc */
+		g_object_set (G_OBJECT(src), "is-live", TRUE, NULL);
+	}
+
+	pad = gst_element_get_static_pad(capsfilter, "src");
+	ghost = gst_ghost_pad_new("ghostsrc", pad);
+	gst_object_unref(pad);
+	gst_element_add_pad(sendbin, ghost);
+
+	if (video_device != NULL && strcmp(video_device, ""))
+		g_object_set(G_OBJECT(src), "device", video_device, NULL);
+
+	return sendbin;
 }
 
 static GstElement *
 create_default_video_sink(void)
 {
-	GstElement *ret = NULL;
-	purple_media_video_init_recv(&ret);
-	return ret;
+	return gst_element_factory_make("autovideosink", NULL);
 }
 
 static GstElement *