glimagesink: set last sample disabled if input is "external-oes"

The last sample causes error log of:
  gstglmemory.c:926:_gl_tex_copy: Cannot copy External OES textures

So we should disable last sample if the input is "external-oes".
This commit is contained in:
He Junyan 2024-05-16 14:22:42 +08:00
parent 0233a2a7cf
commit b216e1dd0c

View file

@ -1652,6 +1652,7 @@ gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
GstGLImageSink *glimage_sink;
gboolean ok;
GstVideoInfo vinfo;
GstStructure *structure;
GST_DEBUG_OBJECT (bsink, "set caps with %" GST_PTR_FORMAT, caps);
@ -1673,6 +1674,15 @@ gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
GST_GLIMAGE_SINK_UNLOCK (glimage_sink);
structure = gst_caps_get_structure (caps, 0);
if (gst_structure_has_field_typed
(structure, "texture-target", G_TYPE_STRING)) {
const gchar *str = gst_structure_get_string (structure, "texture-target");
if (g_strcmp0 (str, GST_GL_TEXTURE_TARGET_EXTERNAL_OES_STR) == 0)
gst_base_sink_set_last_sample_enabled (bsink, FALSE);
}
return ok;
}