GNOME Bugzilla – Bug 752912
Regression: vaapidecode ! glimagesink broken since GL overlay composition
Last modified: 2015-08-16 13:39:32 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)
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.
I guess it's also not harmful for downstream caps to negotiate the meta even if it's not attached to the buffers?
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.
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;
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.
Thanks for the review :)
Missing commit reference here. Also, I already filed this bug last week as https://bugzilla.gnome.org/show_bug.cgi?id=752848 .
*** Bug 752848 has been marked as a duplicate of this bug. ***
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