[Spice-devel] [PATCH] streaming: Tweak the GStreamer decoder to avoid a compiler warning

2016-05-30 Thread Francois Gouget
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 --- Adding an if

Re: [Spice-devel] [PATCH spice-gtk 4/7] gst: fix potential null pointer dereference

2016-05-30 Thread Marc-André Lureau
CC'ing Francois - Original Message - > CC channel-display-gst.lo > channel-display-gst.c: In function ‘new_sample’: > channel-display-gst.c:192:31: error: potential null pointer dereference > [-Werror=null-dereference] > frame->sample = sample; >

[Spice-devel] [PATCH spice-gtk 4/7] gst: fix potential null pointer dereference

2016-05-30 Thread Marc-André Lureau
CC channel-display-gst.lo channel-display-gst.c: In function ‘new_sample’: channel-display-gst.c:192:31: error: potential null pointer dereference [-Werror=null-dereference] frame->sample = sample; ~~^~~~ Signed-off-by: Marc-André Lureau

[Spice-devel] [PATCH spice-gtk 7/7] build-sys: update manywarnings.m4

2016-05-30 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- m4/manywarnings.m4 | 39 ++- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 3e6dd21..90823b0 100644 --- a/m4/manywarnings.m4 +++

[Spice-devel] [PATCH spice-gtk 5/7] Fix many -Werror=format warnings

2016-05-30 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- src/channel-base.c | 2 +- src/channel-cursor.c | 2 +- src/channel-display-gst.c | 4 +-- src/channel-display-mjpeg.c| 2 +- src/channel-display.c

[Spice-devel] [PATCH spice-gtk 6/7] build-sys: -Wshift-overflow=2

2016-05-30 Thread Marc-André Lureau
manywarnings.m4 update will bring new flags that fail with some glib/gst headers. Signed-off-by: Marc-André Lureau --- configure.ac | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8f1e91b..3fe8055 100644 ---

[Spice-devel] [PATCH spice-gtk 3/7] build-sys: remove -Wmissing-declarations

2016-05-30 Thread Marc-André Lureau
The warning doesn't show up anymore. Signed-off-by: Marc-André Lureau --- configure.ac | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 3c90e9e..8f1e91b 100644 --- a/configure.ac +++ b/configure.ac @@ -581,11

[Spice-devel] [PATCH spice-gtk 2/7] build-sys: remove some gtk+ 2.0 warnings flags

2016-05-30 Thread Marc-André Lureau
As we dropped gtk+ 2.0 anyway. Signed-off-by: Marc-André Lureau --- configure.ac | 7 --- 1 file changed, 7 deletions(-) diff --git a/configure.ac b/configure.ac index c94d41b..3c90e9e 100644 --- a/configure.ac +++ b/configure.ac @@ -585,13 +585,6 @@ dnl check

[Spice-devel] [PATCH spice-gtk 1/7] build-sys: enable -Wmissing-prototypes

2016-05-30 Thread Marc-André Lureau
Turns out it is possible to fix the warnings now. Signed-off-by: Marc-André Lureau --- configure.ac | 2 +- src/channel-base.c | 20 ++-- src/channel-playback.c | 1 + src/giopipe.c | 6 +- src/spice-gstaudio.c | 2 +-

Re: [Spice-devel] [spice v15 11/21] streaming: Avoid copying the input frame in the GStreamer encoder

2016-05-30 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

Re: [Spice-devel] [spice v15 03/21] streaming: Add a GStreamer 1.0 MJPEG video encoder and use it by default

2016-05-30 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

Re: [Spice-devel] [spice v15 02/21] streaming: Remove the width/height encode_frame() parameters

2016-05-30 Thread Francois Gouget
On Fri, 27 May 2016, Christophe Fergeau wrote: > Hey, > > On Thu, May 26, 2016 at 05:15:56PM +0200, Francois Gouget wrote: > > encode_frame() needs the QXL_DRAW_COPY operation's SpiceCopy.src_area > > field anyway, so the width and height parameters were redundant. > > > > Signed-off-by:

Re: [Spice-devel] [PATCH spice-gtk v4 3/8] spice-uri: Add missing include

2016-05-30 Thread Marc-André Lureau
Hi - Original Message - > Hi Marc-André, > > On Mon, 2016-05-30 at 11:54 -0400, Marc-André Lureau wrote: > > Hi > > > > - Original Message - > > > Related: rhbz#1335239 > > > > include header, but what for? > > It should be included otherwise changing a declaration in

Re: [Spice-devel] [PATCH spice-gtk v4 3/8] spice-uri: Add missing include

2016-05-30 Thread Pavel Grunt
Hi Marc-André, On Mon, 2016-05-30 at 11:54 -0400, Marc-André Lureau wrote: > Hi > > - Original Message - > > Related: rhbz#1335239 > > include header, but what for? It should be included otherwise changing a declaration in spice-uri-priv.h will not require changing the corresponding

Re: [Spice-devel] [PATCH spice-gtk v4 3/8] spice-uri: Add missing include

2016-05-30 Thread Marc-André Lureau
Hi - Original Message - > Related: rhbz#1335239 include header, but what for? Shouldn't it be merged with some other patch? > --- > src/spice-uri.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/spice-uri.c b/src/spice-uri.c > index 8cf870d..3bdb502 100644 > ---

[Spice-devel] [PATCH spice-gtk v4 6/8] spice-uri: Check if port is in allowed range

2016-05-30 Thread Pavel Grunt
Use g_ascii_strtoll because it helps to detect overflow. Related: rhbz#1335239 --- src/spice-uri.c| 8 ++-- tests/test-spice-uri.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/spice-uri.c b/src/spice-uri.c index ea25aaa..7eec6e5 100644 ---

[Spice-devel] [PATCH spice-gtk v4 7/8] spice-uri: Validate uri scheme

2016-05-30 Thread Pavel Grunt
Related: rhbz#1335239 --- src/spice-uri.c| 26 -- tests/test-spice-uri.c | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/spice-uri.c b/src/spice-uri.c index 7eec6e5..83ebe79 100644 --- a/src/spice-uri.c +++ b/src/spice-uri.c @@ -109,7

[Spice-devel] [PATCH spice-gtk v4 8/8] spice-uri: Add ipv6 support

2016-05-30 Thread Pavel Grunt
Just basic support - http://user:password@[host]:port Resolves: rhbz#1335239 --- src/spice-uri.c| 24 +++--- tests/test-spice-uri.c | 90 +- 2 files changed, 87 insertions(+), 27 deletions(-) diff --git a/src/spice-uri.c

[Spice-devel] [PATCH spice-gtk v4 5/8] spice-uri: Do not allow empty port string

2016-05-30 Thread Pavel Grunt
Related: rhbz#1335239 --- src/spice-uri.c| 3 +++ tests/test-spice-uri.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/spice-uri.c b/src/spice-uri.c index 9f793de..ea25aaa 100644 --- a/src/spice-uri.c +++ b/src/spice-uri.c @@ -176,6 +176,9 @@ gboolean spice_uri_parse(SpiceURI

[Spice-devel] [PATCH spice-gtk v4 2/8] spice-uri: Mark parameter as unused

2016-05-30 Thread Pavel Grunt
--- src/spice-uri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spice-uri.c b/src/spice-uri.c index e1317bd..8cf870d 100644 --- a/src/spice-uri.c +++ b/src/spice-uri.c @@ -340,7 +340,7 @@ static void spice_uri_finalize(GObject* obj) G_OBJECT_CLASS

[Spice-devel] [PATCH spice-gtk v4 3/8] spice-uri: Add missing include

2016-05-30 Thread Pavel Grunt
Related: rhbz#1335239 --- src/spice-uri.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spice-uri.c b/src/spice-uri.c index 8cf870d..3bdb502 100644 --- a/src/spice-uri.c +++ b/src/spice-uri.c @@ -22,6 +22,7 @@ #include "spice-client.h" #include "spice-uri.h" +#include

[Spice-devel] [PATCH spice-gtk v4 4/8] spice-uri: Reset SpiceUri before parsing

2016-05-30 Thread Pavel Grunt
Avoid using old values after parsing a new uri. Related: rhbz#1335239 --- src/spice-uri.c| 17 + tests/test-spice-uri.c | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/spice-uri.c b/src/spice-uri.c index 3bdb502..9f793de 100644 ---

[Spice-devel] [PATCH spice-gtk v4 0/8] Allow ipv6 proxy url

2016-05-30 Thread Pavel Grunt
Hi, these patches add ipv6 support to SpiceUri, so it can be used in SPICE_PROXY. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1335239 v4 contains changes suggested by Christophe, Victor, Frediano: - Added check for scheme - Tests check for error messages - Port 0 is considered

[Spice-devel] [PATCH spice-gtk v4 1/8] tests: Add test for SpiceUri

2016-05-30 Thread Pavel Grunt
Related: rhbz#1335239 --- tests/Makefile.am | 2 ++ tests/test-spice-uri.c | 93 ++ 2 files changed, 95 insertions(+) create mode 100644 tests/test-spice-uri.c diff --git a/tests/Makefile.am b/tests/Makefile.am index c1d95c1..fb97138 100644

Re: [Spice-devel] [spice-gtk v3 00/16] separate SpiceFileTransferTask logic from channel-main

2016-05-30 Thread Victor Toso
Hi, One could test this with the following branch: https://cgit.freedesktop.org/~victortoso/spice-gtk/log/?h=move-xfer Cheers, toso On Mon, May 30, 2016 at 11:54:56AM +0200, Victor Toso wrote: > v2->v3 > * rebased > * pushed v2 01/16 ~ 349a52ca2d6af4 - acked by Pavel and Jonathon > * split v2

[Spice-devel] [spice-gtk v3 15/16] tests: file-transfer cancel on read file

2016-05-30 Thread Victor Toso
--- tests/file-transfer.c | 49 + 1 file changed, 49 insertions(+) diff --git a/tests/file-transfer.c b/tests/file-transfer.c index d8dcf6c..be4d585 100644 --- a/tests/file-transfer.c +++ b/tests/file-transfer.c @@ -211,6 +211,47 @@

[Spice-devel] [spice-gtk v3 08/16] file-xfer: fix progress info on cancelled transfers

2016-05-30 Thread Victor Toso
Application can start multiple file-transfers in one operation and cancel a few of them while the operation is ongoing. In that case, we should remove the file-size of the transfer operation otherwise we will send incorrect progress data. Taking in consideration the split of

[Spice-devel] [spice-gtk v3 07/16] file-xfer: call user callback once per operation

2016-05-30 Thread Victor Toso
SpiceFileTransferTask has a callback to be called when operation ended. Til this patch, we were setting the user callback which means that in multiple file-transfers, we were calling the user callback several times. Following the same logic pointed from 113093dd00a1cf10f6d3c3589b7 this is a

[Spice-devel] [spice-gtk v3 11/16] tests: file-transfer include simple tests

2016-05-30 Thread Victor Toso
This only includes a simple test for file-transfer with a small summary of the possible situations of the test. As the test is specifically for SpiceFileTransferTask, we don't create a SpiceMainChannel. That could cause a simple crash on CHANNEL_DEBUG which this patch addresses. ---

[Spice-devel] [spice-gtk v3 13/16] channel: avoid crash on spice_channel_wakeup due NULL channel

2016-05-30 Thread Victor Toso
--- src/spice-channel.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spice-channel.c b/src/spice-channel.c index c555f75..8b159f4 100644 --- a/src/spice-channel.c +++ b/src/spice-channel.c @@ -1891,7 +1891,10 @@ error: G_GNUC_INTERNAL void

[Spice-devel] [spice-gtk v3 09/16] file-xfer: move to spice-file-transfer-task.c

2016-05-30 Thread Victor Toso
Previous six patches are related to this change. This patch moves: * GObject boilerplate * External API related to SpiceFileTransferTask * Internal API needed by channel-main * Helpers that belong to this object --- src/Makefile.am | 2 + src/channel-main.c

[Spice-devel] [spice-gtk v3 12/16] tests: file-transfer cancel on task start

2016-05-30 Thread Victor Toso
--- tests/file-transfer.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/tests/file-transfer.c b/tests/file-transfer.c index 5ef11a7..1421f1e 100644 --- a/tests/file-transfer.c +++ b/tests/file-transfer.c @@ -144,6 +144,32 @@ test_simple_transfer(Fixture

[Spice-devel] [spice-gtk v3 16/16] tests: file-transfer agent send error/cancel

2016-05-30 Thread Victor Toso
Agent only can only send error or cancel from a transfer operation after it was initialized. In the context of SpiceFileTransferTask, it means that we need to test only after file-info was emitted. --- tests/file-transfer.c | 90 +++ 1 file changed,

[Spice-devel] [spice-gtk v3 14/16] tests: file-transfer cancel on file-info

2016-05-30 Thread Victor Toso
--- tests/file-transfer.c | 49 + 1 file changed, 49 insertions(+) diff --git a/tests/file-transfer.c b/tests/file-transfer.c index 1421f1e..d8dcf6c 100644 --- a/tests/file-transfer.c +++ b/tests/file-transfer.c @@ -170,6 +170,47 @@

[Spice-devel] [spice-gtk v3 10/16] tests: fix build with smartcard enabled

2016-05-30 Thread Victor Toso
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.

[Spice-devel] [spice-gtk v3 01/16] file-xfer: get functions for SpiceFileTransferTask

2016-05-30 Thread Victor Toso
In order to channel-main interact with each SpiceFileTransferTask for the file-transfer operation, the following functions are introduced: * spice_file_transfer_task_get_id * spice_file_transfer_task_get_channel * spice_file_transfer_task_get_cancellable Note that although "id" property is public

[Spice-devel] [spice-gtk v3 02/16] file-xfer: introduce flush_callback and flush_done

2016-05-30 Thread Victor Toso
By introducing a flush_callback such as SpiceFileTransferTaskFlushCb SpiceFileTransferTask becomes agnostic on how channel-main flushes the data. The spice_file_transfer_task_flush_done() function is now introduced to tell SpiceFileTransferTask that flushing is over and we can read more data if

[Spice-devel] [spice-gtk v3 03/16] file-xfer: introduce create_tasks and start_task

2016-05-30 Thread Victor Toso
By splitting file_xfer_send_start_msg_async we can separate in three different steps the spice_main_file_copy_async function: 1-) Creating tasks with spice_file_transfer_task_create_tasks which now returns a GList of SpiceFileTransferTask; 2-) Setting handlers before the SpiceFileTransferTask