[Spice-devel] jpeg and jpeg_alpha in spice
Shuxiang Lim
shohyanglim at gmail.com
Tue May 3 19:33:08 PDT 2011
Hi,Alon!
Thanks,but now I decide to abandon such drudgery try of forcing use JPEG
in spice-server because it's not a friendly reasonable way to spice. Now all
that I can do currently is just attempting to fasten the image traffic
between libspicec.so and Java UI,all the sins come from the android
framework and Java for there is no way to access directly the image buffer
in mem maintained by libspicec.so from Java. The only hope will be
file-mem-mapping between C and Java, but that will never give me any
surprise,I suppose.
Besides,another reason that enticed me to force use of JPEG is the
common/quic.c in client is damned buggy of SIGBUS on android/ARM on some ops
such as pointer typecasting.
That's common in my porting work,for example,in generated_demashaller.c,
this
*#define write_int8(ptr, val) *(int8_t *)(ptr) = val*
will cause SIGBUS on ARM, so I change it into
*#define write_int8(ptr,v) {int8_t val=v;memcpy(ptr,&val,sizeof(int8_t)); }
*
then it's safe, but seems ugly and clumsy.
So, is there any simple,elegant and safe way to do this?
Best regards.
On Tue, May 3, 2011 at 11:40 PM, Alon Levy <alevy at redhat.com> wrote:
> On Tue, May 03, 2011 at 11:48:59AM +0800, Shuxiang Lim wrote:
> > Hi,All!
>
> Hi Shuxiang,
>
> AFAIK you can't avoid non jpeg images because most (all?) rendering
> operations still happen
> on the client, so it can't or/xor/move with mask an 'almost' bitmap.
>
> But the person who wrote this code should be back on the list next week,
> so if you can
> wait until then you should get a better answer.
>
> Alon
>
> > I've found a problem that when
> > 1. using qxl,thus the image type will be SPICE_BITMAP_FMT_RGBA;
> > 2. and forcing the use of red_jpeg_compress_image ('cause I want to get
> only
> > JPEG in client) in spice server
> > then SPICE_IMAGE_TYPE_JPEG_ALPHA will be produced,but this will cause
> the
> > color disorder in the dest image in client.
> > Normally,spice will use quic_compress or lz_compress for
> > SPICE_BITMAP_FMT_RGBA, so SPICE_IMAGE_TYPE_JPEG_ALPHA will never be used,
> Am
> > I right? So why did we define SPICE_IMAGE_TYPE_JPEG_ALPHA? How can I
> produce
> > only NORMAL SPICE_IMAGE_TYPE_JPEG for SPICE_BITMAP_FMT_RGBA?
> > Best Regards.
>
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110504/6ae565a6/attachment.html>
More information about the Spice-devel
mailing list