From: Munez Date: Tue, 11 Oct 2016 11:36:23 +0000 (+0530) Subject: Implemented gst_video_overlay_set_window_handle() X-Git-Tag: 1.16.2~955^2~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e49f723a079baa8a89268fd576763e7426354bb0;p=platform%2Fupstream%2Fgst-plugins-base.git Implemented gst_video_overlay_set_window_handle() https://bugzilla.gnome.org/show_bug.cgi?id=772608 --- diff --git a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c index f6bfa78..80827b9 100644 --- a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c +++ b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c @@ -95,6 +95,9 @@ gst_gl_window_dispmanx_egl_init (GstGLWindowDispmanxEGL * window_egl) window_egl->native.element = 0; window_egl->native.width = 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.y = 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); - 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); vc_dispmanx_element_remove (dispman_update, window_egl->native.element); vc_dispmanx_update_submit_sync (dispman_update); @@ -175,6 +178,21 @@ static void gst_gl_window_dispmanx_egl_set_window_handle (GstGLWindow * window, 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 diff --git a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.h b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.h index f0663e2..aa996e7 100644 --- a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.h +++ b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.h @@ -64,6 +64,7 @@ struct _GstGLWindowDispmanxEGL { uint32_t dp_height; uint32_t dp_width; EGL_DISPMANX_WINDOW_T native; + EGL_DISPMANX_WINDOW_T foreign; gint preferred_width; gint preferred_height;