Thank's for the first answer...<br>For the usage of fakesrc simply I've done this:<br><br>static void cb_handoff (GstElement *fakesrc,<br> GstBuffer *buffer,<br> GstPad *pad,<br> gpointer user_data)
<br>{<br> <br> pad->caps= gst_caps_new_simple ("video/mpeg",<br> "width", G_TYPE_INT, 720,<br> "height", G_TYPE_INT, 288,<br> "framerate",GST_TYPE_FRACTION,1,1,
<br> "mpegversion",G_TYPE_INT,4,<br> "systemstream",G_TYPE_BOOLEAN,false);<br> gst_buffer_set_caps(buffer,pad->caps);<br><br><br><br> //Calling a function that give me an mpeg4 packet ("myMP4packet") with timestamp its ("myTS")
<br> <br> buffer->timestamp=myTS;<br><br> GST_BUFFER_MALLOCDATA(buffer) = (unsigned char*)g_memdup(myMP4packet->pixel_ptr, myMP4packet->dimension);<br><br> GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);
<br> GST_BUFFER_SIZE(buffer) = myMP4packet->dimension;<br> buffer->offset=(unsigned int)(buffer->malloc_data);<br> buffer->offset_end=(unsigned int)(buffer->malloc_data+buffer->size);<br><br>
}<br><br><br>Since it works well only for the first frame, it receive the mpeg4 packet and print it on the directdraw sink, my greater problem is on the buffer->duration (now is set to GST_CLOCK_TIME_NONE).<br>Moreover I can't understand if I need to interact in some way with the "GstElement *fakesrc".
<br><br><br><div><span class="gmail_quote">2007/6/4, René Stadler <<a href="mailto:mail@renestadler.de">mail@renestadler.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am Montag, den 04.06.2007, 12:46 +0200 schrieb Riccardo Corona:<br>> Hi,<br>> I've a fakesrc handoff function like this in which I get mpeg4 packet<br>> from the net:<br>><br>> static void cb_handoff (GstElement *fakesrc,
<br>> GstBuffer *buffer,<br>> GstPad *pad,<br>> gpointer user_data)<br>> {<br>> ......<br>> }<br>><br>><br>> And here's my doubts:<br>><br>> 1)The buffer->caps is null, even if i set a capsfilter between my
<br>> fakesrc and the next element in the pipeline, I think that it must be<br>> set but if I try something like this:<br>><br>> ..........<br>> pad->caps= gst_caps_new_simple ("video/mpeg",<br>
> "width", G_TYPE_INT, 720,<br>> "height", G_TYPE_INT, 288,<br>> "framerate",GST_TYPE_FRACTION,1,1,<br>> "mpegversion",G_TYPE_INT,4,<br>> "systemstream",G_TYPE_BOOLEAN,false);
<br>> gst_buffer_set_caps(buffer,pad->caps);<br>> .........<br>><br>You shouldn't set pad->caps.<br>><br>> or like this:<br>><br>><br>> .........<br>> GstPad *myPad;<br>> myPad->caps= gst_caps_new_simple ("video/mpeg",
<br>> "width", G_TYPE_INT, 720,<br>> "height", G_TYPE_INT, 288,<br>> "framerate",GST_TYPE_FRACTION,1,1,<br>> "mpegversion",G_TYPE_INT,4,<br>
> "systemstream",G_TYPE_BOOLEAN,false);<br>> gst_buffer_set_caps(buffer,myPad->caps);<br>> ............<br>><br>> My app crash at the gst_caps_new_simple execution.It's hard for me to
<br>> say why it crash but my first problem is to understand if is necessary<br>> to set the cap (I think yes) and moreover what can be the utility of<br>> the pads into the handoff function.<br><br>You seem to ignore an important compiler warning which tells you that
<br>you are missing the sentinel. Append NULL to the argument list.<br><br>> 2)In my handoff I've compressed data since I get mpeg4 packets so the<br>> buffer->offset would be the byte offset of the first byte in
<br>> buffer->malloc, is it right?Is it necessary to set manually the offset<br>> and offset_end or is it done automatically?Offset have strange values<br>> since it starts from 1 but after a few cycle it increments to much
<br>> greater values (1,2,3,4,8456,12345...) and offset_end isn't set.<br>> I really can't understand these two vars.<br>><br>> Any help will be very appreciate.<br>> Thank's and best regards.<br>
><br>> --<br>> Riccardo Corona<br><br>Figuring out how you are supposed to interact with fakesrc is so hard<br>because you are not supposed to do it -- have a look at the new appsrc<br>element (found in gst-plugins-bad) or write your own GstBaseSrc or
<br>GstPushSrc derived element.<br><br>--<br>Regards,<br> René Stadler<br><br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Corona