summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-10quic: Add CORRELATE*/DECORRELATE* macrosFrediano Ziglio1-23/+21
This will help to unify quic_tmpl.c and quic_rgb_tmpl.c Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Call directly encode_state_run from templates.Frediano Ziglio3-27/+6
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Add missing #undef SET_a/GET_aFrediano Ziglio1-0/+2
These macros were added to quic_tmpl.c in 815223861 but without the corresponding #undef. This commit adds them for consistency. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Make {UN, }COMPRESS_xx macros closerFrediano Ziglio1-70/+71
Define COMPRESS_xx/UNCOMPRESS_xx macros in a more similar way between quic_tmpl.c and quic_rgb_tmpl.c using channel suffixes. Instead of having #define COMPRESS(channel) do_something(channel), we'll now have #define COMPRESS(channel) do_something(channel_##channel), and call it with COMPRESS(a) Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Add SAME_PIXEL macroFrediano Ziglio1-3/+7
This helps making the code in quic_tmpl.c and quic_rgb_tmpl.c more similar. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Rework PIXEL_A/PIXEL_B macrosFrediano Ziglio1-6/+6
This makes them identical to their counterparts in quic_rgb_tmpl.c Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10quic: Add UPDATE_MODEL_COMP macro to iterate over channelsFrediano Ziglio1-6/+7
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-10meson: Remove -std=c99Frediano Ziglio1-2/+1
This flag disable some compiler feature which is used by some system header potentially introducing some limitations. Autotools won't add any flag to limit compiler features to C99, instead it currently only add flags to support C99 when needed. For instance some Posix limitations changes (like _POSIX_OPEN_MAX). As compiler feature for instance _Static_assert is not used. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-06build: Define GLIB_VERSION_MIN_REQUIRED/GLIB_VERSION_MAX_ALLOWEDChristophe Fergeau1-0/+1
This is defined for the meson build, but not the autotools build. This commit makes them consistent. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-06pixman: Use g_error() rather than g_abort()Christophe Fergeau1-4/+2
g_abort() was only added in glib 2.50, which causes meson build failures since this defines GLIB_VERSION_MIN_REQUIRED/GLIB_VERSION_MAX_ALLOWED Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-06build: Remove spice_common.hChristophe Fergeau11-42/+4
Most users of spice_common.h don't need it, or only need log.h. It only has a few users outside of spice-common. It's not very well defined which headers it should contain. This commit removes spice_common.h in favour of direct inclusion of the needed headers. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-06common: Remove spice_abort()Christophe Fergeau2-4/+2
There are only 2 users in spice-common, and none in spice-gtk/spice Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-06log: Remove SPICE_DISABLE_ABORTChristophe Fergeau3-20/+2
spice-gtk was the last user, and stopped using it on Jun 14th 2017 in 040090ccba34 "build-sys: remove -DSPICE_DISABLE_ABORT" Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-05canvas_base: Avoid misaligned access decoding LZ4 dataFrediano Ziglio1-1/+9
Make code faster on platforms not supporting unaligned access by default. SPICE_UNALIGNED_CAST is just silencing possible alignment warning and, if enabled, produces some logs, however in this case we know that the pointer can be misaligned. Use packed structures to tell compiler to generate best code possible. For more details see comment on commit 74e50b57ae05116be4e2 ("Make the compiler work out better way to write unaligned memory"). Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-05meson: Remove '(default: xxx)' from option descriptionChristophe Fergeau1-7/+7
'meson configure' will show the current value of an option, specifying the default value in the option description does not add much to that output. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-07-05canvas_base: Fix minor indentation issuesFrediano Ziglio1-2/+2
This patch just changes some spaces fixing some possible misleading indentation. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
2018-07-04swcanvas: Remove canvas_create()Christophe Fergeau2-37/+0
Nothing calls it in spice-gtk or spice-server Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-03quic: Call encode from golomb_codingFrediano Ziglio4-62/+28
golomb_coding is always followed by a encode call. Simplify code calling directly it, no reason to pass back output using pointers. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-07-03test-region: Decrease loop count by a factor of 10Eduardo Lima (Etrunko)1-1/+1
This test was timing out when running in gitlab-ci, so decreasing the loop count in order to make it run faster. Example: https://gitlab.freedesktop.org/etrunko/spice-common/-/jobs/6546 Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-07-03Update gitlab-ci to use mesonEduardo Lima (Etrunko)1-0/+10
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-07-03test-marshallers: Check for "zero" attributeFrediano Ziglio3-0/+23
Check the previous fix for "zero" attribute works correctly (commit bc9df5816210efbe15ca03e82510f34174784082, "marshal: Fix a bug with zero attribute"). Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-29meson: Cleanup optional dependency checksEduardo Lima (Etrunko)2-8/+4
We can follow the same practice as in headers and function checks above, by using the dependency name itself to set the configuration data. Also, if a combo is used, the first value is used as default if none is specified. Thus, we can remove the default value for opus from meson_options.txt. Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-29meson: Enable '-std=c99' build flagEduardo Lima (Etrunko)1-1/+1
The only file preventing this flag was bitops.h which has been removed since the following commit: commit 992ebac6b511811c73559421a46732c5233118c1 Author: Christophe Fergeau <cfergeau@redhat.com> Date: Tue Jun 5 11:27:01 2018 +0200 build: Remove bitops.h Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-29log: Remove spice_printerr macroFrediano Ziglio1-4/+0
All usages of this macro were removed. A library should not log to standard error but use log facilities so remove this macro to avoid possible future usage. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-28build: Reindent macrosFrediano Ziglio2-9/+9
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-28build: Reuse TEST_MARSHALLERS macroFrediano Ziglio1-3/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-28snd: Replace spice_printerr() use with g_warningChristophe Fergeau1-9/+9
This allows users of the library to redirect where these messages go through use of g_log_set_default_handler() rather than unconditionally printing on stderr. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27ptypes: Improve some attribute documentationFrediano Ziglio1-2/+7
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27marshal: Fix a bug with zero attributeFrediano Ziglio1-1/+1
If this attribute was specified during marshaller the field was marshalled twice. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27canvas_base: Make sure top_down is a booleanFrediano Ziglio1-1/+1
Should be a 0/1 but just in case make sure. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27marshaller: Fix a possible leakFrediano Ziglio1-0/+6
The possible file descriptor associated to the message (currently can be only the DRM descriptor from Virgl) is not freed in case the marshaller is reset/destroyed. This can happen connecting/disconnecting client. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-06-27test-region: Add g_assert() checksChristophe Fergeau1-5/+16
At the moment, test success/failure is only printed to stdout. This commit adds some g_assert() so that test failures can be automatically detected. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Replace spice_assert() with g_assert_true()Christophe Fergeau1-1/+1
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Remove unneeded printfChristophe Fergeau1-1/+0
__FUNCTION__ will always be rect_is_valid, and there is a g_assert to check the region is valid, so we will get notified anyway if the validity check fails. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Don't call region_dump() by defaultChristophe Fergeau1-17/+17
This prints to stdout, which is not desirable in an automated test. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Replace direct printf with g_debug() callsChristophe Fergeau1-53/+53
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Use GTest APIChristophe Fergeau1-2/+9
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-27test-region: Create proper test for region from source codeFrediano Ziglio4-379/+414
region.c contained code to test the module. Separate test code into a proper test. Test is copied verbatim from the original code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26ssl_verify: Fix build for newer LibreSSLFrediano Ziglio1-1/+2
LibreSSL 2.7 defines ASN1_STRING_get0_data, like OpenSSL 1.1. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229044. Original patch from Piotr Kubaj. Reported-by: Jack L. <xxjack12xx@gmail.com> Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26Revert "ssl_verify: Fix build for newer LibreSSL"Frediano Ziglio1-2/+1
This reverts commit 638c77f3e67e84d9ee29839c98d153b5bfdb1af8. Commit had a misleading comment.
2018-06-26ssl_verify: Fix build for newer LibreSSLFrediano Ziglio1-1/+2
LibreSSL 2.7 does not define ASN1_STRING_get0_data, like OpenSSL 1.1. This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229044. Original patch from Piotr Kubaj. Reported-by: Jack L. <xxjack12xx@gmail.com> Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26test-quic: Increase test timeout using MesonFrediano Ziglio1-1/+1
This test can take quite some amount of time to run. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26canvas_base: Rework DUMP_JPEG debuggingFrediano Ziglio1-9/+8
The DUMP_JPEG compile time flag is used to dump all jpeg images to files. The code was saving garbage instead of proper data. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Reported-by: 谢 昆明 <KunMing.Xie@hotmail.com> Tested-by: 谢 昆明 <KunMing.Xie@hotmail.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26test-quic: Allows to specify multiple images to testFrediano Ziglio1-5/+7
Make easier to test an entire set of files Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-06-26Add SPICE_ATTR_NORETURN on prototype of error functionsChristophe de Dinechin2-0/+2
The error functions are supposed to not return. Using the attribute documents that in the interface, and is better for the compiler because most noreturn-related optimizations and spurious warning eliminations happen at the call site. Signed-off-by: Christophe de Dinechin <dinechin@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-21test-logging: Improve debug level testsChristophe Fergeau1-0/+17
These tests were checking that the expected messages were output, but they were not checking that the messages we don't want are not output. This commit adds this to make sure our log implementation does not output unwanted debug messages. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-20log: Only install glib log handler if SPICE_DEBUG_LEVEL is setChristophe Fergeau1-3/+8
Calling g_log_set_handler() is problematic as this means applications using spice-server won't be able to use g_log_set_default_handler to manage spice logging output themselves. Since this call is only needed for backwards compatibility (so that calling g_log together with SPICE_DEBUG_LEVEL set has the expected behaviour), we can install it only when SPICE_DEBUG_LEVEL is set. Then we should deprecate SPICE_DEBUG_LEVEL once and for all. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-19protocol: Add support for h265 video codecSnir Sheriber1-0/+1
Signed-off-by: Snir Sheriber <ssheribe@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-18build: Add __pycache__/*.pyc to DISTCLEANFILESChristophe Fergeau1-1/+1
Python 3 puts its .pyc files in a __pycache__ subdirectory, This commit adds these to DISTCLEANFILES. My main motivation for doing this is so that git.mk can then properly add them to .gitignore. Acked-by: Victor Toso <victortoso@redhat.com>
2018-06-18build: Remove docs/.gitignoreChristophe Fergeau1-1/+0
It was added together with the meson build, but it's currently being managed by git.mk, so it should not be in git Acked-by: Victor Toso <victortoso@redhat.com>