glcolorconvert: error out if memory context is different than ours

This commit is contained in:
Matthew Waters 2020-02-04 14:14:38 +11:00
parent 2a4a3aa0d6
commit a171eb80d6

View file

@ -2366,6 +2366,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",
@ -2386,6 +2394,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);