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 781204 - rawvideoparse: Looses GstVideoMeta while doing memory alignment
rawvideoparse: Looses GstVideoMeta while doing memory alignment
Status: VERIFIED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.12.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-12 01:58 UTC by Randy Li (ayaka)
Modified: 2017-06-21 17:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rawvideoparse: Fix missing VideoMeta (4.42 KB, patch)
2017-06-12 19:41 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Randy Li (ayaka) 2017-04-12 01:58:00 UTC
kmssink would work with with the DMABUF since it would just use the strides and offsets from the meta data of the input buffer.
But with a upstream element like rawvideoparse which is non DMABUF there is a problem.
This problem could be solved easily, but the strides of the image buffer have been alignment with a base, the strides calculate from the video information may not be enough.
Comment 1 Nicolas Dufresne (ndufresne) 2017-04-12 02:30:02 UTC
Do you think you can craft a test raw image ? I can test bgra, nv12, yuyv here.
Comment 2 ayaka 2017-04-12 16:27:20 UTC
goo.gl/DtjSWr
Please have a try on the 00167_2304_1080.nv12,
it is the pixel data of a frame from a 1920x1080 HEVC video, the stride of this image is the 2304x1080.
I also upload a sample of the rockchip 10 bit pixel data. The width is 3840 and the height is 2160. But the stride is 4864x2160 for the plane 0.
Comment 3 Nicolas Dufresne (ndufresne) 2017-05-17 18:31:34 UTC
Is this still an issues with 1.12+ A lot of fixes around stride management has been done.
Comment 4 Randy Li (ayaka) 2017-05-18 06:23:06 UTC
My code base is git at 1.13.0.1.
The problem is still reminded. Also I have checked the source code, it seems that there is no fixup issue so on.
I am writting the v4l2 driver recently, I am be back and submit a patch for this later.
But could you confirm this issue first?
Comment 5 Nicolas Dufresne (ndufresne) 2017-06-12 14:49:52 UTC
Just test on PC:

gst-launch-1.0 filesrc location=$(pwd)/00167_2304_1080.nv12 ! rawvideoparse format=nv12 width=1920 height=1080 plane-strides="<2304,2304>" ! glimagesink

rawvideoparse did not attach any video meta. Looks like rawvideo parse is seriously broken.
Comment 6 Nicolas Dufresne (ndufresne) 2017-06-12 15:58:03 UTC
Just retitled to reflect the actual bug.
Comment 7 Nicolas Dufresne (ndufresne) 2017-06-12 16:00:35 UTC
For the details, the VideoMeta is indeed set properly in ->process, but the base class then run a memory alignment routine, which looses the GstVideoMeta. GstVideoMeta has the Memory tag set, and copying GST_BUFFER_COPY_META will ignore those meta with memory tag if there isn't also GST_BUFFER_COPY_MEMORY flag being set.
Comment 8 Nicolas Dufresne (ndufresne) 2017-06-12 19:41:05 UTC
Created attachment 353627 [details] [review]
rawvideoparse: Fix missing VideoMeta

The base class is trying to align the processed data, but it endup
removing the GstVideoMeta. That caused wrong result. Instead, just copy
from the process function with the appropriate alignment.
Comment 9 Nicolas Dufresne (ndufresne) 2017-06-12 20:02:37 UTC
Comment on attachment 353627 [details] [review]
rawvideoparse: Fix missing VideoMeta

Attachment 353627 [details] pushed as cc28e7c - rawvideoparse: Fix missing VideoMeta
Comment 10 Nicolas Dufresne (ndufresne) 2017-06-12 20:15:40 UTC
Also in 1.12 as dc2c19efad87646fb934d9f2614cb4761b503cbe

I have tested on DB410c with kmssink and it renders cleanly.
Comment 11 Randy Li (ayaka) 2017-06-14 07:17:22 UTC
Thanks, I have verified it work at rockchip platform. But I still meet problem with the vendor define format. It is maybe the other unrelated problem.
Thank you again.
Comment 12 Randy Li (ayaka) 2017-06-21 13:35:46 UTC
But it looks that the plane-offsets doesn't work with the latest git today.
I miss the alignment last time.
Comment 13 Randy Li (ayaka) 2017-06-21 14:42:30 UTC
Sorry, both NV12 and rockchip special 10bit format works.
It is my fault of using yocto not clean up.
Thanks Nicolas.
Comment 14 Nicolas Dufresne (ndufresne) 2017-06-21 17:13:10 UTC
Haha, yeah, I know how Yocto is great at producing broken builds if you don't wipe ;-)