summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-02-04 14:14:38 +1100
committerMatthew Waters <matthew@centricular.com>2020-02-11 11:40:34 +1100
commit5830a611f52918b9412929c3bd23864ac810ead5 (patch)
tree39bd0795624f898b2361c058caf71a4d836377b8
parentede466520ebcf6741ad6785ec6e10ae209ace232 (diff)
downloadgstreamer-plugins-base-5830a611f52918b9412929c3bd23864ac810ead5.tar.gz
glcolorconvert: error out if memory context is different than ours
-rw-r--r--gst-libs/gst/gl/gstglcolorconvert.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
index e73a3e52c..fe3ff4b1a 100644
--- a/gst-libs/gst/gl/gstglcolorconvert.c
+++ b/gst-libs/gst/gl/gstglcolorconvert.c
@@ -2291,6 +2291,14 @@ _do_convert_one_view (GstGLContext * context, GstGLColorConvert * convert,
res = FALSE;
goto out;
}
+ if (convert->context != convert->priv->in_tex[i]->mem.context) {
+ GST_ERROR_OBJECT (convert, "input memory OpenGL context is different. "
+ "we have %" GST_PTR_FORMAT " memory has %" GST_PTR_FORMAT,
+ convert->context, convert->priv->in_tex[i]->mem.context);
+ res = FALSE;
+ goto out;
+ }
+
if (!gst_memory_map ((GstMemory *) convert->priv->in_tex[i], &in_info[i],
GST_MAP_READ | GST_MAP_GL)) {
GST_ERROR_OBJECT (convert, "failed to map input memory %p",
@@ -2311,6 +2319,13 @@ _do_convert_one_view (GstGLContext * context, GstGLColorConvert * convert,
res = FALSE;
goto out;
}
+ if (convert->context != out_tex->mem.context) {
+ GST_ERROR_OBJECT (convert, "output memory OpenGL context is different. "
+ "we have %" GST_PTR_FORMAT " memory has %" GST_PTR_FORMAT,
+ convert->context, out_tex->mem.context);
+ res = FALSE;
+ goto out;
+ }
mem_width = gst_gl_memory_get_texture_width (out_tex);
mem_height = gst_gl_memory_get_texture_height (out_tex);