Thank&#39;s for the first answer...<br>For the usage of fakesrc simply I&#39;ve done this:<br><br>static void cb_handoff (GstElement *fakesrc,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GstBuffer&nbsp; *buffer,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GstPad&nbsp;&nbsp;&nbsp;&nbsp; *pad,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gpointer&nbsp;&nbsp;&nbsp; user_data)
<br>{<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; pad-&gt;caps= gst_caps_new_simple (&quot;video/mpeg&quot;,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;width&quot;, G_TYPE_INT, 720,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;height&quot;, G_TYPE_INT, 288,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;framerate&quot;,GST_TYPE_FRACTION,1,1,
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;mpegversion&quot;,G_TYPE_INT,4,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;systemstream&quot;,G_TYPE_BOOLEAN,false);<br>&nbsp;&nbsp;&nbsp; gst_buffer_set_caps(buffer,pad-&gt;caps);<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp; //Calling a function that give me an mpeg4 packet (&quot;myMP4packet&quot;)&nbsp; with timestamp its (&quot;myTS&quot;)
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; buffer-&gt;timestamp=myTS;<br><br>&nbsp;&nbsp;&nbsp; GST_BUFFER_MALLOCDATA(buffer) =&nbsp;&nbsp;&nbsp; (unsigned char*)g_memdup(myMP4packet-&gt;pixel_ptr,&nbsp; myMP4packet-&gt;dimension);<br><br>&nbsp;&nbsp;&nbsp;&nbsp; GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);
<br>&nbsp;&nbsp;&nbsp;&nbsp; GST_BUFFER_SIZE(buffer) = myMP4packet-&gt;dimension;<br>&nbsp;&nbsp;&nbsp;&nbsp; buffer-&gt;offset=(unsigned int)(buffer-&gt;malloc_data);<br>&nbsp;&nbsp;&nbsp;&nbsp; buffer-&gt;offset_end=(unsigned int)(buffer-&gt;malloc_data+buffer-&gt;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-&gt;duration (now is set to GST_CLOCK_TIME_NONE).<br>Moreover I can&#39;t understand if I need to interact in some way with the &quot;GstElement *fakesrc&quot;.
<br><br><br><div><span class="gmail_quote">2007/6/4, René Stadler &lt;<a href="mailto:mail@renestadler.de">mail@renestadler.de</a>&gt;:</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>&gt; Hi,<br>&gt; I&#39;ve a fakesrc handoff function like this in which I get mpeg4 packet<br>&gt; from the net:<br>&gt;<br>&gt; static void cb_handoff (GstElement *fakesrc,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer&nbsp;&nbsp;*buffer,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstPad&nbsp;&nbsp;&nbsp;&nbsp; *pad,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gpointer&nbsp;&nbsp;&nbsp;&nbsp;user_data)<br>&gt; {<br>&gt; ......<br>&gt; }<br>&gt;<br>&gt;<br>&gt; And here&#39;s my doubts:<br>&gt;<br>&gt; 1)The buffer-&gt;caps is null, even if i set a capsfilter between my
<br>&gt; fakesrc and the next element in the pipeline, I think that it must be<br>&gt; set but if I try something like this:<br>&gt;<br>&gt; ..........<br>&gt; pad-&gt;caps= gst_caps_new_simple (&quot;video/mpeg&quot;,<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;width&quot;, G_TYPE_INT, 720,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;height&quot;, G_TYPE_INT, 288,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;framerate&quot;,GST_TYPE_FRACTION,1,1,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;mpegversion&quot;,G_TYPE_INT,4,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;systemstream&quot;,G_TYPE_BOOLEAN,false);
<br>&gt; gst_buffer_set_caps(buffer,pad-&gt;caps);<br>&gt; .........<br>&gt;<br>You shouldn&#39;t set pad-&gt;caps.<br>&gt;<br>&gt; or like this:<br>&gt;<br>&gt;<br>&gt; .........<br>&gt; GstPad *myPad;<br>&gt; myPad-&gt;caps= gst_caps_new_simple (&quot;video/mpeg&quot;,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;width&quot;, G_TYPE_INT, 720,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;height&quot;, G_TYPE_INT, 288,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;framerate&quot;,GST_TYPE_FRACTION,1,1,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;mpegversion&quot;,G_TYPE_INT,4,<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;systemstream&quot;,G_TYPE_BOOLEAN,false);<br>&gt; gst_buffer_set_caps(buffer,myPad-&gt;caps);<br>&gt; ............<br>&gt;<br>&gt; My app crash at the gst_caps_new_simple execution.It&#39;s hard for me to
<br>&gt; say why it crash but my first problem is to understand if is necessary<br>&gt; to set the cap (I think yes) and moreover what can be the utility of<br>&gt; 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.&nbsp;&nbsp;Append NULL to the argument list.<br><br>&gt; 2)In my handoff I&#39;ve compressed data since I get mpeg4 packets so the<br>&gt; buffer-&gt;offset would be the byte offset of the first byte in
<br>&gt; buffer-&gt;malloc, is it right?Is it necessary to set manually the offset<br>&gt; and offset_end or is it done automatically?Offset have strange values<br>&gt; since it starts from 1 but after a few cycle it increments to much
<br>&gt; greater values (1,2,3,4,8456,12345...) and offset_end isn&#39;t set.<br>&gt; I really can&#39;t understand these two vars.<br>&gt;<br>&gt; Any help will be very appreciate.<br>&gt; Thank&#39;s and best regards.<br>
&gt;<br>&gt; --<br>&gt; 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>&nbsp;&nbsp;René Stadler<br><br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Corona