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 788229 - plugins: NV12 memory:DMABuf support is broken
plugins: NV12 memory:DMABuf support is broken
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-27 09:46 UTC by Víctor Manuel Jáquez Leal
Modified: 2018-09-06 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugins: memory:DMABuf only handles planar formats (1.05 KB, patch)
2017-09-27 09:46 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2017-09-27 09:46:31 UTC
see commit message
Comment 1 Víctor Manuel Jáquez Leal 2017-09-27 09:46:35 UTC
Created attachment 360518 [details] [review]
plugins: memory:DMABuf only handles planar formats

When glimagesink negotiates the caps feature memory:DMABuf the
exported dmabufs buffers with NV12 format are not well rendered, thus
setting only planar.
Comment 2 Nicolas Dufresne (ndufresne) 2017-09-27 12:38:09 UTC
Is that slower then using NV12? How come they aren't well rendered?
Comment 3 Víctor Manuel Jáquez Leal 2017-09-28 11:53:35 UTC
Attachment 360518 [details] pushed as 8fee85e - plugins: memory:DMABuf only handles planar formats
Comment 4 Konstantin Ripak 2017-09-28 13:53:56 UTC
Actually, when I tried to render NV12 DMA buffer from vaapih264 decoder I faced with the issue that strides/offsets in GstVideoMeta are wrong. The following simplified snippet retrieves correct strides/offsets:

GstVaapiVideoMeta *meta = gst_buffer_get_vaapi_video_meta(buf);
GstVaapiSurface *surface = gst_vaapi_video_meta_get_surface(meta);
GstVaapiImage* image = gst_vaapi_surface_derive_image(surface);
VAImage va_image = {0};

gst_vaapi_image_get_image(image, &va_image))

gsize offsets[4] = {va_image.offsets[0],
                    va_image.offsets[1],
                    va_image.offsets[2],
                    0};
gint stride[4] = {va_image.pitches[0],
                  va_image.pitches[1],
                  va_image.pitches[2],
                  0};

GstVideoMeta* vmeta = gst_buffer_add_video_meta_full(outbuf,
                GST_VIDEO_FRAME_FLAG_NONE, gst_vaapi_image_get_format(image), va_image.width, va_image.height, va_image.num_planes, offsets, stride);
Comment 5 Nicolas Dufresne (ndufresne) 2017-09-28 14:34:00 UTC
Ok, that does not seem terribly complicated to fix, removing the format is fine short term, but shouldn't this bug be kept open then ?
Comment 6 Víctor Manuel Jáquez Leal 2018-09-06 10:53:48 UTC
(In reply to Nicolas Dufresne (ndufresne) from comment #5)
> Ok, that does not seem terribly complicated to fix, removing the format is
> fine short term, but shouldn't this bug be kept open then ?

Thinking about to keep open this bug, I guess it just become a duplicate of bug 779146.

I'm going to close this bug, and keep the tiled formats debate in bug 779146.