mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-14 06:59:57 -05:00
meta: use spa_point and spa_rectangle
Change Cursor and Bitmap to what the work branch uses
This commit is contained in:
parent
8205486554
commit
39078f2abc
4 changed files with 42 additions and 32 deletions
|
|
@ -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 */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue