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 635304 - [opencv] fix caps issues and extend supported caps for some elements [PATCH]
[opencv] fix caps issues and extend supported caps for some elements [PATCH]
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-19 20:31 UTC by Josh Doe
Modified: 2010-11-23 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix and extend caps for opencv elements (16.36 KB, patch)
2010-11-19 20:31 UTC, Josh Doe
needs-work Details | Review

Description Josh Doe 2010-11-19 20:31:24 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.
Comment 1 Thiago Sousa Santos 2010-11-22 21:33:38 UTC
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?
Comment 2 Josh Doe 2010-11-22 21:50:19 UTC
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.
Comment 3 Thiago Sousa Santos 2010-11-22 22:22:14 UTC
Good, could reproduce the problem easily here. Will finish the patch and push.
Comment 4 Thiago Sousa Santos 2010-11-23 01:40:02 UTC
Thanks for your patch, pushed it as:

commit 6e43f75df3340fca4b9d084c51933a191f7737e2
Author: Josh Doe <josh@joshdoe.com>
Date:   Fri Nov 19 15:23:41 2010 -0500