summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-25 15:55:42 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-11-20 10:22:00 +0000
commitff070be68f11b934bc22ea51c6b3c66db2c4d745 (patch)
treeec2ca99c38d7654d258e946b822f93e69b681346 /server
parentf06ce6c1c45721182e88a8a580d3037489369371 (diff)
downloadspice-ff070be68f11b934bc22ea51c6b3c66db2c4d745.zip
spice-ff070be68f11b934bc22ea51c6b3c66db2c4d745.tar.gz
spice-ff070be68f11b934bc22ea51c6b3c66db2c4d745.tar.xz
worker: move stream_clip_item_unref()
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/red_worker.c14
-rw-r--r--server/stream.c12
-rw-r--r--server/stream.h6
3 files changed, 18 insertions, 14 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index ab4253d..6d974d6 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -192,16 +192,6 @@ static void red_create_surface(DisplayChannel *display, uint32_t surface_id, uin
uint32_t height, int32_t stride, uint32_t format,
void *line_0, int data_is_valid, int send_client);
-static void display_stream_clip_unref(DisplayChannel *display, StreamClipItem *item)
-{
- if (--item->refs != 0)
- return;
-
- stream_agent_unref(display, item->stream_agent);
- free(item->rects);
- free(item);
-}
-
void attach_stream(DisplayChannel *display, Drawable *drawable, Stream *stream)
{
DisplayChannelClient *dcc;
@@ -5477,7 +5467,7 @@ static void display_channel_client_release_item_after_push(DisplayChannelClient
drawable_pipe_item_unref(SPICE_CONTAINEROF(item, DrawablePipeItem, dpi_pipe_item));
break;
case PIPE_ITEM_TYPE_STREAM_CLIP:
- display_stream_clip_unref(display, (StreamClipItem *)item);
+ stream_clip_item_unref(dcc, (StreamClipItem *)item);
break;
case PIPE_ITEM_TYPE_UPGRADE:
upgrade_item_unref(display, (UpgradeItem *)item);
@@ -5520,7 +5510,7 @@ static void display_channel_client_release_item_before_push(DisplayChannelClient
break;
}
case PIPE_ITEM_TYPE_STREAM_CLIP:
- display_stream_clip_unref(display, (StreamClipItem *)item);
+ stream_clip_item_unref(dcc, (StreamClipItem *)item);
break;
case PIPE_ITEM_TYPE_STREAM_DESTROY: {
StreamAgent *agent = SPICE_CONTAINEROF(item, StreamAgent, destroy_item);
diff --git a/server/stream.c b/server/stream.c
index f242da7..a2acd3a 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -145,6 +145,18 @@ StreamClipItem *stream_clip_item_new(DisplayChannelClient* dcc, StreamAgent *age
return item;
}
+void stream_clip_item_unref(DisplayChannelClient *dcc, StreamClipItem *item)
+{
+ DisplayChannel *display = DCC_TO_DC(dcc);
+
+ if (--item->refs != 0)
+ return;
+
+ stream_agent_unref(display, item->stream_agent);
+ free(item->rects);
+ free(item);
+}
+
static int is_stream_start(Drawable *drawable)
{
return ((drawable->frames_count >= RED_STREAM_FRAMES_START_CONDITION) &&
diff --git a/server/stream.h b/server/stream.h
index 0577dc8..3627b0f 100644
--- a/server/stream.h
+++ b/server/stream.h
@@ -107,8 +107,10 @@ typedef struct StreamClipItem {
SpiceClipRects *rects;
} StreamClipItem;
-StreamClipItem *stream_clip_item_new(DisplayChannelClient* dcc,
- StreamAgent *agent);
+StreamClipItem * stream_clip_item_new (DisplayChannelClient* dcc,
+ StreamAgent *agent);
+void stream_clip_item_unref (DisplayChannelClient *dcc,
+ StreamClipItem *item);
typedef struct ItemTrace {
red_time_t time;