[Spice-commits] 5 commits - common/messages.h common/rect.h common/region.c common/region.h spice1.proto spice.proto spice-protocol

Yonit Halperin yhalperi at kemper.freedesktop.org
Thu May 3 04:12:12 PDT 2012


 common/messages.h |   15 ++++++++++++++-
 common/rect.h     |   32 ++++++++++++++++++++++++++++++++
 common/region.c   |   11 +++++++++++
 common/region.h   |    2 ++
 spice-protocol    |    2 +-
 spice.proto       |   19 ++++++++++++++++---
 spice1.proto      |    8 ++++++--
 7 files changed, 82 insertions(+), 7 deletions(-)

New commits:
commit 22fc0b0145876b90385c1c88923bcd72a6380812
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Tue Apr 24 08:34:30 2012 +0300

    video streaming: add support for frames of different sizes
    
    rhbz #813826, #815426
    
    Add SPICE_MSG_DISPLAY_STREAM_DATA_SIZED, for stream_data message
    that also contains the size and destination box of the data.
    The server can send such messages only to clients with
    SPICE_DISPLAY_CAP_SIZED_STREAM.

diff --git a/common/messages.h b/common/messages.h
index 106a8d3..e3677d1 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -308,13 +308,26 @@ typedef struct SpiceMsgDisplayStreamCreate {
     SpiceClip clip;
 } SpiceMsgDisplayStreamCreate;
 
-typedef struct SpiceMsgDisplayStreamData {
+typedef struct SpiceStreamDataHeader {
     uint32_t id;
     uint32_t multi_media_time;
+} SpiceStreamDataHeader;
+
+typedef struct SpiceMsgDisplayStreamData {
+    SpiceStreamDataHeader base;
     uint32_t data_size;
     uint8_t data[0];
 } SpiceMsgDisplayStreamData;
 
+typedef struct SpiceMsgDisplayStreamDataSized {
+    SpiceStreamDataHeader base;
+    uint32_t width;
+    uint32_t height;
+    SpiceRect dest;
+    uint32_t data_size;
+    uint8_t data[0];
+} SpiceMsgDisplayStreamDataSized;
+
 typedef struct SpiceMsgDisplayStreamClip {
     uint32_t id;
     SpiceClip clip;
diff --git a/spice-protocol b/spice-protocol
index 2d24f61..bf0daeb 160000
--- a/spice-protocol
+++ b/spice-protocol
@@ -1 +1 @@
-Subproject commit 2d24f61aae4f92746940fd1c0daf546c7a51dae8
+Subproject commit bf0daeb3a3c834133e781439f76b1c702470581b
diff --git a/spice.proto b/spice.proto
index 513fe87..71be9ac 100644
--- a/spice.proto
+++ b/spice.proto
@@ -591,6 +591,11 @@ struct String {
     } u @anon;
 };
 
+struct StreamDataHeader {
+	uint32 id;
+	uint32 multi_media_time;
+};
+
 channel DisplayChannel : BaseChannel {
  server:
     message {
@@ -637,10 +642,9 @@ channel DisplayChannel : BaseChannel {
     } stream_create = 122;
 
     message {
-	uint32 id;
-	uint32 multi_media_time;
+	StreamDataHeader base;
 	uint32 data_size;
-	uint8 data[data_size] @end  @nomarshal;
+	uint8 data[data_size] @end @nomarshal;
     } stream_data;
 
     message {
@@ -785,6 +789,15 @@ channel DisplayChannel : BaseChannel {
 	uint32 surface_id;
     } @ctype(SpiceMsgSurfaceDestroy) surface_destroy;
 
+    message {
+	StreamDataHeader base;
+	uint32 width;
+	uint32 height;
+	Rect dest;
+	uint32 data_size;
+	uint8 data[data_size] @end @nomarshal;
+    } stream_data_sized;
+
  client:
     message {
 	uint8 pixmap_cache_id;
diff --git a/spice1.proto b/spice1.proto
index fa2524b..2ed1058 100644
--- a/spice1.proto
+++ b/spice1.proto
@@ -533,6 +533,11 @@ struct String {
     } u @anon;
 };
 
+struct StreamDataHeader {
+	uint32 id;
+	uint32 multi_media_time;
+};
+
 channel DisplayChannel : BaseChannel {
  server:
     message {
@@ -580,8 +585,7 @@ channel DisplayChannel : BaseChannel {
     } stream_create = 122;
 
     message {
-	uint32 id;
-	uint32 multi_media_time;
+	StreamDataHeader base;
 	uint32 data_size;
 	uint32 pad_size @zero;
 	uint8 data[data_size] @end  @nomarshal;
commit 178c7eaff6fa45b9051bb4d3cf90f45ea9319f83
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Sun Apr 29 08:55:58 2012 +0300

    region: add region_extents

diff --git a/common/region.c b/common/region.c
index 30a11e3..cd9ade0 100644
--- a/common/region.c
+++ b/common/region.c
@@ -386,6 +386,17 @@ void region_ret_rects(const QRegion *rgn, SpiceRect *rects, uint32_t num_rects)
     }
 }
 
+void region_extents(const QRegion *rgn, SpiceRect *r)
+{
+    pixman_box32_t *extents;
+
+    extents = pixman_region32_extents((pixman_region32_t *)rgn);
+
+    r->left = extents->x1;
+    r->top = extents->y1;
+    r->right = extents->x2;
+    r->bottom = extents->y2;
+}
 
 int region_is_equal(const QRegion *rgn1, const QRegion *rgn2)
 {
diff --git a/common/region.h b/common/region.h
index 3eed547..4619406 100644
--- a/common/region.h
+++ b/common/region.h
@@ -41,6 +41,7 @@ void region_destroy(QRegion *rgn);
 void region_clone(QRegion *dest, const QRegion *src);
 SpiceRect *region_dup_rects(const QRegion *rgn, uint32_t *num_rects);
 void region_ret_rects(const QRegion *rgn, SpiceRect *rects, uint32_t num_rects);
+void region_extents(const QRegion *rgn, SpiceRect *r);
 
 int region_test(const QRegion *rgn, const QRegion *other_rgn, int query);
 int region_is_valid(const QRegion *rgn);
@@ -61,6 +62,7 @@ void region_remove(QRegion *rgn, const SpiceRect *r);
 
 void region_offset(QRegion *rgn, int32_t dx, int32_t dy);
 
+
 void region_dump(const QRegion *rgn, const char *prefix);
 
 SPICE_END_DECLS
commit cbf423f83334b9c623f66b0aeb41889bc2d4e69c
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Tue May 1 14:51:01 2012 +0300

    rect: add rect_debug

diff --git a/common/rect.h b/common/rect.h
index a9c1b08..f8bacf1 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -21,6 +21,7 @@
 
 #include <spice/macros.h>
 #include "draw.h"
+#include "log.h"
 
 SPICE_BEGIN_DECLS
 
@@ -85,6 +86,11 @@ static INLINE int rect_get_area(const SpiceRect *r)
     return (r->right - r->left) * (r->bottom - r->top);
 }
 
+static INLINE void rect_debug(const SpiceRect *r)
+{
+    spice_debug("(%d, %d) (%d, %d)", r->left, r->top, r->right, r->bottom);
+}
+
 SPICE_END_DECLS
 
 #ifdef __cplusplus
@@ -134,6 +140,11 @@ static inline int rect_get_area(const SpiceRect& r)
     return rect_get_area(&r);
 }
 
+static inline void rect_debug(const SpiceRect &r)
+{
+    rect_debug(&r);
+}
+
 #endif /* __cplusplus */
 
 #endif
commit ffeb6ce67735c59d90398e6e1fb47ad3022b7d5d
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Sun Apr 8 14:20:55 2012 +0300

    rect: add rect_get_area

diff --git a/common/rect.h b/common/rect.h
index 655e9e8..a9c1b08 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -80,6 +80,11 @@ static INLINE int rect_contains(const SpiceRect *big, const SpiceRect *small)
            big->top <= small->top && big->bottom >= small->bottom;
 }
 
+static INLINE int rect_get_area(const SpiceRect *r)
+{
+    return (r->right - r->left) * (r->bottom - r->top);
+}
+
 SPICE_END_DECLS
 
 #ifdef __cplusplus
@@ -124,6 +129,11 @@ static inline int rect_contains(const SpiceRect& big, const SpiceRect& small)
     return rect_contains(&big, &small);
 }
 
+static inline int rect_get_area(const SpiceRect& r)
+{
+    return rect_get_area(&r);
+}
+
 #endif /* __cplusplus */
 
 #endif
commit 2e4b6052724d4e8a1aed2acc9ad97ec1e8c7642d
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Thu Mar 29 15:49:12 2012 +0200

    rect: add rect_contains

diff --git a/common/rect.h b/common/rect.h
index a63d785..655e9e8 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -74,6 +74,12 @@ static INLINE int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
            r1->bottom - r1->top == r2->bottom - r2->top;
 }
 
+static INLINE int rect_contains(const SpiceRect *big, const SpiceRect *small)
+{
+    return big->left <= small->left && big->right >= small->right &&
+           big->top <= small->top && big->bottom >= small->bottom;
+}
+
 SPICE_END_DECLS
 
 #ifdef __cplusplus
@@ -113,6 +119,11 @@ static inline int rect_is_same_size(const SpiceRect& r1, const SpiceRect& r2)
     return rect_is_same_size(&r1, &r2);
 }
 
+static inline int rect_contains(const SpiceRect& big, const SpiceRect& small)
+{
+    return rect_contains(&big, &small);
+}
+
 #endif /* __cplusplus */
 
 #endif


More information about the Spice-commits mailing list