pidgin.vv: 0fb11a64: Remove purple_media_video_init_* functio...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sun Mar 22 23:01:11 EDT 2009


-----------------------------------------------------------------
Revision: 0fb11a64f5428005aa0b28a533dab6f5c4cd1010
Ancestor: 558eb2b776e57c69d0030818b2906d6f5798ace9
Author: maiku at soc.pidgin.im
Date: 2009-03-22T22:49:10
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/0fb11a64f5428005aa0b28a533dab6f5c4cd1010

Modified files:
        libpurple/media.c libpurple/media.h pidgin/gtkmedia.c

ChangeLog: 

Remove purple_media_video_init_* functions.

-------------- next part --------------
============================================================
--- libpurple/media.c	738b091574b0ba33c21eb1167a6f5056a625655e
+++ libpurple/media.c	7d3416b503ee16b47ab07596670fb37554254959
@@ -1429,47 +1429,6 @@ void
 }
 
 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 @@ purple_media_audio_init_recv(GstElement 
 	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,
============================================================
--- libpurple/media.h	7baf8e7aa7f7a031684c64da0a8f99b0e8d4776f
+++ libpurple/media.h	3701e3f0e47c9453195690814e065f68b3f9f316
@@ -436,13 +436,6 @@ void purple_media_audio_init_src(GstElem
                                  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(GstEle
 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
============================================================
--- pidgin/gtkmedia.c	dc8edcf90f7243ca058f686dca01b82d78eced4b
+++ pidgin/gtkmedia.c	67d68bf8ccc42fc62a61444ad8b3967462016c0e
@@ -836,17 +836,49 @@ create_default_video_src(void)
 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 *


More information about the Commits mailing list