Is this a bug in videoscale?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is this a bug in videoscale?

Brian Michalk
In reading source code, I've found some stuff that doesn't make sense.
The following is from gstvideoscale.c, and all comments are mine.  I've
also removed a few lines of code that don't pertain to my question.

static GstFlowReturn
gst_video_scale_transform (GstBaseTransform * trans, GstBuffer * in,
     GstBuffer * out)
{
   GstVideoScale *videoscale = GST_VIDEO_SCALE (trans);
// So videoscale is a pointer to _GstVideoScale from gstvideoscale.h
...
   VSImage dest = videoscale->dest;
   VSImage src = videoscale->src;
// But here, I don't see how videoscale->dest and videoscale->src could
have been initialized.
...
   src.pixels = GST_BUFFER_DATA (in);
   dest.pixels = GST_BUFFER_DATA (out);
// so now, src gets some data populated, but videoscale->src is still
uninitialized
...
     gst_video_scale_prepare_image (videoscale->format, in,
&videoscale->src,
&src_u, &src_v, step, interlaced);
// And here we use videoscale->src, which is apparently unitialized.


------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Is this a bug in videoscale?

Tim-Philipp Müller-2
On Thu, 2011-02-03 at 16:34 -0600, Brian Michalk wrote:

> In reading source code, I've found some stuff that doesn't make sense.

(to you, presumably)

> The following is from gstvideoscale.c, and all comments are mine.  I've
> also removed a few lines of code that don't pertain to my question.
>
> static GstFlowReturn
> gst_video_scale_transform (GstBaseTransform * trans, GstBuffer * in,
>      GstBuffer * out)
> {
>    GstVideoScale *videoscale = GST_VIDEO_SCALE (trans);
> // So videoscale is a pointer to _GstVideoScale from gstvideoscale.h

Indeed.

>    VSImage dest = videoscale->dest;
>    VSImage src = videoscale->src;
> // But here, I don't see how videoscale->dest and videoscale->src could
> have been initialized.

It was most likely initialised in a different function then, most likely
the *_set_caps() function.

What makes you think these fields are uninitialized? Does valgrind
report them as such? How do you suppose things work at all if they
haven't been initialised beforehand?

You might want to have a look at a more recent version of the code, it
might be easier to make sense of. I think the version you were looking
at is more than half a year old.

 Cheers
  -Tim



------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel