<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Re: 30 screenshot Per Second</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416192#M187209</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My previous remark/question was about Qt...&lt;/P&gt;&lt;P&gt;I am trying to perform my screenshots with libdrm now and trying to use a dumb buffer I get this:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;struct drm_mode_create_dumb dreq;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.height = 1080,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.width = 1920,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.bpp = 32,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.flags = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.handle = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.pitch = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.size = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;int ret = ioctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &amp;amp;dreq);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURNS:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Call to DRM_IOCTL_MODE_CREATE_DUMB failed: Function not implemented&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But that seems to be quite a common way to use that dumb buffer.&lt;/P&gt;&lt;P&gt;Is that a dead end for me trying to do screenshots with libdrm?&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 21:27:53 GMT</pubDate>
    <dc:creator>scalvi</dc:creator>
    <dc:date>2022-02-18T21:27:53Z</dc:date>
    <item>
      <title>30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413269#M186988</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Using an iMX8M quad core board, I need to take 30 screenshot per second.&lt;/P&gt;&lt;P&gt;So far I have looked into grim and slurp code but my Yocto build is Zeus and the Weston 9.0 Compositor does not allow the screenshot to be processed. I have then looked into the screenshooter.c code and I am able to take up to 8 screenshot per second by removing the file write (only the raw screenshot is needed for me). I am very new at working with Wayland protocol and before I used to do the same with a X11GetImage call (slightly modified to not re-allocate the memory all the time) but this is not doable with Wayland.&lt;/P&gt;&lt;P&gt;I am ready to try a solution with Qt QScreen::GrabWindow but I'm afraid this is going to be the same problem...&lt;/P&gt;&lt;P&gt;I'm thinking that it will be great to be able to address the compositor directly but my understanding of Wayland is that this is not made for such interaction.&lt;/P&gt;&lt;P&gt;Please help,&lt;/P&gt;&lt;P&gt;Any suggestion welcome!!!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 22:06:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413269#M186988</guid>
      <dc:creator>scalvi</dc:creator>
      <dc:date>2022-02-14T22:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413361#M186995</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194634"&gt;@scalvi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The screenshot client costs 0.17s to grab a frame.QT uses wayland as a backend, i think it could get same issue.But you should try QT, as the weston compositor can't capture so fast.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 08:54:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413361#M186995</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-02-15T08:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413801#M187026</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going to try Qt.&lt;/P&gt;&lt;P&gt;Also, I came accross libweston/backend-fbdev/fbdev.c, is that a Weston frame-buffer backend? If so, how to use it? Sorry but Wayland is totally new for me. Using a frame buffer might be the way to do that kind of quick screenshooting.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sebastien.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 15:12:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1413801#M187026</guid>
      <dc:creator>scalvi</dc:creator>
      <dc:date>2022-02-15T15:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1414006#M187041</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194634"&gt;@scalvi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.MX8M series can't support framebuffer.You can also try gnome shell in ubuntu desktop.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true" target="_blank"&gt;https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 01:45:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1414006#M187041</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-02-16T01:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1415716#M187167</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;Trying to do the screenshot with Qt5, I've made a small app, here is the function implementation that I connect to a ButtonReleased signal:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;QScreen *screen = QGuiApplication::primaryScreen();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;auto geom = screen-&amp;gt;geometry();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;QPixmap screenGrab = screen-&amp;gt;grabWindow(0, geom.x(), geom.y(), geom.width(), geom.height());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;screenGrab.save("screenshot.png");&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I compile and run the code for both platform my dev_laptop and the iMX8M board. On my laptop I can see a png file being created, all good. Exact same code on the imx board, I have the same window with my button but no png file created. "screenGrab" is NULL!&lt;/P&gt;&lt;P&gt;What am I missing? Isn't it the right way to get the "screen"? What's the difference? My dev_=Laptop has x11 for XDG_SESSION_TYPE while on the board echo $XDG_SESSION_TYPE returns "tty" (weird).&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sebastien.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 03:14:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1415716#M187167</guid>
      <dc:creator>scalvi</dc:creator>
      <dc:date>2022-02-18T03:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416192#M187209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My previous remark/question was about Qt...&lt;/P&gt;&lt;P&gt;I am trying to perform my screenshots with libdrm now and trying to use a dumb buffer I get this:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;struct drm_mode_create_dumb dreq;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.height = 1080,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.width = 1920,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.bpp = 32,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.flags = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.handle = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.pitch = 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dreq.size = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;int ret = ioctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &amp;amp;dreq);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURNS:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Call to DRM_IOCTL_MODE_CREATE_DUMB failed: Function not implemented&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But that seems to be quite a common way to use that dumb buffer.&lt;/P&gt;&lt;P&gt;Is that a dead end for me trying to do screenshots with libdrm?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 21:27:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416192#M187209</guid>
      <dc:creator>scalvi</dc:creator>
      <dc:date>2022-02-18T21:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416230#M187213</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194634"&gt;@scalvi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer this guide to debug your QT program :&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Remote-debug-QT5-User-Guide/ta-p/1391161" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Remote-debug-QT5-User-Guide/ta-p/1391161&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$XDG_SESSION_TYPE returns "tty" may caused by environment missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 01:12:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416230#M187213</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-02-19T01:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416233#M187214</link>
      <description>&lt;P&gt;dumb buffer is used to create a GPU memory for userspace write.It's not used to dumb current display buffer.&lt;/P&gt;
&lt;P&gt;Weston use opengl to read pixels(libweston/renderer-gl/gl-renderer.c):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;static int
gl_renderer_read_pixels(struct weston_output *output,
			pixman_format_code_t format, void *pixels,
			uint32_t x, uint32_t y,
			uint32_t width, uint32_t height)
{
	GLenum gl_format;
	struct gl_output_state *go = get_output_state(output);

	x += go-&amp;gt;borders[GL_RENDERER_BORDER_LEFT].width;
	y += go-&amp;gt;borders[GL_RENDERER_BORDER_BOTTOM].height;

	switch (format) {
	case PIXMAN_a8r8g8b8:
		gl_format = GL_BGRA_EXT;
		break;
	case PIXMAN_a8b8g8r8:
		gl_format = GL_RGBA;
		break;
	default:
		return -1;
	}

	if (use_output(output) &amp;lt; 0)
		return -1;

	glPixelStorei(GL_PACK_ALIGNMENT, 1);
	glReadPixels(x, y, width, height, gl_format,
		     GL_UNSIGNED_BYTE, pixels);

	return 0;
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 01:18:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1416233#M187214</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-02-19T01:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: 30 screenshot Per Second</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1417565#M187345</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;That part of the code is from the compositor, opengl needs to have a context created before doing glReadPixels or the call just returns all black buffer. Each time the limitation is that no matter what a client A can not access/read the buffer of client B and that's Wayland protocol specification anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know how to make these30 screenshot per second under wayland &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sebastien.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:05:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/30-screenshot-Per-Second/m-p/1417565#M187345</guid>
      <dc:creator>scalvi</dc:creator>
      <dc:date>2022-02-22T15:05:54Z</dc:date>
    </item>
  </channel>
</rss>

