[Spice-devel] [PATCH v1 08/10] DCC: remove more init_send_data() arguments

Jonathon Jongsma jjongsma at redhat.com
Wed Dec 14 16:36:43 UTC 2016


---
 server/dcc-send.c | 17 ++++++++++++-----
 server/spicevmc.c |  4 ++--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/server/dcc-send.c b/server/dcc-send.c
index edeea62..db42ab8 100644
--- a/server/dcc-send.c
+++ b/server/dcc-send.c
@@ -1118,7 +1118,7 @@ static void red_marshall_qxl_copy_bits(RedChannelClient *rcc,
     RedDrawable *drawable = item->red_drawable;
     SpicePoint copy_bits;
 
-    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_COPY_BITS, &dpi->dpi_pipe_item);
+    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_COPY_BITS, NULL);
     fill_base(base_marshaller, item);
     copy_bits = drawable->u.copy_bits.src_pos;
     spice_marshall_Point(base_marshaller,
@@ -1897,6 +1897,12 @@ static void display_channel_marshall_reset_cache(RedChannelClient *rcc,
                                                  &wait);
 }
 
+static void marshaller_free_pipe_item(uint8_t *data, void *opaque)
+{
+    RedPipeItem *item = opaque;
+    red_pipe_item_unref(item);
+}
+
 static void red_marshall_image(RedChannelClient *rcc,
                                SpiceMarshaller *m,
                                RedImageItem *item)
@@ -1933,7 +1939,7 @@ static void red_marshall_image(RedChannelClient *rcc,
     chunks = spice_chunks_new_linear(item->data, bitmap.stride * bitmap.y);
     bitmap.data = chunks;
 
-    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_COPY, &item->base);
+    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_COPY, NULL);
 
     copy.base.surface_id = item->surface_id;
     copy.base.box.left = item->pos.x;
@@ -1984,8 +1990,9 @@ static void red_marshall_image(RedChannelClient *rcc,
 
         spice_marshall_Image(src_bitmap_out, &red_image,
                              &bitmap_palette_out, &lzplt_palette_out);
-        spice_marshaller_add_by_ref(src_bitmap_out, item->data,
-                                    bitmap.y * bitmap.stride);
+        spice_marshaller_add_by_ref_full(src_bitmap_out, item->data,
+                                         bitmap.y * bitmap.stride,
+                                         marshaller_free_pipe_item, item);
         region_remove(surface_lossy_region, &copy.base.box);
     }
     spice_chunks_destroy(chunks);
@@ -2170,7 +2177,7 @@ static void marshall_stream_clip(RedChannelClient *rcc,
 
     spice_return_if_fail(agent->stream);
 
-    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_CLIP, &item->base);
+    red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_CLIP, NULL);
     SpiceMsgDisplayStreamClip stream_clip;
 
     stream_clip.id = display_channel_get_stream_id(DCC_TO_DC(dcc), agent->stream);
diff --git a/server/spicevmc.c b/server/spicevmc.c
index 521a540..4f93ca4 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -652,8 +652,8 @@ static void spicevmc_red_channel_send_data(RedChannelClient *rcc,
         spice_marshall_SpiceMsgCompressedData(m, &compressed_msg);
     }
     red_pipe_item_ref(item);
-    spice_marshaller_add_by_ref(m, i->buf, i->buf_used,
-                                marshaller_free_pipe_item, item);
+    spice_marshaller_add_by_ref_full(m, i->buf, i->buf_used,
+                                     marshaller_free_pipe_item, item);
 }
 
 static void spicevmc_red_channel_send_migrate_data(RedChannelClient *rcc,
-- 
2.7.4



More information about the Spice-devel mailing list