mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gl/rpi: change dispmanx attributes of existing element instead of creating a new one
I was lucky that: e1 = vc_dispmanx_element_add () eglCreateWindowSurface (e1) vc_dispmanx_element_remove (e1) e2 = vc_dispmanx_element_add () resulted in having e2 equal to e1. And also having the egl surface that does not allocate its buffers before the first draw.
This commit is contained in:
parent
9bae6a9c2e
commit
562399a71a
1 changed files with 9 additions and 7 deletions
|
@ -263,18 +263,20 @@ window_resize (GstGLWindowDispmanxEGL * window_egl, guint width, guint height)
|
|||
dispman_update = vc_dispmanx_update_start (0);
|
||||
|
||||
if (window_egl->native.element) {
|
||||
vc_dispmanx_element_remove (dispman_update, window_egl->native.element);
|
||||
}
|
||||
|
||||
vc_dispmanx_element_change_attributes (dispman_update,
|
||||
window_egl->native.element, 0x00000110, 0, 0, &dst_rect, &src_rect, 0,
|
||||
0);
|
||||
} else {
|
||||
window_egl->native.element = vc_dispmanx_element_add (dispman_update,
|
||||
window_egl->display, 0, &dst_rect, 0, &src_rect,
|
||||
DISPMANX_PROTECTION_NONE, &alpha, 0, 0);
|
||||
}
|
||||
|
||||
vc_dispmanx_update_submit_sync (dispman_update);
|
||||
|
||||
if (GST_GL_WINDOW (window_egl)->resize)
|
||||
GST_GL_WINDOW (window_egl)->
|
||||
resize (GST_GL_WINDOW (window_egl)->resize_data, width, height);
|
||||
GST_GL_WINDOW (window_egl)->resize (GST_GL_WINDOW (window_egl)->
|
||||
resize_data, width, height);
|
||||
}
|
||||
|
||||
window_egl->native.width = width;
|
||||
|
|
Loading…
Reference in a new issue