mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
glfilter: add parent meta to output buffer for input buffer
glfilter will unref input buffer after _transform() call immidiately, but gpu may still reading input buffer for rendering because gl api is executed async. Need hold reference for input buffer by adding parent meta to output buffer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4801>
This commit is contained in:
parent
e422a991f3
commit
5716ee3513
1 changed files with 8 additions and 0 deletions
|
@ -1033,6 +1033,14 @@ gst_gl_filter_transform (GstBaseTransform * bt, GstBuffer * inbuf,
|
|||
if (out_sync_meta)
|
||||
gst_gl_sync_meta_set_sync_point (out_sync_meta, context);
|
||||
|
||||
/* since gl api is async operation, when return from transform()
|
||||
* function, basetransform will unref input buffer immidiately,
|
||||
* but gpu may still reading input buffer for rendering. Add parent
|
||||
* buffer meta to hold one reference of inbuf, this can avoid this
|
||||
* buffer sync problem.
|
||||
*/
|
||||
gst_buffer_add_parent_buffer_meta (outbuf, inbuf);
|
||||
|
||||
return ret ? GST_FLOW_OK : GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue