GNOME Bugzilla – Bug 635304
[opencv] fix caps issues and extend supported caps for some elements [PATCH]
Last modified: 2010-11-23 01:41:38 UTC
Created attachment 174887 [details] [review] Patch to fix and extend caps for opencv elements Some elements had vague caps, such as "video/x-raw-rgb", which caused problems at least with textwrite. For other elements, the underlying OpenCV functions support more than just one image type, so I increased the number of supported caps. I created a utility function "gst_opencv_caps_from_cv_image_type", so each element creates caps directly from OpenCV image types, such as CV_8UC1 for 8-bit grayscale. This function uses gstvideo to create uniform caps.
Review of attachment 174887 [details] [review]: Patch looks good. Minor detail is that gst_element_class_add_pad_template takes an ref on the pad template, so they are being leaked. I can add the unref myself when pushing the patch. Do you have an example of launch line/app that this patch fixed?
There are several, but one of them is the following: gst-launch videotestsrc ! textwrite text="Garbled text" ! ffmpegcolorspace ! dshowvideosink This is negotiated to video/x-raw-rgb, bpp=32, due to the vague caps, though it should be bpp=24. This results in garbled text. Thanks for noticing the leak, I'll keep that in mind for future patches.
Good, could reproduce the problem easily here. Will finish the patch and push.
Thanks for your patch, pushed it as: commit 6e43f75df3340fca4b9d084c51933a191f7737e2 Author: Josh Doe <josh@joshdoe.com> Date: Fri Nov 19 15:23:41 2010 -0500