[Spice-devel] [spice-gtk 3/3] Send Hangul key in KR keyboard

2016-04-05 Thread Takao Fujiwara
Korean keyboard assigns Hangul key on the position of Right Alt and Left Alt and Hangul keys have the different scancodes but MapVirtualKey() returned the same scancode and could not use Hangul key on Linux desktop. The fix is to send the right scancode of VK_HANGUL. ---  src/spice-widget.c | 10 +

[Spice-devel] [spice-gtk 2/3] Send key release event for some keys in JP keyboard

2016-04-05 Thread Takao Fujiwara
With the previous fix, WM_KEYDOWN of Alt+Zenkaku_Hankaku (VK_KANJI) can be sent with spice-gtk but Alt+Zenkaku_Hankaku does not send the WM_KEYUP event in Windows and it caused Linux desktop freeze with unlimited key press events. The proposed fix is to send the key release event in spice-gtk. VK

[Spice-devel] [spice-gtk 1/3] Send Zenkaku_Hankaku key in JP keyboard

2016-04-05 Thread Takao Fujiwara
Zenkaku_Hankaku key has the different virtual-key codes between WM_KEYDOWN and WM_KEYUP and MapVirtualKey() cannot get the scancode from virtual-key code of WM_KEYDOWN (VK_DBE_DBCSCHAR) and spice-gtk didn't send the key press events and caused the desktop freeze with unlimited key release events.

Re: [Spice-devel] [spice-gtk 1/3] Send Zenkaku_Hankaku key in JP keyboard

2016-04-05 Thread Takao Fujiwara
Seems Evolution sets line breaks in the email body. Let me send the patches again. On 04/06/16 13:30, Takao Fujiwara-san wrote: Zenkaku_Hankaku key has the different virtual-key codes between WM_KEYDOWN and WM_KEYUP and MapVirtualKey() cannot get the scancode from virtual- key code of WM_KEYDOWN

[Spice-devel] [spice-gtk 3/3] Send Hangul key in KR keyboard

2016-04-05 Thread Takao Fujiwara
Korean keyboard assigns Hangul key on the position of Right Alt and Left Alt and Hangul keys have the different scancodes but MapVirtualKey() returned the same scancode and could not use Hangul key on Linux desktop. The fix is to send the right scancode of VK_HANGUL. ---  src/spice-widget.c | 10 +

[Spice-devel] [spice-gtk 2/3] Send key release event for some keys in JP keyboard

2016-04-05 Thread Takao Fujiwara
With the previous fix, WM_KEYDOWN of Alt+Zenkaku_Hankaku (VK_KANJI) can be sent with spice-gtk but Alt+Zenkaku_Hankaku does not send the WM_KEYUP event in Windows and it caused Linux desktop freeze with unlimited key press events. The proposed fix is to send the key release event in spice-gtk. VK

[Spice-devel] [spice-gtk 1/3] Send Zenkaku_Hankaku key in JP keyboard

2016-04-05 Thread Takao Fujiwara
Zenkaku_Hankaku key has the different virtual-key codes between WM_KEYDOWN and WM_KEYUP and MapVirtualKey() cannot get the scancode from virtual- key code of WM_KEYDOWN (VK_DBE_DBCSCHAR) and spice-gtk didn't send the key press events and caused the desktop freeze with unlimited key release events.

Re: [Spice-devel] [PATCH spice-gtk 4/4] Use g_clear_pointer if possible

2016-04-05 Thread Pavel Grunt
On Tuesday, April 5, 2016, Eduardo Lima (Etrunko) wrote: > On 04/05/2016 01:58 PM, Pavel Grunt wrote: > > --- > > src/bio-gio.c | 3 +-- > > src/channel-display-mjpeg.c | 6 ++ > > src/channel-display.c | 10 +++--- > > src/channel-main.c | 6 ++ > > s

Re: [Spice-devel] [PATCH spice-gtk 3/4] Use g_clear_object if possible

2016-04-05 Thread Pavel Grunt
On Tuesday, April 5, 2016, Eduardo Lima (Etrunko) wrote: > Acked-by: Eduardo Lima (Etrunko) > > > Maybe could be squashed with next one. > > OK, I will do it Thanks, Pavel > On 04/05/2016 01:58 PM, Pavel Grunt wrote: > > --- > > src/spice-channel.c| 11 ++- > > src/spice-widget.c

Re: [Spice-devel] [spice-server 2/2] qxl: Remove duplicate QXLState typedef

2016-04-05 Thread Jonathon Jongsma
On Tue, 2016-04-05 at 15:37 +0200, Christophe Fergeau wrote: > We can directly include spice-qxl.h in red-qxl.h as it already gets it > indirectly anyway. > > > --- > server/red-qxl.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/server/red-qxl.h b/server/red-qxl.h >

Re: [Spice-devel] [spice-server 1/2] reds: Move RedsState typedef to red-common.h

2016-04-05 Thread Jonathon Jongsma
On Tue, 2016-04-05 at 15:37 +0200, Christophe Fergeau wrote: > This allows to stop using struct RedsState * rather than RedsState * in > headers which cannot include reds.h. This also allows to remove the > duplicate RedsState typedef in reds.h and reds-stream.h which is causing > issues with older

Re: [Spice-devel] [PATCH spice-gtk 3/4] Use g_clear_object if possible

2016-04-05 Thread Eduardo Lima (Etrunko)
Acked-by: Eduardo Lima (Etrunko) Maybe could be squashed with next one. On 04/05/2016 01:58 PM, Pavel Grunt wrote: > --- > src/spice-channel.c| 11 ++- > src/spice-widget.c | 22 -- > src/wocky-http-proxy.c | 3 +-- > 3 files changed, 7 insertions(+), 29 del

Re: [Spice-devel] [PATCH spice-gtk 4/4] Use g_clear_pointer if possible

2016-04-05 Thread Eduardo Lima (Etrunko)
On 04/05/2016 01:58 PM, Pavel Grunt wrote: > --- > src/bio-gio.c | 3 +-- > src/channel-display-mjpeg.c | 6 ++ > src/channel-display.c | 10 +++--- > src/channel-main.c | 6 ++ > src/channel-playback.c | 3 +-- > src/channel-record.c| 9 +

Re: [Spice-devel] [PATCH spice-gtk 2/4] Use g_object_unref instead of gdk_cursor_unref

2016-04-05 Thread Eduardo Lima (Etrunko)
On 04/05/2016 01:58 PM, Pavel Grunt wrote: > GdkCursor is GObject and g_object_unref has been deprecated since 3.0 You mean gdk_cursor_unref here right? Acked-by: Eduardo Lima (Etrunko) -- Eduardo de Barros Lima (Etrunko) Software Engineer - RedHat etru...@redhat.com _

Re: [Spice-devel] [spice-server] char-device: Fix property name in red_char_device_new()

2016-04-05 Thread Jonathon Jongsma
On Tue, 2016-04-05 at 17:31 +0200, Christophe Fergeau wrote: > This method will be removed in a subsequent commit, but for now it's > causing breakage since it's setting "reds" instead of "spice-server" > --- > server/char-device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

[Spice-devel] [PATCH spice-gtk 3/4] Use g_clear_object if possible

2016-04-05 Thread Pavel Grunt
--- src/spice-channel.c| 11 ++- src/spice-widget.c | 22 -- src/wocky-http-proxy.c | 3 +-- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/spice-channel.c b/src/spice-channel.c index 8ae0e4d..e9c5a1b 100644 --- a/src/spice-channel.c +++ b/

[Spice-devel] [PATCH spice-gtk 0/4] Cleanups for new gtk and glib

2016-04-05 Thread Pavel Grunt
Hi, since we bumped the glib and gtk dependencies, it's possible to clean up the code little bit. Patches silence some deprecated warnings and change our code to use more g_clear_pointer and g_clear_object. Thanks, Pavel Pavel Grunt (4): Use GMutex instead of GStaticMutex Use g_object_unref

[Spice-devel] [PATCH spice-gtk 2/4] Use g_object_unref instead of gdk_cursor_unref

2016-04-05 Thread Pavel Grunt
GdkCursor is GObject and g_object_unref has been deprecated since 3.0 --- src/spice-widget.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/spice-widget.c b/src/spice-widget.c index f605439..8ca8631 100644 --- a/src/spice-widget.c +++ b/src/spice-widget.c @@ -

[Spice-devel] [PATCH spice-gtk 4/4] Use g_clear_pointer if possible

2016-04-05 Thread Pavel Grunt
--- src/bio-gio.c | 3 +-- src/channel-display-mjpeg.c | 6 ++ src/channel-display.c | 10 +++--- src/channel-main.c | 6 ++ src/channel-playback.c | 3 +-- src/channel-record.c| 9 +++-- src/channel-smartcard.c | 28 ++

[Spice-devel] [PATCH spice-gtk 1/4] Use GMutex instead of GStaticMutex

2016-04-05 Thread Pavel Grunt
Since GLib 2.32 GMutex can be statically allocated, so GStaticMutex has been deprecated. --- src/desktop-integration.c | 6 +++--- src/spice-gtk-session.c | 6 +++--- src/spice-session.c | 12 ++-- src/usbutil.c | 6 +++--- 4 files changed, 15 insertions(+), 15 delet

Re: [Spice-devel] [PATCH 09/10] reds: Remove spice_char_device_state_create()

2016-04-05 Thread Christophe Fergeau
s/spice_char_device_state_create/red_char_device_new in the short log Looks good otherwise, Christophe On Fri, Apr 01, 2016 at 03:51:43PM -0500, Jonathon Jongsma wrote: > From: Christophe Fergeau > > Nothing is using it anymore now that CharDevice classes are > gobjectified. > --- > server/cha

[Spice-devel] [spice-server] char-device: Fix property name in red_char_device_new()

2016-04-05 Thread Christophe Fergeau
This method will be removed in a subsequent commit, but for now it's causing breakage since it's setting "reds" instead of "spice-server" --- server/char-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/char-device.c b/server/char-device.c index f492657..bd2737f

[Spice-devel] [spice v12 16/26] server: Add support for GStreamer 0.10

2016-04-05 Thread Francois Gouget
configure will use GStreamer 1.0 if present and fall back to GStreamer 0.10 otherwise. ffenc_mjpeg takes its bitrate as a long so extend set_gstenc_bitrate(). Signed-off-by: Francois Gouget --- configure.ac | 36 ++--- server/Makefile.am | 8 +++ server/gstreamer

[Spice-devel] [client v12 26/26] spice-gtk: Use decodebin as a fallback for the GStreamer video decoder

2016-04-05 Thread Francois Gouget
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 --- src/channel-display-gst.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/channel-dis

[Spice-devel] [client v12 25/26] spice-gtk: Probe GStreamer before advertising support for a codec

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- src/channel-display-gst.c | 17 +++-- src/channel-display-priv.h | 4 ++-- src/channel-display.c | 21 + 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c

[Spice-devel] [client v12 22/26] spice-gtk: Let the video decoder queue, schedule and drop the frames

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- src/channel-display-mjpeg.c | 142 --- src/channel-display-priv.h | 10 ++- src/channel-display.c | 201 +++- 3 files changed, 189 insertions(+), 164 deletions(-) diff --git a/src/chann

[Spice-devel] [client v12 24/26] spice-gtk: Allow disabling support for the builtin MJPEG video decoder

2016-04-05 Thread Francois Gouget
This makes it possible to test the GStreamer video decoder with MJPEG streams. Signed-off-by: Francois Gouget --- configure.ac | 11 +++ src/Makefile.am| 7 ++- src/channel-display-priv.h | 2 ++ src/channel-display.c | 5 + 4 files changed, 24 i

[Spice-devel] [client v12 23/26] spice-gtk: Add a GStreamer video decoder for MJPEG, VP8 and h264

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- configure.ac | 26 ++- src/Makefile.am| 8 + src/channel-display-gst.c | 437 + src/channel-display-priv.h | 6 + src/channel-display.c | 10 ++ 5 files changed, 486 insertions(+),

[Spice-devel] [client v12 21/26] spice-gtk: Rename num_drops_on_receive to arrive_late_count

2016-04-05 Thread Francois Gouget
The frame may not get dropped once that's left up to video decoders. Signed-off-by: Francois Gouget --- src/channel-display-priv.h | 2 +- src/channel-display.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/channel-display-priv.h b/src/channel-display-priv

[Spice-devel] [client v12 20/26] spice-gtk: Optimize handling of the decoded frame buffer

2016-04-05 Thread Francois Gouget
The MJPEG decoder does not need a zero-filled buffer. Signed-off-by: Francois Gouget --- src/channel-display-mjpeg.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c index c7e1c6f..927827b 100644 --- a/src/chan

[Spice-devel] [client v12 19/26] spice-gtk: Enable adding alternative video decoders

2016-04-05 Thread Francois Gouget
This replaces the original channel-display-mjpeg API with a VideoDecoder base class which can be reimplemented by other decoders. Furthermore this moves the MJPEG-specific state information from the display_stream struct to a derived class of VideoDecoder. Signed-off-by: Francois Gouget --- src/

[Spice-devel] [spice v12 14/26] server: Give up after a while if GStreamer cannot handle the video

2016-04-05 Thread Francois Gouget
This typically happens when sending very small frames (less than 16 pixels in one dimension) to the x264enc encoder. This avoids repeatedly wasting time rebuilding the pipeline. Signed-off-by: Francois Gouget --- server/gstreamer-encoder.c | 53 -- 1 f

[Spice-devel] [qxl v12 18/26] Xspice: Add --video-codecs to specify encoder and codec preferences

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- scripts/Xspice | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Xspice b/scripts/Xspice index 15a5a5e..bf8112f 100755 --- a/scripts/Xspice +++ b/scripts/Xspice @@ -87,6 +87,7 @@ parser.add_argument('--zlib-glz-wan-compression', # TO

[Spice-devel] [qxl v12 17/26] spiceqxl: Add SpiceVideoCodecs to specify video codec preferences

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- examples/spiceqxl.xorg.conf.example | 7 +++ src/qxl.h | 1 + src/qxl_driver.c| 2 ++ src/spiceqxl_spice_server.c | 15 +++ 4 files changed, 25 insertions(+) diff --git a/examples/spiceqxl

[Spice-devel] [spice v12 15/26] server: Respect the GStreamer encoder's valid bit rate range

2016-04-05 Thread Francois Gouget
GObject returns an error instead of clamping if given an out of range property value. Signed-off-by: Francois Gouget --- server/gstreamer-encoder.c | 90 +++--- 1 file changed, 69 insertions(+), 21 deletions(-) diff --git a/server/gstreamer-encoder.c b/se

[Spice-devel] [spice v12 13/26] server: Adjust the frame rate based on the GStreamer encoding time

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- server/gstreamer-encoder.c | 40 +--- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c index 28589c3..d71c26c 100644 --- a/server/gstreamer-encoder.c +++ b/

[Spice-devel] [spice v12 11/26] server: Shape the bit rate of the GStreamer codecs output

2016-04-05 Thread Francois Gouget
The GStreamer codecs don't follow the specified bit rate very closely: they can decide to exceed it for ten seconds or more if they consider the scene deserves it. Such long bursts are enough to cause network congestion, resulting in many lost frames which cause significant display corruption. So t

[Spice-devel] [spice v12 12/26] server: Adjust the GStreamer encoder bit rate to the network

2016-04-05 Thread Francois Gouget
The video encoder uses the client reports and/or notifications of server frame drops as its feedback mechanisms. In particular it keeps track of the maximum video margin and reduces the bit rate whenever the margin goes below certain thresholds or decreases too sharply. It uses these to figure out

[Spice-devel] [spice v12 03/26] server: Check the client video codec capabilities

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- server/dcc-send.c | 3 ++- server/stream.c | 25 - 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/server/dcc-send.c b/server/dcc-send.c index 2fd4129..ebbc3e5 100644 --- a/server/dcc-send.c +++ b/server/dcc-send.c @@

[Spice-devel] [spice v12 04/26] server: Let the administrator pick the video encoder and codec

2016-04-05 Thread Francois Gouget
The Spice server administrator can specify the encoder and codec preferences to optimize for CPU or bandwidth usage. Preferences are described in a semi-colon separated list of encoder:codec pairs. The server has a default preference list which can explicitly be selected by specifying 'auto'. The

[Spice-devel] [spice v12 07/26] server: Use the optimal number of threads for VP8 encoding

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- configure.ac | 4 server/gstreamer-encoder.c | 27 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9bd8ccb..6093431 100644 --- a/configure.ac +++ b/configure.ac @@ -

[Spice-devel] [spice v12 08/26] server: Let the video encoder manage the compressed buffer

2016-04-05 Thread Francois Gouget
This way the video encoder is not forced to use malloc()/free(). This also allows more flexibility in how the video encoder manages the buffer which allows for a zero-copy implementation in both video encoders. Signed-off-by: Francois Gouget --- server/dcc-send.c | 25 +++--- se

[Spice-devel] [spice v12 10/26] server: Add h264 support to the GStreamer video encoder

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- configure.ac | 1 + server/gstreamer-encoder.c | 17 - server/reds.c | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6093431..1e98523 100644 --- a/configure.

[Spice-devel] [spice v12 09/26] server: Avoid copying the input frame in the GStreamer encoder

2016-04-05 Thread Francois Gouget
Note that we can only avoid copies for the first 1 Mpixels or so. That's because Spice splits larger frames into more chunks than we can fit GstMemory fragments in a GStreamer buffer. So if there are more pixels we will avoid copies for the first 3840 KB and copy the rest. Furthermore, while in pra

[Spice-devel] [spice v12 06/26] server: Add VP8 support to the GStreamer video encoder

2016-04-05 Thread Francois Gouget
Signed-off-by: Francois Gouget --- configure.ac | 1 + server/gstreamer-encoder.c | 74 -- server/reds.c | 4 ++- 3 files changed, 69 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 9904bc8..9b

[Spice-devel] [spice v12 05/26] replay: Add an option to change video codec

2016-04-05 Thread Pavel Grunt
--- server/tests/replay.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/tests/replay.c b/server/tests/replay.c index 7e4659b..025b20c 100644 --- a/server/tests/replay.c +++ b/server/tests/replay.c @@ -290,7 +290,7 @@ int main(int argc, char **argv) {

[Spice-devel] [spice v12 00/26] Add GStreamer support for video streaming

2016-04-05 Thread Francois Gouget
This patch series adds support for using GStreamer to encode and decode the video streams, adding support for VP8 and h264 codecs. As before the patches can also be grabbed from the gst branch of the repositories below: spice: https://github.com/fgouget/spice spice-gtk: https://gi

[Spice-devel] [spice v12 01/26] server: Enable adding alternative MJPEG video encoders

2016-04-05 Thread Francois Gouget
This replaces the original mjpeg_encoder API with a VideoEncoder base class which can be reimplemented by other encoders. This also renames the members and enums from mjpeg_* to video_*. Signed-off-by: Francois Gouget --- server/Makefile.am | 2 +- server/dcc-send.c | 25 se

[Spice-devel] [spice v12 02/26] server: Add a GStreamer 1.0 MJPEG video encoder and use it by default

2016-04-05 Thread Francois Gouget
This introduces a pared down GStreamer-based video encoder to serve as the basis for later enhancements. In this form the new encoder supports both regular and sized streams but lacks any rate control. It should still work fine if bandwidth is sufficient such as on LANs. Signed-off-by: Francois Go

Re: [Spice-devel] [spice-server 3/3] audio: Improve snd_receive type-safety

2016-04-05 Thread Pavel Grunt
On Tue, 2016-04-05 at 15:09 +0200, Christophe Fergeau wrote: > We can pass it a SndChannel rather than an opaque void* data pointer > which we then blindly cast. > This came to light through a -Wshadow warning as there was a local > variable 'data' in addition to the 'data' parameter. Acked-by: Pav

Re: [Spice-devel] [spice-server 1/3] gobject: Add g_type_init() for older glibs

2016-04-05 Thread Christophe Fergeau
On Tue, Apr 05, 2016 at 04:07:24PM +0200, Pavel Grunt wrote: > On Tue, 2016-04-05 at 15:09 +0200, Christophe Fergeau wrote: > > Older glib versions require g_type_init() to be called before using > > GObject. > > Acked-by: Pavel Grunt I pushed the series, thanks! Christophe signature.asc Desc

Re: [Spice-devel] [spice-common 1/3] log: Clamp SPICE_DEBUG_LEVEL if it's too high

2016-04-05 Thread Christophe Fergeau
On Tue, Apr 05, 2016 at 01:28:14PM +0200, Pavel Grunt wrote: > Hi, > > ack for the series. Thanks, pushed. Christophe signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.or

Re: [Spice-devel] [spice-server 2/3] char-device: Remove duplicate typedef

2016-04-05 Thread Pavel Grunt
On Tue, 2016-04-05 at 15:09 +0200, Christophe Fergeau wrote: Acked-by: Pavel Grunt > --- >  server/char-device.h | 3 +-- >  1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/server/char-device.h b/server/char-device.h > index d92cbab..0a4ae5d 100644 > --- a/server/char-device.h > +

Re: [Spice-devel] [spice-server 1/3] gobject: Add g_type_init() for older glibs

2016-04-05 Thread Pavel Grunt
On Tue, 2016-04-05 at 15:09 +0200, Christophe Fergeau wrote: > Older glib versions require g_type_init() to be called before using > GObject. Acked-by: Pavel Grunt > --- >  server/reds.c | 3 +++ >  1 file changed, 3 insertions(+) > > diff --git a/server/reds.c b/server/reds.c > index 23df51a..fd

[Spice-devel] [spice-server 2/2] qxl: Remove duplicate QXLState typedef

2016-04-05 Thread Christophe Fergeau
We can directly include spice-qxl.h in red-qxl.h as it already gets it indirectly anyway. > --- server/red-qxl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/red-qxl.h b/server/red-qxl.h index b1ebbe1..c9b6b36 100644 --- a/server/red-qxl.h +++ b/server/red-qxl.h @@

[Spice-devel] [spice-server 1/2] reds: Move RedsState typedef to red-common.h

2016-04-05 Thread Christophe Fergeau
This allows to stop using struct RedsState * rather than RedsState * in headers which cannot include reds.h. This also allows to remove the duplicate RedsState typedef in reds.h and reds-stream.h which is causing issues with older gcc versions. --- server/char-device.h | 8 +++- server/main-

[Spice-devel] [spice-server 3/3] audio: Improve snd_receive type-safety

2016-04-05 Thread Christophe Fergeau
We can pass it a SndChannel rather than an opaque void* data pointer which we then blindly cast. This came to light through a -Wshadow warning as there was a local variable 'data' in addition to the 'data' parameter. --- server/sound.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-)

[Spice-devel] [spice-server 2/3] char-device: Remove duplicate typedef

2016-04-05 Thread Christophe Fergeau
--- server/char-device.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/char-device.h b/server/char-device.h index d92cbab..0a4ae5d 100644 --- a/server/char-device.h +++ b/server/char-device.h @@ -32,6 +32,7 @@ #define RED_IS_CHAR_DEVICE_CLASS(klass) (G_TYPE_CHECK_CL

[Spice-devel] [spice-server 1/3] gobject: Add g_type_init() for older glibs

2016-04-05 Thread Christophe Fergeau
Older glib versions require g_type_init() to be called before using GObject. --- server/reds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/reds.c b/server/reds.c index 23df51a..fdfb54a 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3394,6 +3394,9 @@ static int do_spice_init(R

Re: [Spice-devel] [spice-gtk 3/4] coverity: avoid out of bounds access

2016-04-05 Thread Uri Lublin
On 04/04/2016 12:13 PM, Christophe Fergeau wrote: On Mon, Apr 04, 2016 at 10:02:08AM +0200, Fabiano Fidêncio wrote: --- src/controller/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controller/test.c b/src/controller/test.c index 649aca5..2909b06 100644 --- a/s

Re: [Spice-devel] [spice-gtk 3/3] Send key release event for some keys in JP keyboard.

2016-04-05 Thread Takao Fujiwara
On 03/31/16 22:36, Frediano Ziglio-san wrote: --- a/src/spice-widget.c +++ b/src/spice-widget.c @@ -1493,6 +1493,15 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key) } } break; +case 0x412: /* KR keyboard */ +if

Re: [Spice-devel] [spice-common 1/3] log: Clamp SPICE_DEBUG_LEVEL if it's too high

2016-04-05 Thread Pavel Grunt
Hi, ack for the series. Pavel On Tue, 2016-04-05 at 12:56 +0200, Christophe Fergeau wrote: > This matches how SPICE_DEBUG_LEVEL behaved before switching to glib > logging. > --- >  common/log.c | 3 +++ >  1 file changed, 3 insertions(+) > > diff --git a/common/log.c b/common/log.c > index 8d47c

Re: [Spice-devel] Handle JP keyboard with spice-gtk from Windows client

2016-04-05 Thread Takao Fujiwara
On 03/31/16 22:27, Christophe Fergeau-san wrote: 3. spice-gtk-1311820-03-hangul.patch This is an additional fix. Korean keyboard assigns Hangul key on the position of Right Alt and Left Alt and Hangul keys have the different scancodes but MapVirtualKey() returned the same scancode and could not

Re: [Spice-devel] [spice-gtk 2/3] Send key release event for some keys in JP keyboard.

2016-04-05 Thread Takao Fujiwara
On 03/31/16 22:19, Frediano Ziglio-san wrote: +switch (key->hardware_keycode) { +case VK_KANJI: /* Alt + Zenkaku_Hankaku */ +case VK_OEM_ATTN: /* Eisu_toggle */ +case VK_OEM_COPY: /* Hiragana_Katakana */ +case VK

Re: [Spice-devel] [spice-gtk 1/3] Send Zenkaku_Hankaku key in JP keyboard.

2016-04-05 Thread Takao Fujiwara
Thank you for those reviews. I sent the updated patches now. On 03/31/16 22:12, Frediano Ziglio-san wrote: You should handle WM_INPUTLANGCHANGE so use can change layout while using remote-viewer. Another option is not cache the value but just call GetKeyboardLayout(0) every time. I succeeded t

[Spice-devel] [spice-common 2/3] log: Use SPICE_CONSTRUCTOR_FUNC

2016-04-05 Thread Christophe Fergeau
This was done through a GOnce called every time spice_log() is called, now it will always be called at spice-server startup. This means the unit test needs to be updated as SPICE_DEBUG/ABORT_LEVEL must now be set before the process starts up rather than before the first spice_log call, and the dep

[Spice-devel] [spice-common 1/3] log: Clamp SPICE_DEBUG_LEVEL if it's too high

2016-04-05 Thread Christophe Fergeau
This matches how SPICE_DEBUG_LEVEL behaved before switching to glib logging. --- common/log.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/log.c b/common/log.c index 8d47cb6..5f08470 100644 --- a/common/log.c +++ b/common/log.c @@ -67,6 +67,9 @@ static void spice_log_set_debug_lev

[Spice-devel] [spice-common 3/3] log: Make sure glib threading is initialized

2016-04-05 Thread Christophe Fergeau
While testing spice-server on EL6, I was getting random crashes in the glib logging code because g_logv was called recursively even though this was not visible in a backtrace. It turns out on older glib versions (EL6 has 2.28), g_logv is not thread-safe unless g_thread_init() is called first. If g