After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788503 - fix the check for dmabuf handling in downstream
fix the check for dmabuf handling in downstream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-04 10:06 UTC by Víctor Manuel Jáquez Leal
Modified: 2017-10-21 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugins: add gst_vaapi_plugin_base_set_srcpad_can_dmabuf() (2.82 KB, patch)
2017-10-04 10:06 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapivideocontext: return the direction of gl context (3.59 KB, patch)
2017-10-04 10:06 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapivideocontext: add inline documentation (1.31 KB, patch)
2017-10-04 10:06 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugins: only dmabuf on srcpad if downstream (2.09 KB, patch)
2017-10-04 10:06 UTC, Víctor Manuel Jáquez Leal
none Details | Review
plugins: only dmabuf on srcpad if downstream (2.09 KB, patch)
2017-10-04 10:25 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2017-10-04 10:06:06 UTC
Intially the check if the sink could handle dmabuf importing, it was
in the function gst_vaapi_plugin_set_gl_context() since it was only
called by decide_allocation() vmethod, when GstGLUploadTexture feature
was negotiated.
    
Later, when the vaapi elements create their own GL context, if there
is none in the pipeline, gst_vaapi_plugin_set_gl_context() was called,
breaking the intent of the original function.

Thus dmabuf handeling in dowstream is true if the GstGLContext 
(created or shared) is capable, but not restricted to downstream.

The following patch serie fix that problem.
Comment 1 Víctor Manuel Jáquez Leal 2017-10-04 10:06:12 UTC
Created attachment 360897 [details] [review]
plugins: add gst_vaapi_plugin_base_set_srcpad_can_dmabuf()

This patch refactors the code by adding the function
vaapi_plugin_base_set_srcpad_can_dmabuf(), it determines if the passed
GstGLContext can handle dmabuf-based buffers.

The function is exposed publicly since it is intended to be used later
at GstVaapiDisplay instantiation.
Comment 2 Víctor Manuel Jáquez Leal 2017-10-04 10:06:18 UTC
Created attachment 360898 [details] [review]
vaapivideocontext: return the direction of gl context

In function gst_vaapi_find_gl_context() add a direction parameter to
return back the direction where the GstGL context was found.

This is going to be useful when checking if downstream can import
dmabuf-based buffers.
Comment 3 Víctor Manuel Jáquez Leal 2017-10-04 10:06:24 UTC
Created attachment 360899 [details] [review]
vaapivideocontext: add inline documentation

Document function gst_vaapi_find_gl_local_context().
Comment 4 Víctor Manuel Jáquez Leal 2017-10-04 10:06:37 UTC
Created attachment 360900 [details] [review]
plugins: only dmabuf on srcpad if downstream

Set if source pad can handle dmabuf only if the GstGL context comes
from downstream.

It is possible to know that at two moments:

1\ In the case of GstGLTextureUpload caps feature is negotiated and
   downstream pool reports back gst.gl.GstGLContext.

2\ When GstGLContext is found as GstContext from dowstream.
Comment 5 Víctor Manuel Jáquez Leal 2017-10-04 10:13:59 UTC
These patches also shall be merged into branch 1.12
Comment 6 Víctor Manuel Jáquez Leal 2017-10-04 10:25:04 UTC
Created attachment 360902 [details] [review]
plugins: only dmabuf on srcpad if downstream

Set if source pad can handle dmabuf only if the GstGL context comes
from downstream.

It is possible to know that at two moments:

1\ In the case of GstGLTextureUpload caps feature is negotiated and
   downstream pool reports back gst.gl.GstGLContext.

2\ When GstGLContext is found as GstContext from dowstream.
Comment 7 Víctor Manuel Jáquez Leal 2017-10-21 10:52:37 UTC
Attachment 360897 [details] pushed as 998e79c - plugins: add gst_vaapi_plugin_base_set_srcpad_can_dmabuf()
Attachment 360898 [details] pushed as 6b2b129 - vaapivideocontext: return the direction of gl context
Attachment 360899 [details] pushed as 1135e8b - vaapivideocontext: add inline documentation
Attachment 360902 [details] pushed as 0a36a70 - plugins: only dmabuf on srcpad if downstream