mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
glupload: create the GstGLUpload object in ::transform_caps
Previously it was created in the init function and destroyed in ::stop, which lead to segfaults when reusing the element. Now the upload object is created in ::transform_caps if it is NULL, which is the earliest we need it. The other vfuncs already bail out if the upload object is NULL, which means that negotiation wasn't done.
This commit is contained in:
parent
35d147930d
commit
c16d57cc9a
1 changed files with 3 additions and 2 deletions
|
@ -97,8 +97,6 @@ static void
|
|||
gst_gl_upload_element_init (GstGLUploadElement * upload)
|
||||
{
|
||||
gst_base_transform_set_prefer_passthrough (GST_BASE_TRANSFORM (upload), TRUE);
|
||||
|
||||
upload->upload = gst_gl_upload_new (NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -138,6 +136,9 @@ _gst_gl_upload_element_transform_caps (GstBaseTransform * bt,
|
|||
GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);
|
||||
GstGLContext *context = GST_GL_BASE_FILTER (bt)->context;
|
||||
|
||||
if (upload->upload == NULL)
|
||||
upload->upload = gst_gl_upload_new (NULL);
|
||||
|
||||
return gst_gl_upload_transform_caps (upload->upload, context, direction, caps,
|
||||
filter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue