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 752912 - Regression: vaapidecode ! glimagesink broken since GL overlay composition
Regression: vaapidecode ! glimagesink broken since GL overlay composition
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal blocker
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 752848 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-07-27 05:45 UTC by Jan Schmidt
Modified: 2015-08-16 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glupload: Check that caps contain desired caps features (4.64 KB, patch)
2015-07-27 06:39 UTC, Jan Schmidt
reviewed Details | Review
glupload: Check that caps contain desired caps features (5.79 KB, patch)
2015-07-27 07:22 UTC, Jan Schmidt
none Details | Review

Description Jan Schmidt 2015-07-27 05:45:45 UTC
gstreamer-vaapi decoding to glimagesink is broken since commit a7d1b7fcadda78e9a5ad9071634a70606f937d26 adding GstVideoOverlayCompositionMeta

If I've understood properly, the problem is that gstglupload negotiates these input/output caps:

in:
video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30000/1001

out:

video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition), format=(string)I420, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30000/1001

_raw_data_upload_accept() rejects these output caps because the caps features are not exactly equal to memory:GLMemory

gst-launch-1.0 videotestsrc ! glimagesink still works. That seems to be because it gets buffers directly from the downstream buffer pool, so it bypasses _raw_data_upload_accept() and receives GstGlMemory directly, which gstreamer-vaapi is using an internal buffer pool.

It's also an open question why gstreamer-vaapi isn't negotiating to use video/x-raw(meta:GstVideoGLTextureUploadMeta)
Comment 1 Jan Schmidt 2015-07-27 06:29:10 UTC
gst_gl_overlay_compositor_add_caps() seems the wrong API for gst_gl_upload_transform_caps(). Since glupload can't actually add a composition overlay meta where one didn't exist before, the transform_caps() function should preserve overlay composition meta while changing the memory/alloc metas, but not add it where it didn't exist before.
Comment 2 Jan Schmidt 2015-07-27 06:38:17 UTC
I guess it's also not harmful for downstream caps to negotiate the meta even if it's not attached to the buffers?
Comment 3 Jan Schmidt 2015-07-27 06:39:21 UTC
Created attachment 308196 [details] [review]
glupload: Check that caps contain desired caps features

Use 'contains' checks instead of equality checks on caps features
to allow for uploading when caps also contain GstVideoOverlayComposition
meta.
Comment 4 Matthew Waters (ystreet00) 2015-07-27 07:12:10 UTC
Review of attachment 308196 [details] [review]:

I made a very similar patch!

FWIW, it also breaks v4l2src ! glimagesink.

Feel free to push after fixing the issue below.

::: gst-libs/gst/gl/gstglupload.c
@@ +164,2 @@
   features = gst_caps_get_features (out_caps, 0);
+  if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY))

I had this for the entirety of feature checking in gl_memory_upload_accept. i.e. performing the contains on both in_caps and out_caps.

  features = gst_caps_get_features (out_caps, 0);
  if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY))
    return FALSE;

  features = gst_caps_get_features (in_caps, 0);
  if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY)
      && !gst_caps_features_contains (features,
          GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY))
    return FALSE;
Comment 5 Jan Schmidt 2015-07-27 07:22:10 UTC
Created attachment 308197 [details] [review]
glupload: Check that caps contain desired caps features

Use 'contains' checks instead of equality checks on caps features
to allow for uploading when caps also contain GstVideoOverlayComposition
meta.
Comment 6 Jan Schmidt 2015-07-27 07:23:49 UTC
Thanks for the review :)
Comment 7 Nicolas Dufresne (ndufresne) 2015-07-27 12:51:55 UTC
Missing commit reference here. Also, I already filed this bug last week as https://bugzilla.gnome.org/show_bug.cgi?id=752848 .
Comment 8 Nicolas Dufresne (ndufresne) 2015-07-27 12:52:11 UTC
*** Bug 752848 has been marked as a duplicate of this bug. ***
Comment 9 Nicolas Dufresne (ndufresne) 2015-07-27 12:59:47 UTC
Module: gst-plugins-bad
Branch: master
Commit: 45f8a272117592ed72d9e5a0923085b893fd2a1a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=45f8a272117592ed72d9e5a0923085b893fd2a1a

Author: Jan Schmidt <jan@centricular.com>
Date:   Mon Jul 27 16:36:40 2015 +1000

glupload: Check that caps contain desired caps features

Use 'contains' checks instead of equality checks on caps features
to allow for uploading when caps also contain GstVideoOverlayComposition
meta.

https://bugzilla.gnome.org/show_bug.cgi?id=752912