[Spice-devel] [PATCH spice-server 05/15] Move RedStreamClipItem to dcc.c

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 20 21:13:10 UTC 2017


This is only used by the channel client, so move it out of stream.h into
dcc.c.
---
 server/dcc.c    | 23 +++++++++++++++++++++++
 server/dcc.h    |  7 +++++++
 server/stream.c | 23 -----------------------
 server/stream.h |  9 ---------
 4 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index a5f19f163..0ef2e4fcb 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -40,6 +40,29 @@ enum
     PROP_ZLIB_GLZ_STATE
 };
 
+static void red_stream_clip_item_free(RedPipeItem *base)
+{
+    g_return_if_fail(base != NULL);
+    RedStreamClipItem *item = SPICE_UPCAST(RedStreamClipItem, base);
+
+    g_return_if_fail(item->base.refcount == 0);
+
+    stream_agent_unref(item->stream_agent);
+    g_free(item->rects);
+    g_free(item);
+}
+
+static RedStreamClipItem *red_stream_clip_item_new(StreamAgent *agent)
+{
+    RedStreamClipItem *item = g_new(RedStreamClipItem, 1);
+    red_pipe_item_init_full(&item->base, RED_PIPE_ITEM_TYPE_STREAM_CLIP,
+                            red_stream_clip_item_free);
+
+    item->stream_agent = agent;
+    agent->stream->refs++;
+    return item;
+}
+
 static void on_display_video_codecs_update(GObject *gobject, GParamSpec *pspec, gpointer user_data);
 static bool dcc_config_socket(RedChannelClient *rcc);
 static void dcc_on_disconnect(RedChannelClient *rcc);
diff --git a/server/dcc.h b/server/dcc.h
index cc2526090..284e17036 100644
--- a/server/dcc.h
+++ b/server/dcc.h
@@ -203,6 +203,13 @@ void dcc_set_max_stream_bit_rate(DisplayChannelClient *dcc, uint64_t rate);
 gboolean dcc_is_low_bandwidth(DisplayChannelClient *dcc);
 GArray *dcc_get_preferred_video_codecs_for_encoding(DisplayChannelClient *dcc);
 
+typedef struct RedStreamClipItem {
+    RedPipeItem base;
+    StreamAgent *stream_agent;
+    int clip_type;
+    SpiceClipRects *rects;
+} RedStreamClipItem;
+
 G_END_DECLS
 
 #endif /* DCC_H_ */
diff --git a/server/stream.c b/server/stream.c
index 37fb64c81..7cbcb827f 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -165,29 +165,6 @@ void stream_agent_unref(StreamAgent *agent)
     stream_unref(agent->stream);
 }
 
-static void red_stream_clip_item_free(RedPipeItem *base)
-{
-    g_return_if_fail(base != NULL);
-    RedStreamClipItem *item = SPICE_UPCAST(RedStreamClipItem, base);
-
-    g_return_if_fail(item->base.refcount == 0);
-
-    stream_agent_unref(item->stream_agent);
-    g_free(item->rects);
-    g_free(item);
-}
-
-RedStreamClipItem *red_stream_clip_item_new(StreamAgent *agent)
-{
-    RedStreamClipItem *item = g_new(RedStreamClipItem, 1);
-    red_pipe_item_init_full(&item->base, RED_PIPE_ITEM_TYPE_STREAM_CLIP,
-                            red_stream_clip_item_free);
-
-    item->stream_agent = agent;
-    agent->stream->refs++;
-    return 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 6047f2ef7..607f18106 100644
--- a/server/stream.h
+++ b/server/stream.h
@@ -86,15 +86,6 @@ typedef struct StreamAgent {
 #endif
 } StreamAgent;
 
-typedef struct RedStreamClipItem {
-    RedPipeItem base;
-    StreamAgent *stream_agent;
-    int clip_type;
-    SpiceClipRects *rects;
-} RedStreamClipItem;
-
-RedStreamClipItem *   red_stream_clip_item_new                      (StreamAgent *agent);
-
 typedef struct StreamCreateDestroyItem {
     RedPipeItem base;
     StreamAgent *agent;
-- 
2.13.6



More information about the Spice-devel mailing list