Hi,<br>I&#39;ve inserted the <br><br>gst_base_src_set_format((GstBaseSrc*)fakesrc,GST_FORMAT_TIME);<br><br>after creation&nbsp; of the fakesrc element, and tried to make some timestamp issue in the callback:<br><br><br>static void
<br>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;&nbsp; static gboolean white = FALSE;<br><br>&nbsp;&nbsp;&nbsp; GTimeVal gtime;<br>&nbsp;&nbsp;&nbsp; g_get_current_time(&amp;gtime);
<br><br>&nbsp;&nbsp;&nbsp; GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);<br><br>&nbsp;&nbsp;&nbsp; buffer-&gt;timestamp=gstClock;<br><br>&nbsp;&nbsp;&nbsp; memset (GST_BUFFER_DATA (buffer), white ? 0xff : 0x0,<br>&nbsp;&nbsp;&nbsp; &nbsp; GST_BUFFER_SIZE (buffer));<br>&nbsp;&nbsp;&nbsp; white = !white;
<br>&nbsp;&nbsp; <br>}<br><br>But the problems persists, there isn&#39;t a 1fps as set in the caps and cpu is still 100%.<br>I can&#39;t understand how create a timestamp incremented 1 second by one with Glib, is there a way to do this?
<br>I wish to improve this example and then submit it the a future development of the manual.<br><br>Thank&#39;s for any help.<br><br>Regards.<br><br><br><div><span class="gmail_quote">2007/6/5, Tim Muller &lt;<a href="mailto:t.i.m@zen.co.uk">
t.i.m@zen.co.uk</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;">Riccardo Corona &lt;<a href="mailto:coronariccardo@gmail.com">
coronariccardo@gmail.com</a>&gt; wrote :<br><br>&gt; Hi,I&#39;ve tried the fakesrc example from<br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-data-spoof.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-data-spoof.html
</a><br>&gt; it works well and display black &amp; white images but it also<br>&gt; use all the cpu.Is there a way to avoid this<br>&gt; behaviour?<br><br>Two problems here:<br><br> (a) fakesrc will send a newsegment event in BYTES format,
<br>&nbsp;&nbsp;&nbsp;&nbsp; not TIME format (which you could probably work around<br>&nbsp;&nbsp;&nbsp;&nbsp; by using gst_base_src_set_format() after creating the<br>&nbsp;&nbsp;&nbsp;&nbsp; fakesrc element (needs linking against libgstbase-0.10).<br><br> (b) the example doesn&#39;t set timestamps on the buffers it
<br>&nbsp;&nbsp;&nbsp;&nbsp; pushes out in the handoff callback.<br><br>Probably not really a very good example :)<br><br>Cheers<br> -Tim<br><br><br><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Corona