03-12-2012 02:28 PM
I have the following code. The screen_read_display function returned with error code 1 (EPERM),
which is "not by owner". Does anyone know what the problem is? Any help wil be greatly appreciated.
screen_context_t screen_ctx;
screen_display_t screen_disp;
screen_create_context(&screen_ctx, 0);
screen_pixmap_t screen_pix;
screen_create_pixmap(&screen_pix, screen_ctx);
screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_USAGE, &usage);
int format = SCREEN_FORMAT_RGB565;
int size[2] = {screen_width, screen_height};
screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_BUFFER_SIZE, size);
screen_buffer_t screen_pbuf;
screen_create_pixmap_buffer(screen_pix);
screen_get_pixmap_property_pv(screen_pix, SCREEN_PROPERTY_RENDER_BUFFERS, (void**)&screen_pbuf);
rc = screen_read_display( screen_disp, screen_pbuf, 0, NULL, 0 );
if (rc) {
fprintf(stderr, "screen_read_display failed errno %d\n", errno);
}
03-12-2012 02:33 PM
03-12-2012 02:35 PM
Thanks for the link. But if this is not supposed to work, why does the NDK documentation not mention this fact?
03-12-2012 02:40 PM
It probably shouldn't be published in the public NDK docs. The function is used internally by other OS services.
Cheers,
Sean