mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
Implemented gst_video_overlay_set_window_handle()
https://bugzilla.gnome.org/show_bug.cgi?id=772608
This commit is contained in:
parent
78d8e895df
commit
e49f723a07
2 changed files with 20 additions and 1 deletions
|
@ -95,6 +95,9 @@ gst_gl_window_dispmanx_egl_init (GstGLWindowDispmanxEGL * window_egl)
|
||||||
window_egl->native.element = 0;
|
window_egl->native.element = 0;
|
||||||
window_egl->native.width = 0;
|
window_egl->native.width = 0;
|
||||||
window_egl->native.height = 0;
|
window_egl->native.height = 0;
|
||||||
|
window_egl->foreign.element = 0;
|
||||||
|
window_egl->foreign.width = 0;
|
||||||
|
window_egl->foreign.height = 0;
|
||||||
window_egl->render_rect.x = 0;
|
window_egl->render_rect.x = 0;
|
||||||
window_egl->render_rect.y = 0;
|
window_egl->render_rect.y = 0;
|
||||||
window_egl->render_rect.w = 0;
|
window_egl->render_rect.w = 0;
|
||||||
|
@ -122,7 +125,7 @@ gst_gl_window_dispmanx_egl_close (GstGLWindow * window)
|
||||||
|
|
||||||
window_egl = GST_GL_WINDOW_DISPMANX_EGL (window);
|
window_egl = GST_GL_WINDOW_DISPMANX_EGL (window);
|
||||||
|
|
||||||
if (window_egl->native.element) {
|
if (window_egl->native.element && window_egl->native.element != window_egl->foreign.element) {
|
||||||
dispman_update = vc_dispmanx_update_start (0);
|
dispman_update = vc_dispmanx_update_start (0);
|
||||||
vc_dispmanx_element_remove (dispman_update, window_egl->native.element);
|
vc_dispmanx_element_remove (dispman_update, window_egl->native.element);
|
||||||
vc_dispmanx_update_submit_sync (dispman_update);
|
vc_dispmanx_update_submit_sync (dispman_update);
|
||||||
|
@ -175,6 +178,21 @@ static void
|
||||||
gst_gl_window_dispmanx_egl_set_window_handle (GstGLWindow * window,
|
gst_gl_window_dispmanx_egl_set_window_handle (GstGLWindow * window,
|
||||||
guintptr handle)
|
guintptr handle)
|
||||||
{
|
{
|
||||||
|
GstGLWindowDispmanxEGL *window_egl = GST_GL_WINDOW_DISPMANX_EGL (window);
|
||||||
|
EGL_DISPMANX_WINDOW_T *foreign_window = (EGL_DISPMANX_WINDOW_T *)handle;
|
||||||
|
DISPMANX_UPDATE_HANDLE_T dispman_update;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (window, "set window handle with size %dx%d", foreign_window->width, foreign_window->height);
|
||||||
|
|
||||||
|
if (window_egl->native.element) {
|
||||||
|
dispman_update = vc_dispmanx_update_start (0);
|
||||||
|
vc_dispmanx_element_remove (dispman_update, window_egl->native.element);
|
||||||
|
vc_dispmanx_update_submit_sync (dispman_update);
|
||||||
|
}
|
||||||
|
|
||||||
|
window_egl->native.element = window_egl->foreign.element = foreign_window->element;
|
||||||
|
window_egl->native.width = window_egl->foreign.width = foreign_window->width;
|
||||||
|
window_egl->native.height = window_egl->foreign.height = foreign_window->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -64,6 +64,7 @@ struct _GstGLWindowDispmanxEGL {
|
||||||
uint32_t dp_height;
|
uint32_t dp_height;
|
||||||
uint32_t dp_width;
|
uint32_t dp_width;
|
||||||
EGL_DISPMANX_WINDOW_T native;
|
EGL_DISPMANX_WINDOW_T native;
|
||||||
|
EGL_DISPMANX_WINDOW_T foreign;
|
||||||
|
|
||||||
gint preferred_width;
|
gint preferred_width;
|
||||||
gint preferred_height;
|
gint preferred_height;
|
||||||
|
|
Loading…
Reference in a new issue