[Bug 775288] opencv: base opencv video filter class does not fully implement the video filter contract

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Nov 29 17:54:48 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=775288

--- Comment #14 from Philippe Renon <philippe_renon at yahoo.fr> ---
> > 3/ Most concrete elements, do something like this:
> >     GstCvSobel *filter = GST_CV_SOBEL (base);
> > According to 2/ it should be:
> >     GstCvSobel *filter = GST_CV_SOBEL (cvfilter);
> > And better (?) :
> >     GstCvSobel *cvsobel = GST_CV_SOBEL (base);
> 
> This makes absolutely no difference. The value of the pointer is exactly the
> same. The inheritance in GObject is just a C cast combined with a type
> check. If you are certain that the type is right and require performance you
> could just do:
>       GstCvSobel *filter = (GstCvSobel *) base;

My point was not about correctness or performance, but plain naming again.

An example of how things are currently:

static GstFlowReturn
gst_cv_sobel_transform (GstOpencvVideoFilter * base, GstBuffer * buf,
    IplImage * img, GstBuffer * outbuf, IplImage * outimg)
{
  GstCvSobel *filter = GST_CV_SOBEL (base);
  ...

Good elements would have cvfilter instead of base and the cvsobel instead of
filter. What's the consensus.
I my massive patch (that I'll drop) I went ahead and renamed all "filter" to
element names (shortening some). But the changes it entails are cumbersome in
places. Line width were changed down the line, requiring many edits to keep
them under 80 chars. Btw 80 chars..., come on... ;)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.


More information about the gstreamer-bugs mailing list