summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gl/gstgldownloadelement.c19
-rw-r--r--gst-libs/gst/gl/egl/gstglcontext_egl.c12
2 files changed, 21 insertions, 10 deletions
diff --git a/ext/gl/gstgldownloadelement.c b/ext/gl/gstgldownloadelement.c
index 2423dafbf..94a6e7a8e 100644
--- a/ext/gl/gstgldownloadelement.c
+++ b/ext/gl/gstgldownloadelement.c
@@ -32,8 +32,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_download_element_debug);
G_DEFINE_TYPE_WITH_CODE (GstGLDownloadElement, gst_gl_download_element,
GST_TYPE_GL_BASE_FILTER,
GST_DEBUG_CATEGORY_INIT (gst_gl_download_element_debug, "gldownloadelement",
- 0, "download element");
- );
+ 0, "download element"););
static gboolean gst_gl_download_element_get_unit_size (GstBaseTransform * trans,
GstCaps * caps, gsize * size);
@@ -161,18 +160,30 @@ static GstFlowReturn
gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt,
GstBuffer * inbuf, GstBuffer ** outbuf)
{
+ GstCaps *src_caps = gst_pad_get_current_caps (bt->srcpad);
+ GstCapsFeatures *features = NULL;
gint i, n;
*outbuf = inbuf;
+ if (src_caps)
+ features = gst_caps_get_features (src_caps, 0);
+
n = gst_buffer_n_memory (*outbuf);
for (i = 0; i < n; i++) {
GstMemory *mem = gst_buffer_peek_memory (*outbuf, i);
- if (gst_is_gl_memory (mem))
- gst_gl_memory_download_transfer ((GstGLMemory *) mem);
+ if (gst_is_gl_memory (mem)) {
+ if (!features || gst_caps_features_contains (features,
+ GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY)) {
+ gst_gl_memory_download_transfer ((GstGLMemory *) mem);
+ }
+ }
}
+ if (src_caps)
+ gst_caps_unref (src_caps);
+
return GST_FLOW_OK;
}
diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c
index 697e7fdff..1b130a896 100644
--- a/gst-libs/gst/gl/egl/gstglcontext_egl.c
+++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c
@@ -389,14 +389,14 @@ gst_gl_context_egl_create_context (GstGLContext * context,
gst_gl_context_egl_get_error_string ());
goto failure;
}
-
- if (other_context == NULL) {
- /* FIXME do we want a window vfunc ? */
+ /* FIXME do we want a window vfunc ? */
#if GST_GL_HAVE_WINDOW_X11
- if (GST_GL_IS_WINDOW_X11 (context->window)) {
- gst_gl_window_x11_create_window ((GstGLWindowX11 *) context->window);
- }
+ if (GST_GL_IS_WINDOW_X11 (context->window)) {
+ gst_gl_window_x11_create_window ((GstGLWindowX11 *) context->window);
+ }
#endif
+
+ if (other_context == NULL) {
#if GST_GL_HAVE_WINDOW_WAYLAND
if (GST_GL_IS_WINDOW_WAYLAND_EGL (context->window)) {
gst_gl_window_wayland_egl_create_window ((GstGLWindowWaylandEGL *)