Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Not owner error returned by screen_read_display

 

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);

 

}

 

Sucroid.com
Sweet Apps for the Fans
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Not owner error returned by screen_read_display

Please use plain text.
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Re: Not owner error returned by screen_read_display

Thanks for the link.  But if this is not supposed to work, why does the NDK documentation not mention this fact?

Sucroid.com
Sweet Apps for the Fans
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Not owner error returned by screen_read_display

It probably shouldn't be published in the public NDK docs.  The function is used internally by other OS services.

 

Cheers,

Sean

Please use plain text.