Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY: (7 Items)
   
gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
Hi All,

I am having problems with the gf_context_set_surface() call.

I create a surface on the main layer of my display with color format GF_FORMAT_PACK_YUV_UYVY -

_uint32 flag = GF_SURFACE_CREATE_CPU_LINEAR_ACCESSIBLE | GF_SURFACE_CREATE_CPU_FAST_ACCESS;

gf_surface_create(&surface_exp, gf_dev, width, height, GF_FORMAT_PACK_YUV_UYVY, NULL, flag)

The surface is created successfully.
But the subsequent call to gf_context_set_surface() fails with return value 7.

Also, if I create the surface with other color formats (GF_FORMAT_PACK_RGB565, GF_FORMAT_PACK_ARGB1555, GF_FORMAT_BGR888
, GF_FORMAT_BGRA8888), the call to gf_context_set_surface() works without any problem.

Could you please help me with this...?
Re: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
Error #7 -- GF_ERR_PARM -- The 2D engine can't render to the surface.
Why do you need a context with this surface?
Re: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
Hi Misha,

A correction. 
I am using the gf_surface_create_layer(&surface, &layer, 1, 0, width, height, GF_FORMAT_PACK_YUV_UYVY, NULL, flag)  call
; NOT gf_surface_create() as I earlier mentioned.

I am trying to implement the following steps -
1. Create surface_scratch using gf_surface_create() - 
2. Create surface_main on the main layer using gf_surface_create_layer()
3. Create a context and set it to surface_main using gf_context_set_surface()
4. Blit from the surface_scratch to the surface_main

I am having problems with gf_surface_create_layer() of step 3 with the color format GF_FORMAT_PACK_YUV_UYVY.
With the other color formats (already listed in earlier post) my application works fine, blitting is successful.

Regards
 


Re: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
I am having problems with gf_context_set_surface() of step 3 with the color format GF_FORMAT_PACK_YUV_UYVY.
RE: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
What platform/driver are you working with?

Thanks

-----Original Message-----
From: Nikshep Patil [mailto:community-noreply@qnx.com] 
Sent: May-16-11 1:37 PM
To: advanced-graphics
Subject: gf_context_set_surface(): Problem with color format
GF_FORMAT_PACK_YUV_UYVY

Hi All,

I am having problems with the gf_context_set_surface() call.

I create a surface on the main layer of my display with color format
GF_FORMAT_PACK_YUV_UYVY -

_uint32 flag = GF_SURFACE_CREATE_CPU_LINEAR_ACCESSIBLE |
GF_SURFACE_CREATE_CPU_FAST_ACCESS;

gf_surface_create(&surface_exp, gf_dev, width, height,
GF_FORMAT_PACK_YUV_UYVY, NULL, flag)

The surface is created successfully.
But the subsequent call to gf_context_set_surface() fails with return
value 7.

Also, if I create the surface with other color formats
(GF_FORMAT_PACK_RGB565, GF_FORMAT_PACK_ARGB1555, GF_FORMAT_BGR888,
GF_FORMAT_BGRA8888), the call to gf_context_set_surface() works without
any problem.

Could you please help me with this...?



_______________________________________________

Advanced Graphics
http://community.qnx.com/sf/go/post85722
Re: RE: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  
Hi Michael,

I am working with an internal driver.

Regards
RE: RE: gf_context_set_surface(): Problem with color format GF_FORMAT_PACK_YUV_UYVY  

GF does not support blitting to/from YUV surfaces so you will not be
able to set a context to this surface.    The other formats are all RGB
so they work.

If you need to transfer YUV data between surfaces you'll have to
manually copy this.    Alternately depending on your
application/use-case you could have multiple YUV surfaces and just
re-target the layer to point at the different surfaces.
(gf_layer_set_surfaces())




-----Original Message-----
From: Nikshep Patil [mailto:community-noreply@qnx.com] 
Sent: May 16, 2011 3:35 PM
To: advanced-graphics
Subject: Re: RE: gf_context_set_surface(): Problem with color format
GF_FORMAT_PACK_YUV_UYVY

Hi Michael,

I am working with an internal driver.

Regards



_______________________________________________

Advanced Graphics
http://community.qnx.com/sf/go/post85736