Hi,<br>I&#39;ve a fakesrc handoff function like this in which I get mpeg4 packet from the net:<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>......<br>}<br><br><br>And here&#39;s my doubts:<br><br>1)The buffer-&gt;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:
<br><br>..........<br>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>gst_buffer_set_caps(buffer,pad-&gt;caps);<br clear="all">.........<br><br><br>or like this:<br><br><br>.........
<br>GstPad *myPad;<br>myPad-&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>
gst_buffer_set_caps(buffer,myPad-&gt;caps);<br>............<br><br>My app crash at the gst_caps_new_simple execution.It&#39;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.
<br><br><br>2)In my handoff I&#39;ve compressed data since I get mpeg4 packets so the buffer-&gt;offset would be the byte offset of the first byte in buffer-&gt;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&#39;t set.
<br>I really can&#39;t understand these two vars.<br><br>Any help will be very appreciate.<br>Thank&#39;s and best regards.<br><br>-- <br>Riccardo Corona