After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 598390 - Screencasting doesn't work.
Screencasting doesn't work.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-14 10:54 UTC by Steve Frécinaux
Modified: 2010-01-28 18:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix gnome-shell screen-casting feature (6.66 KB, patch)
2010-01-22 20:23 UTC, Jon Nettleton
needs-work Details | Review
ShellRecorder: Fix interaction of glReadPixels with Cogl (2.34 KB, patch)
2010-01-27 13:28 UTC, Owen Taylor
committed Details | Review

Description Steve Frécinaux 2009-10-14 10:54:31 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.
Comment 1 Jon Nettleton 2010-01-22 20:23:55 UTC
Created attachment 152035 [details] [review]
Fix gnome-shell screen-casting feature

This should get things back up and running.
Comment 2 Owen Taylor 2010-01-26 19:56:20 UTC
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... */
Comment 3 Owen Taylor 2010-01-27 13:28:20 UTC
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.
Comment 4 Owen Taylor 2010-01-28 18:57:16 UTC
Attachment 152397 [details] pushed as 8db212d - ShellRecorder: Fix interaction of glReadPixels with Cogl