diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-06-18 20:25:18 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-07-31 14:02:33 +0200 |
commit | d11ba513bb7f717c45a35dd742b02fe0b2f23383 (patch) | |
tree | 4bb7ec0316063d128750741279f9f57c193b9dc7 /tests | |
parent | 24be7b8aaec7dd427652236b8d4f4af4e35024be (diff) |
test: vaapicontext: fix draw callback with multiple videos
The callback is called for both windows. So make sure that
gst_video_overlay_set_render_rectangle() is called for the correct one.
Otherwise, the left video will be randomly moved behind the right video.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/test-vaapicontext.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/examples/test-vaapicontext.c b/tests/examples/test-vaapicontext.c index 5b467956..98760dc5 100644 --- a/tests/examples/test-vaapicontext.c +++ b/tests/examples/test-vaapicontext.c @@ -307,14 +307,17 @@ draw_cb (GtkWidget * widget, cairo_t * cr, gpointer data) { AppData *app = data; GtkAllocation allocation; + int i; + + i = (widget == app->video_widget[0]) ? 0 : 1; get_allocation (widget, &allocation); - gst_println ("draw_cb x %d, y %d, w %d, h %d\n", + gst_println ("draw_cb[%d] x %d, y %d, w %d, h %d\n", i, allocation.x, allocation.y, allocation.width, allocation.height); - if (app->overlay[0]) { - gst_video_overlay_set_render_rectangle (app->overlay[0], allocation.x, + if (app->overlay[i]) { + gst_video_overlay_set_render_rectangle (app->overlay[i], allocation.x, allocation.y, allocation.width, allocation.height); } } |