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 712798 - videometa: add GstVideoGLTextureUploadMeta buffer pool option
videometa: add GstVideoGLTextureUploadMeta buffer pool option
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-21 12:09 UTC by Matthew Waters (ystreet00)
Modified: 2013-11-26 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
videometa: add GstVideoGLTextureUploadMeta buffer pool option (2.15 KB, patch)
2013-11-21 12:10 UTC, Matthew Waters (ystreet00)
committed Details | Review

Description Matthew Waters (ystreet00) 2013-11-21 12:09:16 UTC
In order to configure the meta attached to buffers, a buffer pool option for GstVideoGLTextureUploadMeta need to exist.  This is sperate to the caps feature in that an element may want/need to add the upload meta itself rather than allowing the buffer pool to.
Comment 1 Matthew Waters (ystreet00) 2013-11-21 12:10:14 UTC
Created attachment 260421 [details] [review]
videometa: add GstVideoGLTextureUploadMeta buffer pool option
Comment 2 Sebastian Dröge (slomo) 2013-11-25 11:20:27 UTC
What exactly is the use case for this?
Comment 3 Matthew Waters (ystreet00) 2013-11-25 11:25:55 UTC
As a result of gstreamer-vaapi https://bugzilla.gnome.org/show_bug.cgi?id=712558
Comment 4 Sebastian Dröge (slomo) 2013-11-25 12:37:09 UTC
Why would the one added by the element be different/better than the one added by the buffer pool? For the vaapidecode ! glimagesink case it sounds more like the decoder should use its own buffer pool.
Comment 5 Matthew Waters (ystreet00) 2013-11-25 14:15:55 UTC
vaapi already does use its own bufferpool based on vasurfaces and rejects our glbufferpool in the vaapidecode ! glimagesink case.  Currently in that case, adding the texture upload meta in the decoder results in a huge performance loss due to vaapitexture creation/deletion resulting in *MakeCurrent being called at least twice every frame.  Bug #712558 is about trying to add the meta inside a vaapi buffer pool (the current one or a new gl texture buffer pool they might decide to create).

So the problem is that the buffer pool needs to know if it needs to add texture upload meta (if the bufferpool supports it).  Whether that is by capsfeatures or the above buffer pool option was discussed on irc.  

It was argued that capsfeatures were used for negotiation and the bufferpool option falls under the category of configuring the allocation which apparently are seperate concepts.
Adding the bufferpool option falls more in line with the other videometa's (crop, alignment) which have their own bufferpool options and so has appeal from a consistency standpoint.
Also, an element might use a gst library (of a possible multiple) that provides a bufferpool (or multiple) with (or without) support for the upload meta for whatever reason.  With the bufferpool option, the element can check at runtime whether the bufferpool supports the upload meta or whether the element needs to add the meta itself because it might have more information than the bufferpool.  Total pie in the sky concept however the concept remains.  Choosing between multiple bufferpools.  e.g. EGLImage vs GL texture.
Another also, there's the option of selectively enabling the upload meta based on other parameters such as whether the OpenGL context's (or other hw-specific/API data) are (not) shared between the elements.

In short, the element knows better, let it decide.
Comment 6 Sebastian Dröge (slomo) 2013-11-25 14:23:57 UTC
So how would this be used in the vaapi problem you mentioned? I'm not sure I completely understand the problem yet as I don't see how it is related to this buffer pool configuration.

(In general I think it's a good idea to add this, independent of this use case)
Comment 7 Matthew Waters (ystreet00) 2013-11-25 22:25:31 UTC
Convenience and similarity with how the videometa enablement is currently handled in the bufferpools.
Comment 8 Sebastian Dröge (slomo) 2013-11-26 13:04:17 UTC
Ok, so that alone doesn't fix this problem and it's just for convenience? :)
Comment 9 Sebastian Dröge (slomo) 2013-11-26 13:05:20 UTC
commit 2e84acce582a33cd2268d87b969d4bacff705233
Author: Matthew Waters <ystreet00@gmail.com>
Date:   Thu Nov 21 22:54:42 2013 +1100

    videometa: add GstVideoGLTextureUploadMeta buffer pool option
    
    allows configuration of whether GstVideoGLTextureUploadMeta is
    added to buffers resulting from a buffer pool.  This is sperate
    to the caps feature in that an element may want to add the upload
    meta itself rather than allowing the buffer pool to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712798