Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - PgGetLayerCaps(): querying layer capabilities problem: (8 Items)
   
PgGetLayerCaps(): querying layer capabilities problem  
When PgGetLayerCaps() is called to enumerate all layers and all layer's formats, the field format of the PgLayerCaps_t 
structure always contains an invalid values:

Layer 0
   Format: Unknown layer format: 0x00000020
Layer 1
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000022
Layer 2
   Format: Unknown layer format: 0x00000020
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000026
   Format: Unknown layer format: 0x00000010
Layer 3
   Format: Unknown layer format: 0x00000020
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000026
   Format: Unknown layer format: 0x00000010

But must be:

Layer 0
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
Layer 1
   Format: Pg_LAYER_FORMAT_YUY2 (0x00010000)
   Format: Pg_LAYER_FORMAT_YVYU (0x00010002)
   Format: Pg_LAYER_FORMAT_UYVY (0x00010001)
Layer 2
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
   Format: Pg_LAYER_FORMAT_RGB565 (0x00000002)
   Format: Pg_LAYER_FORMAT_ARGB1555 (0x00000001)
   Format: Pg_LAYER_FORMAT_PAL8 (0x00000000)
Layer 3
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
   Format: Pg_LAYER_FORMAT_RGB565 (0x00000002)
   Format: Pg_LAYER_FORMAT_ARGB1555 (0x00000001)
   Format: Pg_LAYER_FORMAT_PAL8 (0x00000000)

According to http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/services/graphics/services.c?revision=1&root=
graphics&system=exsy1001&view=markup line 1335:

1335        if (gf_ph_layer_format(info.format,
1336 	    &rdata.get_layer_caps_reply.caps.format,
1337 	    &rdata.get_layer_caps_reply.caps.format_flags) == -1) {
1338 	    ret_code = ESRCH;
1339 	    break;
1340 	} 

There is a field format_flags in the PgLayerCaps_t structure, which is a part of reply message. But PgLayerCaps_t 
doesn't have such field, so I think that's why data in the structure has been displaced, and I obtain strange values 
instead of the layer format code.
RE: PgGetLayerCaps(): querying layer capabilities problem  
what version, 641?  I think I fixed this recently.

-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com] 
Sent: Friday, November 27, 2009 12:30 AM
To: photon-graphics
Subject: PgGetLayerCaps(): querying layer capabilities problem

When PgGetLayerCaps() is called to enumerate all layers and all layer's
formats, the field format of the PgLayerCaps_t structure always contains
an invalid values:

Layer 0
   Format: Unknown layer format: 0x00000020
Layer 1
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000022
Layer 2
   Format: Unknown layer format: 0x00000020
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000026
   Format: Unknown layer format: 0x00000010
Layer 3
   Format: Unknown layer format: 0x00000020
   Format: Unknown layer format: 0x00000022
   Format: Unknown layer format: 0x00000026
   Format: Unknown layer format: 0x00000010

But must be:

Layer 0
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
Layer 1
   Format: Pg_LAYER_FORMAT_YUY2 (0x00010000)
   Format: Pg_LAYER_FORMAT_YVYU (0x00010002)
   Format: Pg_LAYER_FORMAT_UYVY (0x00010001)
Layer 2
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
   Format: Pg_LAYER_FORMAT_RGB565 (0x00000002)
   Format: Pg_LAYER_FORMAT_ARGB1555 (0x00000001)
   Format: Pg_LAYER_FORMAT_PAL8 (0x00000000)
Layer 3
   Format: Pg_LAYER_FORMAT_ARGB8888 (0x00000004)
   Format: Pg_LAYER_FORMAT_RGB565 (0x00000002)
   Format: Pg_LAYER_FORMAT_ARGB1555 (0x00000001)
   Format: Pg_LAYER_FORMAT_PAL8 (0x00000000)

According to
http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/services/gr
aphics/services.c?revision=1&root=graphics&system=exsy1001&view=markup
line 1335:

1335        if (gf_ph_layer_format(info.format,
1336 	    &rdata.get_layer_caps_reply.caps.format,
1337 	    &rdata.get_layer_caps_reply.caps.format_flags) == -1) {
1338 	    ret_code = ESRCH;
1339 	    break;
1340 	} 

There is a field format_flags in the PgLayerCaps_t structure, which is a
part of reply message. But PgLayerCaps_t doesn't have such field, so I
think that's why data in the structure has been displaced, and I obtain
strange values instead of the layer format code.




_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post42714
Re: RE: PgGetLayerCaps(): querying layer capabilities problem  
Yes, 6.4.1.
RE: RE: PgGetLayerCaps(): querying layer capabilities problem  
Revision 224049 - (view) (download) (annotate) - [select for diffs] 
Modified Mon Jun 22 16:15:26 2009 UTC (5 months ago) by dleach 
File length: 52681 byte(s) 
Diff to previous 220622 
New convert routine gf_ph_layer_format() to provide
correct Pg_LAYER_FORMAT_XXXX format to PgGetLayerCaps().
Also fills in new format_flags member with 16-bit packing
or 32-bit byte-order depending on the layer format.

PR:69322
CI:ckeating



Line 1323 of services/graphics/services.c calls a new routine:

if (gf_ph_layer_format(info.format,
&rdata.get_layer_caps_reply.caps.format, 
&rdata.get_layer_caps_reply.caps.format_flags) == -1) { 
     ret_code = ESRCH; 
     break; 
}

New routine is:

int
gf_ph_layer_format(gf_format_t f, unsigned int * format, unsigned long *
format_flags) {
	uint32_t ret = 0;

	switch (f) {
		case GF_FORMAT_PAL8:
			(*format) = Pg_LAYER_FORMAT_PAL8;
			break;

		case GF_FORMAT_PKLE_ARGB1555:
		case GF_FORMAT_PKBE_ARGB1555:
		case GF_FORMAT_PACK_ARGB1555:
			(*format) = Pg_LAYER_FORMAT_ARGB1555;
			break;

		case GF_FORMAT_PKLE_RGB565:
		case GF_FORMAT_PKBE_RGB565:
		case GF_FORMAT_PACK_RGB565:
			(*format) = Pg_LAYER_FORMAT_RGB565;
			break;

		case GF_FORMAT_BGR888:
			(*format) = Pg_LAYER_FORMAT_RGB888;
			break;

		case GF_FORMAT_BGRA8888:
		case GF_FORMAT_ARGB8888:
			(*format) = Pg_LAYER_FORMAT_ARGB8888;
			break;

		case GF_FORMAT_PKLE_YUV_UYVY:
		case GF_FORMAT_PKBE_YUV_UYVY:
		case GF_FORMAT_PACK_YUV_UYVY:
			(*format) = Pg_LAYER_FORMAT_UYVY;
			break;

		case GF_FORMAT_PKLE_YUV_YUY2:
		case GF_FORMAT_PKBE_YUV_YUY2:
		case GF_FORMAT_PACK_YUV_YUY2:
			(*format) = Pg_LAYER_FORMAT_YUY2;
			break;

		case GF_FORMAT_PKLE_YUV_YVYU:
		case GF_FORMAT_PKBE_YUV_YVYU:
		case GF_FORMAT_PACK_YUV_YVYU:
			(*format) = Pg_LAYER_FORMAT_YVYU;
			break;

		case GF_FORMAT_PKLE_YUV_V422:
		case GF_FORMAT_PKBE_YUV_V422:
		case GF_FORMAT_PACK_YUV_V422:
			(*format) = Pg_LAYER_FORMAT_V422;
			break;

		case GF_FORMAT_PACK_YUV_NV12:
			(*format) = Pg_LAYER_FORMAT_YUV_NV12;
			break;

		case GF_FORMAT_PACK_YUV_AYUV:
			(*format) = Pg_LAYER_FORMAT_YUV_AYUV;
			break;

		case GF_FORMAT_PLANAR_YUV_YVU9:
			(*format) = Pg_LAYER_FORMAT_YVU9;
			break;

		case GF_FORMAT_PLANAR_YUV_YV12:
			(*format) = Pg_LAYER_FORMAT_YV12;
			break;

		case GF_FORMAT_PLANAR_YUV_420:
			(*format) = Pg_LAYER_FORMAT_YUV420;
			break;

		default:
			ret = -1;
			break;
	}

	if (ret == 0) {
		if (f & GF_FORMAT_PACK)
			(*format_flags) = Pg_LAYER_FORMAT_PACK;
		else if (f & GF_FORMAT_PKLE)
			(*format_flags) = Pg_LAYER_FORMAT_PKLE;
		else if (f & GF_FORMAT_PKBE)
			(*format_flags) = Pg_LAYER_FORMAT_PKBE;
		else if (f & GF_FORMAT_BO_BGRA)
			(*format_flags) = Pg_LAYER_FORMAT_BO_BGRA;
		else if (f & GF_FORMAT_BO_ARGB)
			(*format_flags) = Pg_LAYER_FORMAT_BO_ARGB;
		else
			(*format_flags) = 0;
	}

	return ret;
}


-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com] 
Sent: Friday, November 27, 2009 9:05 AM
To: photon-graphics
Subject: Re: RE: PgGetLayerCaps(): querying layer capabilities problem

Yes, 6.4.1.




_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post42729
Re: RE: RE: PgGetLayerCaps(): querying layer capabilities problem  
> Revision 224049 - (view) (download) (annotate) - [select for diffs] 
> Modified Mon Jun 22 16:15:26 2009 UTC (5 months ago) by dleach 
> File length: 52681 byte(s) 
> Diff to previous 220622 
> New convert routine gf_ph_layer_format() to provide
> correct Pg_LAYER_FORMAT_XXXX format to PgGetLayerCaps().
> Also fills in new format_flags member with 16-bit packing
> or 32-bit byte-order depending on the layer format.

Ah, ok :) But public Photon headers are not updated, as far as I can see.
RE: RE: RE: PgGetLayerCaps(): querying layer capabilities problem  
really?  they should be every evening, maybe not the svn logs, but check
line 1323 on the foundry trunk ... in services.c

-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com] 
Sent: Friday, November 27, 2009 9:20 AM
To: photon-graphics
Subject: Re: RE: RE: PgGetLayerCaps(): querying layer capabilities
problem

> Revision 224049 - (view) (download) (annotate) - [select for diffs] 
> Modified Mon Jun 22 16:15:26 2009 UTC (5 months ago) by dleach 
> File length: 52681 byte(s) 
> Diff to previous 220622 
> New convert routine gf_ph_layer_format() to provide
> correct Pg_LAYER_FORMAT_XXXX format to PgGetLayerCaps().
> Also fills in new format_flags member with 16-bit packing
> or 32-bit byte-order depending on the layer format.

Ah, ok :) But public Photon headers are not updated, as far as I can
see.




_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post42732
Re: RE: RE: RE: PgGetLayerCaps(): querying layer capabilities problem  
> really?  they should be every evening, maybe not the svn logs, but check
> line 1323 on the foundry trunk ... in services.c

Sorry, my fault. I've messed up 6.4.1 headers with the local copy of svn repository :) Now I've updated svn repository 
and all looks fine.
RE: RE: RE: RE: PgGetLayerCaps(): querying layer capabilities problem  
Good :)

-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com] 
Sent: Friday, November 27, 2009 1:02 PM
To: photon-graphics
Subject: Re: RE: RE: RE: PgGetLayerCaps(): querying layer capabilities
problem

> really?  they should be every evening, maybe not the svn logs, but
check
> line 1323 on the foundry trunk ... in services.c

Sorry, my fault. I've messed up 6.4.1 headers with the local copy of svn
repository :) Now I've updated svn repository and all looks fine.




_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post42779