GNOME Bugzilla – Bug 781204
rawvideoparse: Looses GstVideoMeta while doing memory alignment
Last modified: 2017-06-21 17:13:10 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.
Do you think you can craft a test raw image ? I can test bgra, nv12, yuyv here.
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.
Is this still an issues with 1.12+ A lot of fixes around stride management has been done.
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?
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.
Just retitled to reflect the actual bug.
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.
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 on attachment 353627 [details] [review] rawvideoparse: Fix missing VideoMeta Attachment 353627 [details] pushed as cc28e7c - rawvideoparse: Fix missing VideoMeta
Also in 1.12 as dc2c19efad87646fb934d9f2614cb4761b503cbe I have tested on DB410c with kmssink and it renders cleanly.
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.
But it looks that the plane-offsets doesn't work with the latest git today. I miss the alignment last time.
Sorry, both NV12 and rockchip special 10bit format works. It is my fault of using yocto not clean up. Thanks Nicolas.
Haha, yeah, I know how Yocto is great at producing broken builds if you don't wipe ;-)