Commit 8ee91bd7 authored by Wim Taymans's avatar Wim Taymans
Browse files

examples: don't hardcode dimensions for crop info

parent 1f138687
Pipeline #162782 passed with stages
in 1 minute and 36 seconds
......@@ -34,10 +34,7 @@
#include <pipewire/pipewire.h>
#define BPP 3
#define WIDTH 320
#define HEIGHT 200
#define CROP 8
#define BPP 3
#define CURSOR_WIDTH 64
#define CURSOR_HEIGHT 64
#define CURSOR_BPP 4
......@@ -132,8 +129,8 @@ static void on_timeout(void *userdata, uint64_t expirations)
data->crop = (sin(data->accumulator) + 1.0) * 32.0;
mc->region.position.x = data->crop;
mc->region.position.y = data->crop;
mc->region.size.width = WIDTH - data->crop*2;
mc->region.size.height = HEIGHT - data->crop*2;
mc->region.size.width = data->format.size.width - data->crop*2;
mc->region.size.height = data->format.size.height - data->crop*2;
}
if ((mcs = spa_buffer_find_meta_data(buf, SPA_META_Cursor, sizeof(*mcs)))) {
struct spa_meta_bitmap *mb;
......
......@@ -31,10 +31,7 @@
#include <pipewire/pipewire.h>
#define BPP 3
#define WIDTH 320
#define HEIGHT 200
#define CROP 8
#define BPP 3
#define CURSOR_WIDTH 64
#define CURSOR_HEIGHT 64
#define CURSOR_BPP 4
......@@ -132,8 +129,8 @@ static void on_timeout(void *userdata, uint64_t expirations)
data->crop = (sin(data->accumulator) + 1.0) * 32.0;
mc->region.position.x = data->crop;
mc->region.position.y = data->crop;
mc->region.size.width = WIDTH - data->crop*2;
mc->region.size.height = HEIGHT - data->crop*2;
mc->region.size.width = data->format.size.width - data->crop*2;
mc->region.size.height = data->format.size.height - data->crop*2;
}
if ((mcs = spa_buffer_find_meta_data(buf, SPA_META_Cursor, sizeof(*mcs)))) {
struct spa_meta_bitmap *mb;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment