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 719643 - meta upload doesn't support different textures
meta upload doesn't support different textures
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 719412
 
 
Reported: 2013-12-01 14:12 UTC by Lionel Landwerlin
Modified: 2013-12-11 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapi: videometa: don't assume the same texture for every upload (1.58 KB, patch)
2013-12-01 14:14 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2013-12-01 14:12:41 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?
Comment 1 Lionel Landwerlin 2013-12-01 14:14:39 UTC
Created attachment 263234 [details] [review]
vaapi: videometa: don't assume the same texture for every upload
Comment 2 Gwenole Beauchesne 2013-12-02 05:19:37 UTC
(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?
Comment 3 Lionel Landwerlin 2013-12-02 07:24:30 UTC
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.
Comment 4 Gwenole Beauchesne 2013-12-11 12:55:00 UTC
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.
Comment 5 Gwenole Beauchesne 2013-12-11 14:32:49 UTC
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