Buffer size mismatch in custom plugin

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

Buffer size mismatch in custom plugin

AlannY-2
Hi there, my name is Alan and I have a problems with GStreamer.

I'm writing a custom video filter (as a custom plugin) (still newbie).
So, in the _chain() function I checked buffer (GstBuffer) size:

(example)
static GstFlowReturn
gst_myfilter_chain (GstPad *pad,
                     GstBuffer *buf)
{
   g_print("%d\n", buf->size);
   g_print("%d\n", width*height*3);

   return gst_pad_push (filter->srcpad, buf);
}

I got the following messages:
153600
230400

As you can see buf->size is smaller then frame size ( width*height*3 ).
Why? How can I write something in buffer if it's smaller then I
expected. I got Segmentation fault when trying to do it.

Thank you for your patient.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Buffer size mismatch in custom plugin

Tim-Philipp Müller-2
On Fri, 2008-04-11 at 11:02 +0400, AlannY wrote:

> I'm writing a custom video filter (as a custom plugin) (still newbie).
> So, in the _chain() function I checked buffer (GstBuffer) size:
>
> (example)
> static GstFlowReturn
> gst_myfilter_chain (GstPad *pad,
>                      GstBuffer *buf)
> {
>    g_print("%d\n", buf->size);
>    g_print("%d\n", width*height*3);
>
>    return gst_pad_push (filter->srcpad, buf);
> }
>
> I got the following messages:
> 153600
> 230400
>
> As you can see buf->size is smaller then frame size ( width*height*3 ).
> Why? How can I write something in buffer if it's smaller then I
> expected. I got Segmentation fault when trying to do it.

Well, what are the caps/formats involved here? RGB/YUV? Which? What are
the template caps of your plugin?

Cheers
 -Tim





-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel