GNOME Bugzilla – Bug 598390
Screencasting doesn't work.
Last modified: 2010-01-28 18:57:19 UTC
There are *many* blue frames and the frames aren't always fully rendered. Look at the attached screencast, where alt+tab dialog often misses some icons.
Created attachment 152035 [details] [review] Fix gnome-shell screen-casting feature This should get things back up and running.
Review of attachment 152035 [details] [review]: Good job tracking down this problem! I think there's a simpler and better approach to the fix, as noted below. ::: src/shell-recorder.c @@ -505,3 +501,3 @@ GST_BUFFER_TIMESTAMP(buffer) = get_wall_time() - recorder->start_time; - glReadBuffer (GL_BACK_LEFT); + cogl_read_pixels (0, 0, You don't want to use cogl_read_pixels because it has: g_return_if_fail (format == COGL_PIXEL_FORMAT_RGBA_8888); And that's a pretty bad format to use, since it doesn't match the native frame buffer either on big endian or little endian: big_endian: COGL_PIXEL_FORMAT_ARGB_8888_PRE little_endian: COGL_PIXEL_FORMAT_ARGB_8888_PRE (I filed http://bugzilla.openedhand.com/show_bug.cgi?id=1959 about this) I think the better approach here is to simply do the same thing that cogl_read_pixels() does at the start: /* make sure any batched primitives get emitted to the GL driver before * issuing our read pixels... */ cogl_flush (); That one line addition should fix the problem without the need for the further fixups you do below. @@ +963,3 @@ GstCaps *caps; + /* The data is always native-endian xRGB. */ Actually, as you changed it, the data was always big-endian RGBx @@ -975,3 @@ "bpp", G_TYPE_INT, 32, "depth", G_TYPE_INT, 24, -#if G_BYTE_ORDER == G_LITTLE_ENDIAN If we keep using glReadPixels() as before, then you don't want this change @@ -1034,3 +1018,3 @@ gst_bin_add (GST_BIN (pipeline->pipeline), ffmpegcolorspace); - /* glReadPixels gives us an upside-down buffer, so we have to flip it back + gst_element_link_many (pipeline->src, ffmpegcolorspace, NULL); If we keep using glReadPixels as before, we don't want this change. cogl_read_pixels() just flips the pixels itself internall,y though it has a TODO in it which applies to use as well: /* TODO: consider using the GL_MESA_pack_invert extension in the future * to avoid this flip... */
Created attachment 152397 [details] [review] ShellRecorder: Fix interaction of glReadPixels with Cogl The screen recording wasn't working because of two bad interactions with Cogl: - Buffered primitives weren't being flushed out - Cogl changes the pixel store values away from their default values Thanks for Jon Nettleton for tracking down the source of the problems with the recorder.
Attachment 152397 [details] pushed as 8db212d - ShellRecorder: Fix interaction of glReadPixels with Cogl