[Spice-commits] 5 commits - server/dcc-send.c server/dcc.c server/display-channel-private.h server/video-stream.c server/video-stream.h

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Dec 12 17:26:46 UTC 2017


 server/dcc-send.c                |   10 ++++------
 server/dcc.c                     |    8 --------
 server/display-channel-private.h |    6 ------
 server/video-stream.c            |   16 ++++++++++++----
 server/video-stream.h            |    7 +++++++
 5 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 07396a4c80786fa6de0e862c559387faf7ac1bfa
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Dec 8 15:47:08 2017 +0000

    Move RedUpgradeItem declaration in video-stream.h
    
    This structure is used to send a message related to streams.
    There are already other items defined in video-stream.h so
    move the declaration.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/display-channel-private.h b/server/display-channel-private.h
index 24fa42b1..617ce30d 100644
--- a/server/display-channel-private.h
+++ b/server/display-channel-private.h
@@ -178,12 +178,6 @@ typedef struct RedSurfaceDestroyItem {
     SpiceMsgSurfaceDestroy surface_destroy;
 } RedSurfaceDestroyItem;
 
-typedef struct RedUpgradeItem {
-    RedPipeItem base;
-    Drawable *drawable;
-    SpiceClipRects *rects;
-} RedUpgradeItem;
-
 static inline int is_equal_path(SpicePath *path1, SpicePath *path2)
 {
     SpicePathSeg *seg1, *seg2;
diff --git a/server/video-stream.h b/server/video-stream.h
index 2dfcf7bf..cf912152 100644
--- a/server/video-stream.h
+++ b/server/video-stream.h
@@ -45,6 +45,12 @@
 
 typedef struct VideoStream VideoStream;
 
+typedef struct RedUpgradeItem {
+    RedPipeItem base;
+    Drawable *drawable;
+    SpiceClipRects *rects;
+} RedUpgradeItem;
+
 typedef struct RedStreamActivateReportItem {
     RedPipeItem pipe_item;
     uint32_t stream_id;
commit b25091801c54b9cda76c0bf4c1129906d10fc839
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Dec 8 15:43:14 2017 +0000

    video-stream: Simplify update_client_playback_delay
    
    Avoid one step to retrieve reds pointer.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/video-stream.c b/server/video-stream.c
index b236774a..a4b83b4f 100644
--- a/server/video-stream.c
+++ b/server/video-stream.c
@@ -661,9 +661,8 @@ static void update_client_playback_delay(void *opaque, uint32_t delay_ms)
 {
     VideoStreamAgent *agent = opaque;
     DisplayChannelClient *dcc = agent->dcc;
-    RedChannel *channel = red_channel_client_get_channel(RED_CHANNEL_CLIENT(dcc));
     RedClient *client = red_channel_client_get_client(RED_CHANNEL_CLIENT(dcc));
-    RedsState *reds = red_channel_get_server(channel);
+    RedsState *reds = red_client_get_server(client);
 
     dcc_update_streams_max_latency(dcc, agent);
 
commit b2ade6e99663e479eca86562f18e99d5a9826406
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Dec 8 15:40:00 2017 +0000

    Simplify sending stream report activation message
    
    Store information directly in the RedStreamActivateReportItem
    making easier to marshall the message.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/dcc-send.c b/server/dcc-send.c
index 828a472f..364f3405 100644
--- a/server/dcc-send.c
+++ b/server/dcc-send.c
@@ -2308,15 +2308,13 @@ static void marshall_monitors_config(RedChannelClient *rcc, SpiceMarshaller *bas
 
 static void marshall_stream_activate_report(RedChannelClient *rcc,
                                             SpiceMarshaller *base_marshaller,
-                                            uint32_t stream_id)
+                                            RedStreamActivateReportItem *report_item)
 {
-    DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
-    VideoStreamAgent *agent = &dcc->priv->stream_agents[stream_id];
     SpiceMsgDisplayStreamActivateReport msg;
 
     red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT);
-    msg.stream_id = stream_id;
-    msg.unique_id = agent->report_id;
+    msg.stream_id = report_item->stream_id;
+    msg.unique_id = report_item->report_id;
     msg.max_window_size = RED_STREAM_CLIENT_REPORT_WINDOW;
     msg.timeout_ms = RED_STREAM_CLIENT_REPORT_TIMEOUT;
     spice_marshall_msg_display_stream_activate_report(base_marshaller, &msg);
@@ -2454,7 +2452,7 @@ void dcc_send_item(RedChannelClient *rcc, RedPipeItem *pipe_item)
         RedStreamActivateReportItem *report_item = SPICE_CONTAINEROF(pipe_item,
                                                                      RedStreamActivateReportItem,
                                                                      pipe_item);
-        marshall_stream_activate_report(rcc, m, report_item->stream_id);
+        marshall_stream_activate_report(rcc, m, report_item);
         break;
     }
     case RED_PIPE_ITEM_TYPE_GL_SCANOUT:
diff --git a/server/video-stream.c b/server/video-stream.c
index 89f94ffb..b236774a 100644
--- a/server/video-stream.c
+++ b/server/video-stream.c
@@ -759,6 +759,7 @@ void dcc_create_stream(DisplayChannelClient *dcc, VideoStream *stream)
         red_pipe_item_init(&report_pipe_item->pipe_item,
                            RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT);
         report_pipe_item->stream_id = stream_id;
+        report_pipe_item->report_id = agent->report_id;
         red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &report_pipe_item->pipe_item);
     }
 #ifdef STREAM_STATS
diff --git a/server/video-stream.h b/server/video-stream.h
index a4d14981..2dfcf7bf 100644
--- a/server/video-stream.h
+++ b/server/video-stream.h
@@ -48,6 +48,7 @@ typedef struct VideoStream VideoStream;
 typedef struct RedStreamActivateReportItem {
     RedPipeItem pipe_item;
     uint32_t stream_id;
+    uint32_t report_id;
 } RedStreamActivateReportItem;
 
 #ifdef STREAM_STATS
commit 7ed7686de1c54a76d1c79836f9562bec264a3c9d
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Dec 8 15:34:35 2017 +0000

    video-stream: Reuse display variable
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/video-stream.c b/server/video-stream.c
index 4830705f..89f94ffb 100644
--- a/server/video-stream.c
+++ b/server/video-stream.c
@@ -851,9 +851,9 @@ static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
                     stream_id, stream->current != NULL);
         rect_debug(&upgrade_area);
         if (update_area_limit) {
-            display_channel_draw_until(DCC_TO_DC(dcc), &upgrade_area, 0, update_area_limit);
+            display_channel_draw_until(display, &upgrade_area, 0, update_area_limit);
         } else {
-            display_channel_draw(DCC_TO_DC(dcc), &upgrade_area, 0);
+            display_channel_draw(display, &upgrade_area, 0);
         }
         dcc_add_surface_area_image(dcc, 0, &upgrade_area, NULL, FALSE);
     }
commit 0c5ff195adad0f42157cbf73f8348dbb7a95014b
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Dec 8 15:33:02 2017 +0000

    video-stream: Initialise VideoStreamClipItem directly
    
    Instead of just allocating in video_stream_clip_item_new and
    than have to setup properly in dcc_video_stream_agent_clip
    do all in video_stream_clip_item_new which is more consistent
    with other part of the code.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/dcc.c b/server/dcc.c
index fb5009e9..d457989b 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -630,14 +630,6 @@ static void dcc_stop(DisplayChannelClient *dcc)
 void dcc_video_stream_agent_clip(DisplayChannelClient* dcc, VideoStreamAgent *agent)
 {
     VideoStreamClipItem *item = video_stream_clip_item_new(agent);
-    int n_rects;
-
-    item->clip_type = SPICE_CLIP_TYPE_RECTS;
-
-    n_rects = pixman_region32_n_rects(&agent->clip);
-    item->rects = g_malloc(sizeof(SpiceClipRects) + n_rects * sizeof(SpiceRect));
-    item->rects->num_rects = n_rects;
-    region_ret_rects(&agent->clip, item->rects->rects, n_rects);
 
     red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &item->base);
 }
diff --git a/server/video-stream.c b/server/video-stream.c
index b45c318b..4830705f 100644
--- a/server/video-stream.c
+++ b/server/video-stream.c
@@ -184,6 +184,14 @@ VideoStreamClipItem *video_stream_clip_item_new(VideoStreamAgent *agent)
 
     item->stream_agent = agent;
     agent->stream->refs++;
+
+    item->clip_type = SPICE_CLIP_TYPE_RECTS;
+
+    int n_rects = pixman_region32_n_rects(&agent->clip);
+    item->rects = g_malloc(sizeof(SpiceClipRects) + n_rects * sizeof(SpiceRect));
+    item->rects->num_rects = n_rects;
+    region_ret_rects(&agent->clip, item->rects->rects, n_rects);
+
     return item;
 }
 


More information about the Spice-commits mailing list