Thijs Alkemade avatar Thijs Alkemade committed 89b3680

Updated the Adium source:

- Removed references to libgstfarsight
- Two pads were overreleased
- Turn logging to the log window back on for GLib errors
- Save the registery locally to Adium, so it can't get confused by other apps

Comments (0)

Files changed (2)

Plugins/Purple Service/SLPurpleCocoaAdapter.m

 	[[AIContactObserverManager sharedManager] delayListObjectNotifications];
 	
 	// Redirect every possible glib error message to AILog
-//	g_set_print_handler(adium_glib_print);
-//	g_set_printerr_handler(adium_glib_print);
+	g_set_print_handler(adium_glib_print);
+	g_set_printerr_handler(adium_glib_print);
 	
-//	for (NSString *domain in [NSArray arrayWithObjects:@"GLib", @"GModule", @"GLib-GObject", @"GThread", @"Gnt", @"GStreamer", @"stderr", nil]) {
-//		g_log_set_handler([domain UTF8String], G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, adium_glib_log, NULL);
-//	}
-//	
-//	g_log_set_handler(NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, adium_glib_log, NULL);
+	for (NSString *domain in [NSArray arrayWithObjects:@"GLib", @"GModule", @"GLib-GObject", @"GThread", @"Gnt", @"GStreamer", @"stderr", nil]) {
+		g_log_set_handler([domain UTF8String], G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, adium_glib_log, NULL);
+	}
+	
+	g_log_set_handler(NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, adium_glib_log, NULL);
 	
 	// Init the glib type system (used by GObjects)
 	g_type_init();
+	g_thread_init(NULL);
 	
 	// Don't fork!
 	gst_registry_fork_set_enabled (FALSE);
 				 [[[NSBundle bundleWithIdentifier:@"com.googlepages.openspecies.rtool.libgstreamer"] builtInPlugInsPath] fileSystemRepresentation],
 				 1);
 	
-	setenv("FS_PLUGIN_PATH", 
-		   [[[NSBundle bundleWithIdentifier:@"com.googlepages.openspecies.rtool.libgstfarsight"] builtInPlugInsPath] fileSystemRepresentation],
-		   1);
-	
-	printf("gstreamer plugins path: %s\n", [[[NSBundle bundleWithIdentifier:@"com.googlepages.openspecies.rtool.libgstreamer"] builtInPlugInsPath] fileSystemRepresentation]);
-	printf("farsight plugins path: %s\n", [[[NSBundle bundleWithIdentifier:@"com.googlepages.openspecies.rtool.libgstfarsight"] builtInPlugInsPath] fileSystemRepresentation]);
-	
+	printf("gstreamer plugins path: %s\n", [[[NSBundle bundleWithIdentifier:@"com.googlepages.openspecies.rtool.libgstreamer"] builtInPlugInsPath] fileSystemRepresentation]);	
 	
 	//Set gstreamer debug level
-	setenv("GST_DEBUG", "*:1", 1);
+	setenv("GST_DEBUG", "*:3", 1);
 	nice_debug_enable(true);
 	/* Don't let gstreamer load 'system path' plugins - if the user has gstreamer installed elsewhere,
 	 * or if this is a poor, confused developer who has built gstreamer locally, this will lead to very
 	 */
 	setenv("GST_PLUGIN_SYSTEM_PATH", " ", 1);
 	
+	setenv("GST_REGISTRY", [[[adium.loginController userDirectory] stringByAppendingPathComponent:@"gstreamer"] UTF8String], 1);
+	
 	GError *error = NULL;
 	if (!gst_init_check(NULL, NULL, &error)) {
 		NSLog(@"Failed to init GStreamer: %s", error ? error->message : "no error message.");

Plugins/Purple Service/adiumPurpleMedia.m

 		message = gst_bus_pop(source->bus);
 		
 		if(message != NULL) {
-			printf("adium_media_bus_event_cb: called to handle new message %s\n", gst_structure_get_name(message->structure));
-
-            gst_bus_async_signal_func(source->bus, message, NULL); // dispatch event to all objects hooked up to this kind of message
+			if (gst_structure_has_name(message->structure, "have-ns-view")) {
+				AILogWithSignature(@"adium_media_bus_event_cb: called to handle new message %s", gst_structure_get_name(message->structure));
+			} else {
+				gst_bus_async_signal_func(source->bus, message, NULL); // dispatch event to all objects hooked up to this kind of message
+			}
             
         }
 		
 	if(gst_bus_sync_signal_handler(bus, message, data) != GST_BUS_DROP) {
 			g_mutex_lock (bus->queue_lock);
 			g_queue_push_tail (bus->queue, message);
-			printf("posting message %s type %d thread %d main %d\n", gst_structure_get_name(message->structure), message->type, pthread_self(), source->m_thread_id);
+//			printf("posting message %s type %d thread %d main %d\n", gst_structure_get_name(message->structure), message->type, pthread_self(), source->m_thread_id);
 			// signal the source to fire
 	
 			g_mutex_unlock (bus->queue_lock);
 	GstPad *ghost;
 	GstCaps *caps;
 
-	src = gst_element_factory_make("qtkitvideosrc", NULL);
+	src = gst_element_factory_make("videotestsrc", NULL);
 	
 	NSString *deviceUID = [adium.preferenceController preferenceForKey:KEY_VIDEO_DEVICE_UID
 																 group:PREF_GROUP_MEDIA];
 	gst_element_link_many(src, autoconvert, videorate, NULL);
 
 	pad = gst_element_get_static_pad(videorate, "src");
-	ghost = gst_ghost_pad_new("ghostsrc", pad); 
-	gst_object_unref(pad);
+	ghost = gst_ghost_pad_new("ghostsrc", pad);
 	gst_element_add_pad(sendbin, ghost);
 
 	return sendbin;
 	gst_element_link_many(videoscale, sink, NULL);
 	pad = gst_element_get_static_pad(videoscale, "sink");
 	ghost = gst_ghost_pad_new("sink", pad);
-	gst_object_unref(pad);
 	gst_element_add_pad(bin, ghost);
 	
 	g_object_set (G_OBJECT (sink), "embed", true, NULL);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.