Commit Graph

2057 Commits

Author SHA1 Message Date
Francois Gouget
b2e6f64da9 streaming: Use the frame dimensions reported by the video decoder
The dimensions sent by the remote end are redundant and should not be
trusted.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-06 14:02:16 +02:00
Pavel Grunt
3666ec4d5c widget: Avoid using GDK_GRAB_FAILED defined in Gtk 3.16.
The returned value from do_pointer_grab() is treated as a boolean - grab
was successful or not. Change the function to return a boolean value.

Reported-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-06 14:01:55 +02:00
Pavel Grunt
0fb13d68dc mingw: Fix -Werror format & missing-prototypes
-Wmissing prototypes were enabled in d5e3a4a5c3
format warnings were added in da8ecf1f95
2016-06-06 13:58:52 +02:00
Pavel Grunt
08ab6d47c6 spicy: Do not show underscore in label
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-03 11:41:23 +02:00
Pavel Grunt
b542dfa2d5 spice-uri: Add ipv6 support
Just basic support -  http://user:password@[host]:port

Resolves: rhbz#1335239
2016-06-02 10:26:10 +02:00
Pavel Grunt
8dcb4129ac spice-uri: Validate uri scheme
Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
eacbe261d4 spice-uri: Check if port is in allowed range
Use g_ascii_strtoll because it helps to detect overflow.

Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
85051b06c1 spice-uri: Do not allow empty port string
Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
024eccefba spice-uri: Reset SpiceURI before parsing
Avoid using old values after parsing a new uri.

Related: rhbz#1335239
2016-06-02 10:26:10 +02:00
Pavel Grunt
dab190d8d2 tests: Add test for SpiceURI
Related: rhbz#1335239
2016-06-02 10:26:10 +02:00
Francois Gouget
3b306b1430 streaming: Tweak the GStreamer decoder to avoid a compiler warning
We check that there is a matching frame in the queue before popping the
old ones. So we know the inner loop will find a match and thus that
frame will not be NULL. But figuring that out is too hard for the
compiler.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Reported-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-06-01 13:36:28 +02:00
Marc-André Lureau
da8ecf1f95 build-sys: update manywarnings.m4
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 11:05:55 +02:00
Marc-André Lureau
b32398ef4d build-sys: -Wshift-overflow=2
manywarnings.m4 update will bring new flags that fail with some
glib/gst headers.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 11:05:48 +02:00
Marc-André Lureau
48bbcbbc49 Fix many -Werror=format warnings
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 11:05:41 +02:00
Marc-André Lureau
67011b2c8b build-sys: remove -Wmissing-declarations
The warning doesn't show up anymore.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 11:05:32 +02:00
Victor Toso
7d7382ea45 channel: avoid crash on spice_channel_wakeup due NULL channel
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 09:32:39 +02:00
Victor Toso
756f1fe8aa tests: fix build with smartcard enabled
In file included from
../spice-common/common/client_marshallers.h:29:0,
from ../src/spice-channel-priv.h:35,
from ../src/spice-file-transfer-task-priv.h:28,
from file-transfer.c:3:
../spice-common/common/messages.h:45:23: fatal error: libcacard.h: No such file or directory
compilation terminated.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 09:32:27 +02:00
Marc-André Lureau
320a58d8fc doc: fix unused declarations
Fix all the gtk-doc: "unused declarations. They should be added to
spice-gtk-sections.txt in the appropriate place."

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-31 13:35:52 +02:00
Marc-André Lureau
48ca4df9da doc: add some missing block comments
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-31 13:35:51 +02:00
Marc-André Lureau
52db98dbcb Fix non gtk-doc comments
Fixes the following warning:
../../src/vmcstream.c:124: warning: Symbol name not found at the start of the comment block.
../../src/win-usb-driver-install.c:347: warning: Symbol name not found at the start of the comment block.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-31 13:35:50 +02:00
Marc-André Lureau
0c8c25b699 build-sys: remove some gtk+ 2.0 warnings flags
As we dropped gtk+ 2.0 anyway.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-31 13:04:20 +02:00
Marc-André Lureau
d5e3a4a5c3 build-sys: enable -Wmissing-prototypes
Turns out it is possible to fix the warnings now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-31 13:04:16 +02:00
Pavel Grunt
94dafd6edf Update README
Remove gtk2 related stuff.
Recommend dnf for installing dependencies.
2016-05-31 12:01:53 +02:00
Pavel Grunt
aac9845123 spice-uri: Mark parameter as unused
Acked-by: Victor Toso <victortoso@redhat.com>
2016-05-31 12:01:41 +02:00
Marc-André Lureau
e99d4909ee main: remove unneeded gtk-doc comments
They are no longer in the doc, and not really useful anyway

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-28 08:27:47 +02:00
Marc-André Lureau
fed7098c21 main: remove SpiceFileTransferTaskPrivate
The struct is already private

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-05-28 08:27:47 +02:00
Victor Toso
349a52ca2d file-xfer: make handle_status agnostic of channel-main
This make possible to rename the function to
spice_file_transfer_task_handle_status as a handler for
VDAgentFileXferStatusMessage for a specific task.

This change is related to split SpiceFileTransferTask from
channel-main.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-27 09:06:24 +02:00
Francois Gouget
0736283e97 streaming: Constify the video stream's dest and clip parameters
They are only supposed to be changed when receiving the relevant server
message.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 17:02:10 +02:00
Pavel Grunt
2210a5c220 file-transfer-task: Hide internals of SpiceFileTransferTask
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-25 17:01:21 +02:00
Pavel Grunt
6b529a4042 file-trasfer-task: Protect header include
As stated in the commit d2f33178c4 Glib
applications should only include "spice-client.h".

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-05-25 17:00:35 +02:00
Marc-André Lureau
69383107ea egl: fix delayed widget realize
When the display is not yet realized, spice_display_widget_gl_scanout()
will fail because the egl context is not ready. The display is never
marked ready because the egl.image (and egl.scanout) is not set, and
some clients, such as virt-viewer will not realize the widget until the
display is ready.

Deal with gl scanout updates when the widget is not yet realized, and
mark the display as ready when egl is enabled (when last display draw
signal is from gl).

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:42:23 +02:00
Marc-André Lureau
4e08108d0a gtk: remove unneeded check
spice_cairo_draw_event() can deal with d->canvas.surface == NULL.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:42:22 +02:00
Marc-André Lureau
28c41f23b4 gtk: rename spicex_* functions
spice-gtk used to have x11/shm backend, now it's only cairo

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:42:21 +02:00
Marc-André Lureau
45506fadb3 gtk: move canvas related data in its own structure
Group canvas related data to a sub-structure.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:42:19 +02:00
Marc-André Lureau
2d3a6d93d7 egl: bind the scanout texture
glEGLImageTargetTexture2DOES() changes the current bound texture. If
the last texture bound is the cursor, update_scanout() will modify the
cursor texture, instead of the display.

Fix regression from commit 3539ac6212.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:19:06 +02:00
Marc-André Lureau
0fd2a335f2 display: lower to debug gstreamer codec support
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-25 12:18:40 +02:00
Pavel Grunt
d96d951445 spice-widget: Use correct enum value
GDK_GRAB_BROKEN is not GdkGrabStatus value, but GdkEventType
2016-05-25 06:47:55 +02:00
Pavel Grunt
9777d143a8 Update spice-common submodule
Fixes lz decompression crash:
https://bugzilla.redhat.com/show_bug.cgi?id=1285469

Christophe Fergeau (5):
      Remove 2 unused vfuncs from client_marshallers.h
      tests: Fix glib version check
      log: Clamp SPICE_DEBUG_LEVEL if it's too high
      log: Use SPICE_CONSTRUCTOR_FUNC
      log: Make sure glib threading is initialized

Eduardo Lima (Etrunko) (2):
      Fix build in systems with Glib version older than 2.38
      2/2] Add check for openssl

Fabiano Fidêncio (7):
      coverity: avoid use after free
      coverity: avoid resource leak
      coverity: avoid dereference after null check
      coverity: avoid division or modulo by zero
      coverity: remove unused value
      coverity: remove structurally dead code
      Use g_getenv() instead of getenv()

Frediano Ziglio (6):
      Cap logging level to the valid bounds
      tests: exit on SIGABRT
      define SPICE_CONSTRUCTOR_FUNC and SPICE_DESTRUCTOR_FUNC macros
      use macro to define constructor function
      fix 16 bpp LZ image decompression
      Explicitly specify size of SpiceMsgSmartcardData

Lin Ma (1):
      build-sys: Define opengl GL_LIBS and GL_CFLAGS in generated Makefile.in

Pavel Grunt (3):
      Define canvas_fix_alignment when is used
      test-logging: Include stdlib.h for _Exit()
      Remove GL support
2016-05-24 21:42:03 +02:00
Pavel Grunt
b7370876ef Update .mailmap 2016-05-24 21:42:03 +02:00
Marc-André Lureau
3539ac6212 egl: set current context, fix multiple display
On X11, each widget has its own context. Make sure we are using the
widget associated context when using gl.

With gtk 3.16, glEGLImageTargetTexture2DOES() can be called during
update scanout, since we can call gtk_gl_area_make_current(). On < 3.16,
do it before drawing.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1337721

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-05-23 18:42:45 +02:00
Marc-André Lureau
8873ff3de6 egl: don't terminate display
This is global to the display connection: all egl resources will be
released, including those from other widgets or from the application.

Fix spice/virgl display being rendered black after another widget
display is destroyed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-05-23 18:39:51 +02:00
Marc-André Lureau
cb92524414 egl: don't destroy wayland egl context
The egl context is from Gtk on Wayland. Destroy it only on X11.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-05-23 18:39:31 +02:00
Marc-André Lureau
f853ab3e6e egl: only swap buffers on x11
Gtk does it for us already with GtkGlArea.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-23 12:59:29 +02:00
Marc-André Lureau
73564cc100 channel: check if channel has a session
Since 8943d2329, the channel may be disconnected from the session
before it's destroyed. In this case, session is NULL.

Fixes some critical with virt-manager when closing a display:

(virt-manager:20451): GSpice-CRITICAL **: spice_session_is_for_migration: assertion 'SPICE_IS_SESSION(session)' failed

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-23 12:52:40 +02:00
Marc-André Lureau
ff60ed7afb util: remove STATIC_MUTEX macros
They are no longer needed since 0a9ec4ec0.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-05-23 11:17:17 +01:00
Frediano Ziglio
f697933524 Spice-widget: Use new gdk_event_get_scancode if available
This new Gdk API allows in Windows to retrieve the raw scancodes sent
by Windows.
This allows us to do some translations getting the right value without
many hacks and supporting all possible layouts.
Windows convert the scancodes into virtual key codes. The translation is
1 -> N based on different condition. Also a single virtual key code can
be originated from different scancodes. This make quite complicated
(if not impossible) to get the original scancode from the hardware_keycode
field (which in Windows is the virtual key).
The additional check for native_scancode after calling this function
allows to support key injection.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-19 15:00:10 +02:00
Francois Gouget
46d8442a37 streaming: Use decodebin as a fallback for the GStreamer video decoder
This means future video codecs may be supported automatically.
One can also force usage of decodebin by setting $SPICE_GSTVIDEO_AUTO.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-18 09:31:21 +02:00
Francois Gouget
d780947a68 streaming: Probe GStreamer before advertising support for a codec
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-18 09:31:21 +02:00
Francois Gouget
3c11ac2c87 streaming: Allow disabling support for the builtin MJPEG video decoder
This makes it possible to test the GStreamer video decoder with MJPEG
streams.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-18 09:31:21 +02:00
Francois Gouget
8891be2c2d streaming: Add a GStreamer video decoder for MJPEG, VP8 and h264
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-18 09:31:21 +02:00