Commit Graph

476 Commits

Author SHA1 Message Date
Frediano Ziglio
eff8b1a0e4 codegen: Do some checks on attributes
Verify that the attribute is known. This could help for instance to
avoid some future typo mistakes.
We also now have a list of attributes that we can comment for
documentation purpose.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:20:19 +02:00
Frediano Ziglio
179928fceb codegen: Reuse code to fix attribute from prototype file
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:47 +02:00
Frediano Ziglio
365866c4c9 codegen: Remove duplicate variable initialization
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:44 +02:00
Frediano Ziglio
0130e8dc39 codegen: Optimize code indentation and avoid a loop
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:18 +02:00
Frediano Ziglio
184feb541a codegen: Fix typo in variable name
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:16 +02:00
Frediano Ziglio
aa43c0d61e codegen: Simplify if/else blocks
Blocks were mainly the same, this reduces the amount of code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:03 +02:00
Frediano Ziglio
86b0568055 codegen: Import six module before first use
The module is used in the initial try/except so make sure it is
already imported.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:10:57 +02:00
Christophe Fergeau
f4c729aad3 codegen: Fix enums.h generation with python3
Trying to generate enums.h with python3 results in
Traceback (most recent call last):
  File "./spice_codegen.py", line 217, in <module>
    write_enums(writer, options.generate_dissector)
  File "./spice_codegen.py", line 99, in write_enums
    write_channel_enums(writer, c, False, False)
  File "./spice_codegen.py", line 17, in write_channel_enums
    if len(messages) == 0:
TypeError: object of type 'filter' has no len()

filter() returns an enumerator object in python3 while it used to return
a list in python2. Using list(filter()) instead fixes that error.
I've checked that the generated enums.h is identical with python2 and
python3.
2015-07-23 10:29:10 +02:00
Christophe Fergeau
5720971c45 proto: Remove space before tab
There are 3 lines in spice.proto/spice1.proto which start with spaces
and then contain a tab. This commit removes the spaces and only keep the
tab.
2015-07-20 20:55:47 +02:00
Christophe Fergeau
2d054e0e69 m4: Add compat AS_VAR_APPEND for older autoconf
This causes failures on EL6 otherwise as autoconf is too old there.
2015-07-02 17:02:21 +02:00
Lukas Venhoda
6183bbde24 ppc: Fix quic magic endianess
Runtime conversion from a string to uint32 is storing the magic with the same
endianness on both LE and BE machines. This requires aditional byte swap
when sending magic between LE/BE machines.

Changing quic magic to a constant will ensure, that it will be always stored in
native endianness, and the second byte swap won't be needed.
2015-07-02 13:31:28 +02:00
Lukas Venhoda
5a7e5876e6 ppc: Fix lz magic endianess
Commit d39dfbfe changes lz magic to be always treated as LE when encoded.

Runtime conversion from a string to uint32 is storing the magic with the same
endianness on both LE and BE machines. This requires aditional byte swap
when sending magic between LE/BE machines.

Changing lz magic to a constant will ensure, that it will be always stored in
native endianness, and the second byte swap won't be needed.

This commit reverts d39dfbfe changes in lz.c while keeping the rest.
They will be needed in future commit for quic.c
2015-07-02 13:31:28 +02:00
Lukas Venhoda
c04d4d55bc ppc: Fix quic decode endianess
Converts all decoded words in quic from little endian to local
machine endianness.
2015-07-02 13:31:28 +02:00
Christophe Fergeau
dcebede0ca Update spice-protocol
Christophe Fergeau (1):
      Post-release version bump

Javier Celaya (2):
      Update enums.h for preferred compression message
      Add a preferred compression capability
2015-06-22 20:04:21 +02:00
Javier Celaya
127a76a3b8 Proto: Add preferred compression message and constants.
When accessing a virtual desktop from different devices, some may have
different image compression requirements, e.g. slow devices may prefer
the faster LZ4 over GLZ. This message instructs the server to switch the
image compression algorithm. This patch also promotes the
SPICE_IMAGE_COMPRESS_* constants so that they are available from both
the server and the client.
2015-06-22 19:54:30 +02:00
Christophe Fergeau
1b5edbe49e m4: Add macro for --enable-lz4
It's not directly used by spice-common, but this way spice-gtk and
spice-server can share the same implementation.
2015-06-17 19:25:05 +02:00
Victor Toso
fec803156b Update spice-protocol submodule
This includes volume synchronization protocol;
2015-04-24 17:17:59 +02:00
Christophe Fergeau
b216f66f10 codegen: Use six.PY3 rather than six.PY2
Older versions of python-six (at least 1.3.0) defined six.PY3 but not
six.PY2. six.PY2 is only used twice in straightforward tests so it's
easy to use six.PY3 instead.
2015-04-14 16:08:43 +02:00
Christophe Fergeau
838ec7d87b configure.ac: Check for needed python modules for git builds
After the patch adding support for python 3 to the code generator,
python-six is required when building from git. Since I got 2 different
reports of SPICE build failures right after introducing it, it's
probably better to check for the needed python modules from configure,
and exit with an error if they are missing.
This commit adds a --enable-python-checks configure flag for that
though, since we only want to do that when building from git. It assumes
that people running from git will be running autogen.sh, while people
building from tarballs will run configure.
2015-04-13 13:08:11 +02:00
Erlon Cruz
c6e6dacb30 ppc: build-sys: Add big-endian support
A few files (the generated marshalling code and pixman-related utils)
make use of WORDS_BIGENDIAN in order to do the right thing depending on
endianness. configure.ac must call AC_C_BIGENDIAN for it to be defined.

Signed-off-by: Erlon R. Cruz <erlon.cruz@br.flextronics.com>
Signed-off-by: Rafael F. Santos <fonsecasantos.rafael@gmail.com>
Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@fit-tecnologia.org.br>
2015-04-10 20:20:49 +02:00
Erlon Cruz
d39dfbfef9 ppc: Fix lz magic endianness
Signed-off-by: Erlon R. Cruz <erlon.cruz@br.flextronics.com>
Signed-off-by: Rafael F. Santos <fonsecasantos.rafael@gmail.com>
Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@fit-tecnologia.org.br>
2015-04-10 20:20:49 +02:00
Alexander Wauck
ba52c4cae2 Make spice_codegen.py work on both Python 2 and 3
This is a new version of my previous patch that does not include six.py.
It's still kind of big, but at least it's all spice-common changes now.
There are also a few other fixes that Christophe brought to my attention.
Note that six now needs to be installed on the system (python-six on
Fedora and Debian, six on PyPI).

This *should* be enough to make spice_codegen.py work on both Python 2
and Python 3.  The major changes are as follows:

 * cStringIO.StringIO -> io.StringIO
 * str vs. unicode updates (io.StringIO doesn't like str)
 * integer division
 * foo.has_key(bar) -> bar in foo
 * import internal_thing -> from . import internal_thing
 * removed from __future__ import with_statement
   (might break Python 2.5?)
 * changed some lambdas to list comprehensions (done by 2to3)
 * cast some_dict.keys() to list where needed (e.g. for sorting)
 * use normal type names with isinstance instead of types.WhateverType

Signed-off-by: Alexander Wauck <awauck@codeweavers.com>
2015-04-01 13:39:03 +02:00
Christophe Fergeau
14218d7d6b ssl_verify: Move wincrypt.h related #ifdef closer to the include
Both wincrypt.h and openssl try to define X509_NAME. The wincrypt.h one
is not useful for us, so we currently #undef it if this was set.
However, it's done very late, right before including x509v3.h which
defines the X509_NAME type. Any header included in between may try to
 #include x509v3.h so it's better to undefine X509_NAME right after
including wincrypt.h.
2015-03-26 10:15:04 +01:00
Christophe Fergeau
edac1b36b5 Get rid of SW_CANVAS_IMAGE_CACHE
Every time it's used, it's in constructs similar to:

 #ifdef SW_CANVAS_CACHE
                             , SpiceImageCache *bits_cache
                             , SpicePaletteCache *palette_cache
 #elif defined(SW_CANVAS_IMAGE_CACHE)
                             , SpiceImageCache *bits_cache
 #endif

This can be rewritten as:

                             , SpiceImageCache *bits_cache
 #ifdef SW_CANVAS_CACHE
                             , SpicePaletteCache *palette_cache
 #endif

allowing to get rid of SW_CANVAS_IMAGE_CACHE.
2015-03-26 10:15:04 +01:00
Christophe Fergeau
d2ee99e15f Remove another redundant (SW_CANVAS_CACHE) || (SW_CANVAS_IMAGE_CACHE) #ifdef 2015-03-26 10:15:04 +01:00
Fabiano Fidêncio
37325b4e88 Fix typo in pixman_image_get_stride() function
pixman_image_surface_get_stride -> pixman_image_get_stride
2015-02-25 17:25:03 +01:00
Javier Celaya
3aad79d9c6 LZ4: Do not include arpa/inet.h in Windows builds 2015-02-03 13:28:54 +01:00
Javier Celaya
9287e53b6c LZ4: Add support for 24bit pixman surfaces 2015-02-03 10:46:34 +01:00
Javier Celaya
d167e2ead8 LZ4: Fix the row alignment when it is not on a 32bit boundary
Fix the row alignment for 16/24 bpp images when it is not in a 32bit
boundary. This is needed for 16bpp images when the width is an odd
number, and for the future support of 24bpp images.
2015-02-03 10:46:34 +01:00
Javier Celaya
f76fc28fc5 LZ4: Decode the image format from the stream 2015-02-03 10:43:31 +01:00
Javier Celaya
83c0d642ed LZ4: Adjust reading the top_down flag
Adjust the way the top_down flag is read to the corresponding change in
the wire protocol.
2015-02-03 10:43:31 +01:00
Javier Celaya
6049db492f LZ4: Fix output buffer size 2015-02-03 10:43:31 +01:00
Christophe Fergeau
ac26fd7acb Remove redundant #if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE)
SW_CANVAS_CACHE is always defined when building spice-gtk,
SW_CANVAS_IMAGE_CACHE is always defined when building spice-server, and
they are the only 2 users of spice-common. Moreover, build when none of
these is defined is broken.
2015-01-23 16:24:04 +01:00
Christophe Fergeau
062bf67442 Remove unused 'invers' arg from canvas_get_*
All canvas_get_{quic,jpeg,lz4,jpeg_alpha,lz} methods have an 'invers'
argument, but are always called with that argument being 0, so we can
drop it from the argument list, and remove the code triggerring when
it's true.
2015-01-23 16:24:03 +01:00
Victor Toso
619b99511d common: fix build with mingw 2015-01-06 18:02:50 +01:00
Christophe Fergeau
862b9b1a9e build-sys: Move pixman check to m4 macro 2014-12-09 16:40:25 +01:00
Christophe Fergeau
137b1a549e build-sys: Move opengl check to m4 macro 2014-12-09 16:40:25 +01:00
Christophe Fergeau
f9e0a644ae build-sys: Move opus check to m4 macro 2014-12-09 16:40:25 +01:00
Christophe Fergeau
dd57d05a52 build-sys: Move celt check to m4 macro 2014-12-09 16:40:25 +01:00
Christophe Fergeau
fb3fe2272c build-sys: Move smartcard check to m4 macro 2014-12-09 16:38:03 +01:00
Christophe Fergeau
df74a17238 build-sys: Move posix checks to a separate m4 macro 2014-12-09 16:37:21 +01:00
Christophe Fergeau
2f1ba3b77f build-sys: Add fallback for AS_VAR_APPEND
This macro is not available with RHEL6 autoconf.
2014-12-09 16:37:21 +01:00
Christophe Fergeau
2195369372 build-sys: Small cleanup of AM_CPPFLAGS
Commit 4fafa210 added WARN_CFLAGS, VISIBILITY_HIDDEN_CFLAGS and
-std=gnu99 to AM_CFLAGS in common/Makefile.am, but these are not
needed. WARN_CFLAGS and VISIBILITY_HIDDEN_CFLAGS are not defined
anywhere in spice-common, and spice-common compiles fine without
-std=gnu99 on my f21 box.
2014-12-09 16:37:18 +01:00
Christophe Fergeau
ed873a9eb5 build-sys: Remove unused WITH_SMARTCARD conditional 2014-12-08 18:26:39 +01:00
Christophe Fergeau
2da14b6cc8 build-sys: Remove unused win32 check 2014-12-08 18:24:59 +01:00
Christophe Fergeau
5bfa9cadb3 build-sys: Remove unused X check
AC_PATH_X sets a bunch of variables (x_includes, x_libraries, no_x)
after finding/not finding X. Since none of them are used afterwards,
having this check is not useful.
2014-12-08 18:24:59 +01:00
Christophe Fergeau
268d3e3d2f Remove unused header file
Nothing uses the definition it contains (I've tested spice-gtk and
spice)
2014-12-04 16:34:56 +01:00
Javier Celaya
5b3cdad921 Add LZ4 image compression support.
- Add a new LZ4 image type to spice.proto.
- Add canvas_get_lz4() to common_canvas_base, to get a pixmap from an
  lz4 image.
- Add an enable-lz4 switch to the configure script, disabled by default.
2014-12-02 19:23:53 +01:00
Christophe Fergeau
8639bbdc9d glc: Fix "warning: unused variable 'recreate'" 2014-11-24 11:24:49 +01:00
天外银龙
a74209a9c3 gdi: fix path segments drawing
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=64698
2014-11-10 11:38:22 +01:00