GNOME Bugzilla – Bug 719643
meta upload doesn't support different textures
Last modified: 2013-12-11 14:32:49 UTC
One of the thing we do in Cogl-Gst (https://git.gnome.org/browse/cogl/tree/cogl-gst/cogl-gst-video-sink.c?h=cogl-1.18) is to create a new texture for each upload. This allows the display layer to get a texture around if it wants to. The meta upload implementation in vaapi plugins doesn't work with this, it assumes the same texture will be used for every update. Attached a patch to fix this. Sadly I've noticed that after that modification we're pretty much back to the performances of software decode. I can't really see why. Unless libva reuses the previous frame to do the new frame upload. In that case, can we figure out a way to attach the previous frame at the upload time?
Created attachment 263234 [details] [review] vaapi: videometa: don't assume the same texture for every upload
(In reply to comment #0) > Sadly I've noticed that after that modification we're pretty much back to the > performances of software decode. I can't really see why. Unless libva reuses > the previous frame to do the new frame upload. In that case, can we figure out > a way to attach the previous frame at the upload time? We have to re-use the same texture backing store, instead of re-creating it at each frame. How many texture ids do you generate? Do you expect to allocate the associated storage by cogl?
This is all allocated by Cogl. Regarding the texture ids, I think they're likely to change at every upload. One thing I could do, is to keep the previous texture around until after the upload method is called.
Review of attachment 263234 [details] [review]: ::: gst/vaapi/gstvaapivideometa_texture.c @@ +55,3 @@ if (texture) { + if (gst_vaapi_texture_get_id(texture) != texture_id[0] || + gst_vaapi_object_get_display(GST_VAAPI_OBJECT(texture))) { This expression always yields TRUE due to the fact that GstVaapiTexture always has an attached display in it. i.e. != dpy was missing. :) I fixed that differently.
commit 61f6cbffc657fbe0287301018e365cd85607565c Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com> Date: Wed Dec 11 14:04:27 2013 +0100 plugins: fix GLTextureUploadMeta to work with different texture ids. The GLTextureUploadMeta implementation assumed that for each upload() sequence, the supplied texture id is always the same as the one that was previously cached into the underlying GstVaapiTexture. Cope with any texture id change the expense to recreate the underlying VA/GLX resources. https://bugzilla.gnome.org/show_bug.cgi?id=719643