Re: [RFC PATCH spice-server v4 18/22] stream-channel: Activate streaming report from client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 25 Aug 2017, at 11:54, Frediano Ziglio <fziglio@xxxxxxxxxx> wrote:
> 
> Setting the capability is not enough, each stream must be enabled
> so do so if client support them.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
> server/stream-channel.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
> 
> diff --git a/server/stream-channel.c b/server/stream-channel.c
> index 34c8a351..a0915e59 100644
> --- a/server/stream-channel.c
> +++ b/server/stream-channel.c
> @@ -27,6 +27,7 @@
> #include "reds.h"
> #include "common-graphics-channel.h"
> #include "display-limits.h"
> +#include "stream.h" // TODO remove, put common stuff
> 
> #define TYPE_STREAM_CHANNEL_CLIENT stream_channel_client_get_type()
> 
> @@ -93,6 +94,7 @@ enum {
>     RED_PIPE_ITEM_TYPE_STREAM_CREATE,
>     RED_PIPE_ITEM_TYPE_STREAM_DATA,
>     RED_PIPE_ITEM_TYPE_STREAM_DESTROY,
> +    RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT,
> };
> 
> typedef struct StreamCreateItem {
> @@ -223,6 +225,20 @@ stream_channel_send_item(RedChannelClient *rcc, RedPipeItem *pipe_item)
>         spice_marshall_msg_display_stream_create(m, &item->stream_create);
>         break;
>     }
> +    case RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT: {
> +        if (client->stream_id < 0

For my education, what does stream_id<0 correspond to?

> +            || !red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_STREAM_REPORT)) {
> +            return;
> +        }
> +        SpiceMsgDisplayStreamActivateReport msg;
> +        msg.stream_id = client->stream_id;
> +        msg.unique_id = 1; // TODO useful ?
> +        msg.max_window_size = RED_STREAM_CLIENT_REPORT_WINDOW;
> +        msg.timeout_ms = RED_STREAM_CLIENT_REPORT_TIMEOUT;
> +        red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT);
> +        spice_marshall_msg_display_stream_activate_report(m, &msg);
> +        break;
> +    }
>     case RED_PIPE_ITEM_TYPE_STREAM_DATA: {
>         StreamDataItem *item = SPICE_UPCAST(StreamDataItem, pipe_item);
>         red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_DATA);
> @@ -458,6 +474,9 @@ stream_channel_change_format(StreamChannel *channel, const StreamMsgFormat *fmt)
>     item->stream_create.clip = (SpiceClip) { SPICE_CLIP_TYPE_NONE, NULL };
>     red_channel_pipes_new_add(red_channel, pipe_item_new_ref, item);
>     red_pipe_item_unref(&item->base);
> +
> +    // activate stream report if possible
> +    red_channel_pipes_add_type(red_channel, RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT);
> }
> 
> static inline void
> -- 
> 2.13.5
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]