[Spice-devel] [spice-server 2/2] gstreamer: Add #ifdef around zero_copy()

Christophe Fergeau cfergeau at redhat.com
Wed Feb 15 08:39:50 UTC 2017


Since c3d237 "gstreamer: Avoid memory copy if strides are different" is
only needed when zero copy is disabled.
---
 server/gstreamer-encoder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
index dd2926d..bb41425 100644
--- a/server/gstreamer-encoder.c
+++ b/server/gstreamer-encoder.c
@@ -1141,6 +1141,7 @@ static int is_chunk_stride_aligned(const SpiceBitmap *bitmap, uint32_t index)
 }
 
 /* A helper for push_raw_frame() */
+#ifndef DO_ZERO_COPY
 static inline int line_copy(SpiceGstEncoder *encoder, const SpiceBitmap *bitmap,
                             uint32_t chunk_offset, uint32_t stream_stride,
                             uint32_t height, uint8_t *buffer)
@@ -1169,6 +1170,7 @@ static inline int line_copy(SpiceGstEncoder *encoder, const SpiceBitmap *bitmap,
      spice_return_val_if_fail(dst - buffer == stream_stride * height, FALSE);
      return TRUE;
 }
+#endif
 
 #ifdef DO_ZERO_COPY
 typedef struct {
-- 
2.9.3



More information about the Spice-devel mailing list