summaryrefslogtreecommitdiff
path: root/spa
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2018-11-30 15:49:58 +0100
committerWim Taymans <wtaymans@redhat.com>2018-11-30 15:49:58 +0100
commit39078f2abcec18a8906e31b1caa969b15d2ddb74 (patch)
tree9482294df03f75cadfb6603ddd2a6b8db75b3d2d /spa
parent8205486554f949c509519eccc90126ed921ea991 (diff)
meta: use spa_point and spa_rectangle
Change Cursor and Bitmap to what the work branch uses
Diffstat (limited to 'spa')
-rw-r--r--spa/include/spa/buffer/meta.h19
-rw-r--r--spa/include/spa/utils/defs.h13
2 files changed, 24 insertions, 8 deletions
diff --git a/spa/include/spa/buffer/meta.h b/spa/include/spa/buffer/meta.h
index b58fc11d..553448df 100644
--- a/spa/include/spa/buffer/meta.h
+++ b/spa/include/spa/buffer/meta.h
@@ -36,6 +36,7 @@ extern "C" {
#define SPA_TYPE_META__Header SPA_TYPE_META_BASE "Header"
#define SPA_TYPE_META__VideoCrop SPA_TYPE_META_BASE "VideoCrop"
+#define SPA_TYPE_META__Bitmap SPA_TYPE_META_BASE "Bitmap"
#define SPA_TYPE_META__Cursor SPA_TYPE_META_BASE "Cursor"
/**
@@ -85,24 +86,28 @@ struct spa_meta_control {
uint32_t offset; /**< offset in buffer memory */
};
+#define spa_meta_bitmap_is_valid(m) ((m)->format != 0)
+
/**
* Bitmap information
*/
struct spa_meta_bitmap {
- uint32_t format; /**< bitmap video format */
- uint32_t width, height; /**< width and height of bitmap */
- uint32_t stride; /**< stride of bitmap data */
- uint32_t size; /**< size of bitmap data */
+ uint32_t format; /**< bitmap video format, 0 invalid */
+ struct spa_rectangle size; /**< width and height of bitmap */
+ int32_t stride; /**< stride of bitmap data */
uint32_t offset; /**< offset of bitmap data in this structure */
};
+#define spa_meta_cursor_is_valid(m) ((m)->id != 0)
+
/**
* Cursor information
*/
struct spa_meta_cursor {
- uint32_t id; /**< cursor id, SPA_ID_INVALID for no cursor */
- int32_t x, y; /**< offsets on screen */
- int32_t hotspot_x, hotspot_y; /**< offsets for hotspot in bitmap */
+ uint32_t id; /**< cursor id, 0 for no cursor */
+ uint32_t flags; /**< extra flags */
+ struct spa_point position; /**< position on screen */
+ struct spa_point hotspot; /**< offsets for hotspot in bitmap */
uint32_t bitmap_offset; /**< offset of bitmap meta in this structure */
};
diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h
index f955478b..69454cf4 100644
--- a/spa/include/spa/utils/defs.h
+++ b/spa/include/spa/utils/defs.h
@@ -52,12 +52,23 @@ enum spa_direction {
};
#define SPA_RECTANGLE(width,height) (struct spa_rectangle){ width, height }
-
struct spa_rectangle {
uint32_t width;
uint32_t height;
};
+#define SPA_POINT(x,y) (struct spa_point){ x, y }
+struct spa_point {
+ int32_t x;
+ int32_t y;
+};
+
+#define SPA_REGION(x,y,width,height) (struct spa_region){ SPA_POINT(x,y), SPA_RECTANGLE(width,height) }
+struct spa_region {
+ struct spa_point position;
+ struct spa_rectangle size;
+};
+
#define SPA_FRACTION(num,denom) (struct spa_fraction){ num, denom }
struct spa_fraction {
uint32_t num;