[gst-devel] Questions about GstBuffer in handoff fakesrc function

Riccardo Corona coronariccardo at gmail.com
Mon Jun 4 12:46:51 CEST 2007


Hi,
I've a fakesrc handoff function like this in which I get mpeg4 packet from
the net:

static void cb_handoff (GstElement *fakesrc,
        GstBuffer  *buffer,
        GstPad     *pad,
        gpointer    user_data)
{
......
}


And here's my doubts:

1)The buffer->caps is null, even if i set a capsfilter between my fakesrc
and the next element in the pipeline, I think that it must be set but if I
try something like this:

..........
pad->caps= gst_caps_new_simple ("video/mpeg",
        "width", G_TYPE_INT, 720,
        "height", G_TYPE_INT, 288,
        "framerate",GST_TYPE_FRACTION,1,1,
        "mpegversion",G_TYPE_INT,4,
        "systemstream",G_TYPE_BOOLEAN,false);
gst_buffer_set_caps(buffer,pad->caps);
.........


or like this:


.........
GstPad *myPad;
myPad->caps= gst_caps_new_simple ("video/mpeg",
        "width", G_TYPE_INT, 720,
        "height", G_TYPE_INT, 288,
        "framerate",GST_TYPE_FRACTION,1,1,
        "mpegversion",G_TYPE_INT,4,
        "systemstream",G_TYPE_BOOLEAN,false);
gst_buffer_set_caps(buffer,myPad->caps);
............

My app crash at the gst_caps_new_simple execution.It's hard for me to say
why it crash but my first problem is to understand if is necessary to set
the cap (I think yes) and moreover what can be the utility of the pads into
the handoff function.


2)In my handoff I've compressed data since I get mpeg4 packets so the
buffer->offset would be the byte offset of the first byte in buffer->malloc,
is it right?Is it necessary to set manually the offset and offset_end or is
it done automatically?Offset have strange values since it starts from 1 but
after a few cycle it increments to much greater values
(1,2,3,4,8456,12345...) and offset_end isn't set.
I really can't understand these two vars.

Any help will be very appreciate.
Thank's and best regards.

-- 
Riccardo Corona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070604/c234d9d9/attachment.htm>


More information about the gstreamer-devel mailing list