GNOME Bugzilla – Bug 775377
opencv: cvlaplace/cvsobel/edgedetect should use the already mapped outimage
Last modified: 2016-12-02 02:59:34 UTC
Those element maps again the output buffer in order to write the result. In fact, the buffer is already mapped and accessible through the IplImage. The implementation of the map also ignores VideoMeta and ignore the map return value. It's likely that we can save a copy while fixing this.
Created attachment 341194 [details] [review] cvsobel: Remove redundant CAPS event handler There is already a cv_set_caps() implemented, so just do the entire work there.
Created attachment 341195 [details] [review] cvsobel: Avoid extra copy of the output image Simply produce the result into the output image provided by the base class. This avoid useless copy. This also removes unchecked buffer map and ensure that GstVideoMeta is respected (for stride mostly).
Created attachment 341196 [details] [review] cvlaplace: Remove redundant CAPS event handler There is already a cv_set_caps() implemented, so just do the entire work there.
Created attachment 341197 [details] [review] cvlaplace: Avoid extra copy of the output image Simply produce the result into the output image provided by the base class. This avoid useless copy. This also removes unchecked buffer map and ensure that GstVideoMeta is respected (for stride mostly).
Created attachment 341198 [details] [review] edgedetect: Remove redundant CAPS event handler There is already a cv_set_caps() implemented, so just do the entire work there.
Created attachment 341199 [details] [review] edgedetect: Avoid extra copy of the output image Simply produce the result into the output image provided by the base class. This avoid useless copy. This also removes unchecked buffer map and ensure that GstVideoMeta is respected (for stride mostly).
Those also fixes error when using glimagesink right after those filters because buffers were not being unmapped. Attachment 341194 [details] pushed as 7a284f1 - cvsobel: Remove redundant CAPS event handler Attachment 341195 [details] pushed as 02b20f6 - cvsobel: Avoid extra copy of the output image Attachment 341196 [details] pushed as 50e0165 - cvlaplace: Remove redundant CAPS event handler Attachment 341197 [details] pushed as ff6ed23 - cvlaplace: Avoid extra copy of the output image Attachment 341198 [details] pushed as 63d4c89 - edgedetect: Remove redundant CAPS event handler Attachment 341199 [details] pushed as 79b7d07 - edgedetect: Avoid extra copy of the output image