summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-12-16codegen: Use context manager when opening filesHEADmasterChris Mayo1-6/+4
Signed-off-by: Chris Mayo <aklhfex@gmail.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16Stop using Python six packageChris Mayo6-24/+13
Signed-off-by: Chris Mayo <aklhfex@gmail.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16Drop Python 2 from m4/spice-deps.m4Chris Mayo1-5/+0
Signed-off-by: Chris Mayo <aklhfex@gmail.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-11-05build: Avoid Meson warningFrediano Ziglio1-1/+1
Avoids: WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2023-10-17common: Add a udev helper to identify GPU VendorVivek Kasireddy8-0/+137
Given that libudev is widely available on many Linux distros, we can use the relevant APIs to iterate over all the devices associated with the drm subsystem to figure out if a specific vendor GPU is available or not. This capability (identifying GPU Vendor) is useful to determine whether to launch Gstreamer pipeline using h/w accelerated plugins. On systems where libudev is not available (Windows, MacOS, etc) we'd have to make this determination based on the availability of the relevant plugins in the Gstreamer registry. Cc: Frediano Ziglio <freddy77@gmail.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Dongwon Kim <dongwon.kim@intel.com> Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com> Cc: Jin Chung Teng <jin.chung.teng@intel.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-29Replace EVP_PKEY_cmp with EVP_PKEY_eqFrediano Ziglio1-0/+4
EVP_PKEY_cmp was made obsolete in OpenSSL. The main reason is that the return value is not coherent with other *_cmp functions. So it was replaced by EVP_PKEY_eq, which does the same. Rename to avoid a deprecation warning on newer OpenSSL releases. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-01-27ci: Set WINEPATH during Windows buildFrediano Ziglio1-0/+1
Without it on Fedora 35 Wine is not able to find DLLs installed on the system. This will cause failures executing tests but this also helps in case there are tests during the configuration phase. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-10-28build: Correctly check for Python modulesFrediano Ziglio1-1/+1
Currently using Meson the command "python -m <MODULE_NAME>" is run. However this command instead of trying to import the module tried to execute it as a script failing for the updated pyparsing with: /usr/bin/python3: No module named pyparsing.__main__; 'pyparsing' is a package and cannot be directly executed So instead use "python -c 'import <MODULE_NAME>". Autoconf is already using that command (see m4/ax_python_module.m4). Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-08-16Find Python3 installation correctly on MacOSFrediano Ziglio1-1/+1
This fixes partially https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/144. Meson requires Python3 so you should be able to detect python3. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-06-14build: Update Meson requirement to 0.49Frediano Ziglio1-1/+1
This avoids this warning: WARNING: Project targeting '>= 0.48.0' but tried to use feature introduced in '0.49.0': / with string arguments. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-05-24codegen: Make input structures for marshaller constantFrediano Ziglio1-11/+12
Add const specifier to passed structure. Make code a bit more "safe" as compiler can check if code is trying to change some passed data. Also allows to declare data passed as constant. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-05-18meson: Generate missing intermediate targetFrediano Ziglio1-1/+2
Tell build system how to generate the intermediate file generated_test_messages.h. Otherwise if removed the build will then fail. This is also probably the reason some build intermittently fail. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-05-07canvas_base: Fix missing ntohl for Win32 platformFrediano Ziglio1-5/+2
Win32 requires winsock2.h to be included in order to use ntohl. To avoid the include use GUINT32_FROM_BE instead, already available. This problem was reported by Biswapriyo Nath whom also tested the solution for Win32. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-14Fix make distcheckFrediano Ziglio1-0/+1
We need to package generated_test_messages.h file Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-13Fix build as meson subprojectMarc-André Lureau1-1/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-04-13Fix invalid vdagent buffer accessMarc-André Lureau1-6/+6
The caller use the "size" argument in different ways. Either the size of the data to convert, or the end boundary to be deduced by offset. Fix it so the the "size" argument means the amount in bytes of data to convert, that seems simpler and saner. (yay C) Fixes: spice#53 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-04-08Add missing include file string.hStefan Weil1-0/+1
It is required for strcmp. This fixes a compiler warning for mingw-w64. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-02-22helper-fuzzer-demarshallers: Check also test demarshallersFrediano Ziglio4-23/+68
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22codegen: Handle zero_terminated attribute in demashallerFrediano Ziglio7-4/+91
Make sure the output array is zero terminated to simplify code using the output structures. Changed in generated code: diff -ru gen/generated_client_demarshallers.c common/generated_client_demarshallers.c --- gen/generated_client_demarshallers.c 2021-02-21 15:13:42.004307087 +0000 +++ common/generated_client_demarshallers.c 2021-02-21 15:13:58.916513426 +0000 @@ -565,15 +565,24 @@ return NULL; } -static uint8_t * parse_array_uint8(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info) +static uint8_t * parse_array_uint8_terminated(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info) { uint8_t *in = message_start + this_ptr_info->offset; uint8_t *end; end = struct_data; memcpy(end, in, this_ptr_info->nelements); +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + ((char *) (end))[this_ptr_info->nelements] = 0; +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif in += this_ptr_info->nelements; end += this_ptr_info->nelements; + end += 1; return end; } @@ -622,7 +631,8 @@ dst_info_host_data__array__nelements = host_size__value; dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements; - dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements; + dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t); + dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4); if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) { goto error; } @@ -650,7 +660,8 @@ dst_info_cert_subject_data__array__nelements = cert_subject_size__value; dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements; - dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements; + dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t); + dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4); if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) { goto error; } @@ -685,14 +696,14 @@ out->dst_info.sport = consume_uint16(&in); out->dst_info.host_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data; host_data__array__nelements = out->dst_info.host_size; ptr_info[n_ptr].nelements = host_data__array__nelements; n_ptr++; out->dst_info.cert_subject_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data; cert_subject_data__array__nelements = out->dst_info.cert_subject_size; ptr_info[n_ptr].nelements = cert_subject_data__array__nelements; @@ -1050,7 +1061,8 @@ host_data__array__nelements = host_size__value; host_data__array__nw_size = host_data__array__nelements; - host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements; + host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements + sizeof(uint8_t); + host_data__array__mem_size = SPICE_ALIGN(host_data__array__mem_size, 4); if (SPICE_UNLIKELY(host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) { goto error; } @@ -1078,7 +1090,8 @@ cert_subject_data__array__nelements = cert_subject_size__value; cert_subject_data__array__nw_size = cert_subject_data__array__nelements; - cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements; + cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements + sizeof(uint8_t); + cert_subject_data__array__mem_size = SPICE_ALIGN(cert_subject_data__array__mem_size, 4); if (SPICE_UNLIKELY(cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) { goto error; } @@ -1107,13 +1120,13 @@ out->sport = consume_uint16(&in); out->host_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->host_data; ptr_info[n_ptr].nelements = host_data__array__nelements; n_ptr++; out->cert_subject_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->cert_subject_data; ptr_info[n_ptr].nelements = cert_subject_data__array__nelements; n_ptr++; @@ -1338,7 +1351,8 @@ dst_info_host_data__array__nelements = host_size__value; dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements; - dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements; + dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t); + dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4); if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) { goto error; } @@ -1366,7 +1380,8 @@ dst_info_cert_subject_data__array__nelements = cert_subject_size__value; dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements; - dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements; + dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t); + dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4); if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) { goto error; } @@ -1401,14 +1416,14 @@ out->dst_info.sport = consume_uint16(&in); out->dst_info.host_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data; host_data__array__nelements = out->dst_info.host_size; ptr_info[n_ptr].nelements = host_data__array__nelements; n_ptr++; out->dst_info.cert_subject_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data; cert_subject_data__array__nelements = out->dst_info.cert_subject_size; ptr_info[n_ptr].nelements = cert_subject_data__array__nelements; @@ -7582,7 +7597,8 @@ name__array__nelements = name_size__value; name__array__nw_size = name__array__nelements; - name__array__mem_size = sizeof(uint8_t) * name__array__nelements; + name__array__mem_size = sizeof(uint8_t) * name__array__nelements + sizeof(uint8_t); + name__array__mem_size = SPICE_ALIGN(name__array__mem_size, 4); if (SPICE_UNLIKELY(name__array__nw_size > (uintptr_t) (message_end - message_start - name__value))) { goto error; } @@ -7609,7 +7625,7 @@ out->name_size = consume_uint32(&in); ptr_info[n_ptr].offset = consume_uint32(&in); - ptr_info[n_ptr].parse = parse_array_uint8; + ptr_info[n_ptr].parse = parse_array_uint8_terminated; ptr_info[n_ptr].dest = (void **)&out->name; ptr_info[n_ptr].nelements = name__array__nelements; n_ptr++; Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22codegen: Propagate zero_terminated attributeFrediano Ziglio1-1/+1
Currently the attribute is not used. However we would like to make sure when present that the array is always zero terminated to simplify usages after demarshalling. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22codegen: Propagate attributes to element under pointersFrediano Ziglio1-0/+2
Current propagated attributes are propagated only from member to member type. But for pointers you probably want to use propagated attribus to underlying type (like an array for instance). Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22codegen: Add a check to array typeFrediano Ziglio1-0/+10
If the size is not constant the array has to be allocated in some way in the output and so there must be a specification for the output (as default is write into the C structure all data). The only exceptions are when the length is constant (in this case a constant length array in the C structure is used) or a pointer (in this case the pointer allocate the array). Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22codegen: Make "output_attrs" variable globalFrediano Ziglio1-3/+12
Allows to reuse it. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Victor Toso <victortoso@redhat.com>
2020-10-06codegen: Remove bytes array length supportFrediano Ziglio5-61/+6
This syntax was only used in protocol 1 which has been removed time ago. Beside not being used it's confusing and prone to errors, array size is specified using 2 identifiers, one reporting bytes and the other number of items, one used for marshalling, the other for demarshalling. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-09-17test-quic: Add test cases for quic fuzzerFrediano Ziglio4-0/+0
To use for start for the fuzzer. Tests have been generated with a patch like: diff --git a/tests/test-quic.c b/tests/test-quic.c --- a/tests/test-quic.c +++ b/tests/test-quic.c @@ -372,8 +372,8 @@ static void pixbuf_compare(GdkPixbuf *pixbuf_a, GdkPixbuf *pixbuf_b) static GdkPixbuf *pixbuf_new_random(int alpha) { gboolean has_alpha = alpha >= 0 ? alpha : g_random_boolean(); - gint width = g_random_int_range(100, 2000); - gint height = g_random_int_range(100, 500); + gint width = g_random_int_range(10, 100); + gint height = g_random_int_range(10, 100); GdkPixbuf *random_pixbuf; guint i, size; guint8 *pixels; @@ -401,6 +401,12 @@ static void test_pixbuf(GdkPixbuf *pixbuf) compressed_data = quic_encode_from_pixbuf(pixbuf, imgbuf); uncompressed_pixbuf = quic_decode_to_pixbuf(compressed_data); + { + static int num = 0; + char fn[256]; + sprintf(fn, "test%d.quic", ++num); + g_assert(g_file_set_contents(fn, (void *) compressed_data->data, compressed_data->len, NULL)); + } image_buf_free(imgbuf, uncompressed_pixbuf); //g_assert(memcmp(gdk_pixbuf_get_pixels(pixbuf), gdk_pixbuf_get_pixels(uncompressed_pixbuf), gdk_pixbuf_get_byte_length(uncompressed_pixbuf))); Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17test-quic: Add fuzzer capabilities to the testFrediano Ziglio1-1/+50
Allows it to be used for fuzzying compressed images. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17quic: Avoid possible buffer overflow in find_bucketFrediano Ziglio1-1/+6
Proved by fuzzing the code. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17quic: Check RLE lengthsFrediano Ziglio1-1/+5
Avoid buffer overflows decoding images. On compression we compute lengths till end of line so it won't cause regressions. Proved by fuzzing the code. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17quic: Check image size in quic_decode_beginFrediano Ziglio1-0/+13
Avoid some overflow in code due to images too big or negative numbers. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17quic: Check we have some data to start decoding quic imageFrediano Ziglio1-1/+1
All paths already pass some data to quic_decode_begin but for the test check it, it's not that expensive test. Checking for not 0 is enough, all other words will potentially be read calling more_io_words but we need one to avoid a potential initial buffer overflow or deferencing an invalid pointer. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17agent: fix vdagent monitor flag filteringMarc-André Lureau1-2/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-09-15agent: Extend agent_check_message to support VDAgentMonitorsConfig extensionFrediano Ziglio1-10/+28
Add support for VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE flag. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2020-09-04quic: Fix typo in commentFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-08-31quic: Constify a parameterFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-08-31proto: Add support for side mouse buttonsFrediano Ziglio1-1/+7
This is the couterpart of spice-protocol commit commit cbe7b2c28543f4c5e57d1db1b753b73a64104162 (HEAD -> master, origin/master, origin/HEAD) Author: SimonP <simonp.git@gmail.com> protocol: Add support for side mouse buttons Side mouse buttons currently do not exist in the protocol, causing them to be inexplicably ignored by VMs in virt-manager and such. This lays the groundwork for fixing that issue. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-08-27ssl_verify: Do not check IP if we fail to resolve itFrediano Ziglio1-11/+10
There's no point on checking an empty IP address, an IP address is never empty. This also solve some compiler warnings trying to possibly pass a NULL pointer to memcmp or setting a variable without reading it. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-08-25quic_tmpl: Remove unused bpc parameterFrediano Ziglio1-16/+8
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10helper-fuzzer-demarshallers: Provide replacement for ftello for MSVCFrediano Ziglio1-0/+5
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10Avoid usage of GCC extension for __VA_ARGS__ where possibleFrediano Ziglio5-28/+28
The "##" before __VA_ARGS__ is a GCC extension. Try to limit its usage where necessary. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10backtrace: Do not attempt to compile if spice_backtrace is emptyFrediano Ziglio1-0/+3
In backtrace.h spice_backtrace is defined as: #if defined(WIN32) && !defined(__MINGW32__) #define spice_backtrace() #else .. so don't try to compile if an empty macro is used. Currently not causing any issue as we use MingW on Windows but does not hurt is code is more portable. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-07-11marshal: fix clang "missing field initializer" warning on generated filesHaochen Tong1-1/+1
Signed-off-by: Haochen Tong <i@hexchain.org> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-11pixman_utils: fix clang "unused functions" warningHaochen Tong1-20/+19
Signed-off-by: Haochen Tong <i@hexchain.org> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-07snd_codec: Use better type for snd_codec_create modeFrediano Ziglio2-4/+7
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-07snd_codec: Use better type for function resultFrediano Ziglio2-19/+27
Instead of just plain preprocessor macros use an enum. This is more type safe and could produce better debugging type information. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-07snd_codec: Use better types for snd_codec_is_capableFrediano Ziglio2-6/+9
mode should be an enumeration value of SpiceAudioDataMode. Return type is just a boolean. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-03build: Remove -Werror from Meson buildFrediano Ziglio1-1/+0
In Meson better to use --werror option instead to manually add to options. Also this prevents build if spice-protocol deprecate some stuff or fails the build if any warning occur. This fixes an issue for https://gitlab.freedesktop.org/spice/spice/-/issues/44. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Julien Ropé <jrope@gmail.com>
2020-06-25rect: Avoid usage of "small"Frediano Ziglio1-5/+5
Some Windows headers define "small" causing issues. Use "small_rect" instead. For coherence use "big_rect" instead of "big". Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-06-19Reuse macros from spice-protocolFrediano Ziglio4-24/+14
Reuse SPICE_GNUC_NORETURN and SPICE_GNUC_PRINTF Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Julien Ropé <jrope@gmail.com>
2020-05-23test-quic: Different "more_space" function for decode and encodeFrediano Ziglio1-5/+13
The "more_space" callback is used in both decode and encode path to provide either more space to read or more space to write. The current implementation was dealing only to provide more space to write (that is encoding) crashing in case it was used for decoding. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Uri Lublin <uril@redhat.com>
2020-05-06test-quic: Test fixed imagesFrediano Ziglio1-5/+8
QUIC uses different methods to reduce image size. One uses RLE on pixels. Using fixed images allows to better test these paths increase code coverage. Signed-off-by: Frediano Ziglio <freddy77@gmail.com>