mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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>
This commit is contained in:
parent
24be7b8aae
commit
d11ba513bb
1 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue