Hi,<br>I've inserted the <br><br>gst_base_src_set_format((GstBaseSrc*)fakesrc,GST_FORMAT_TIME);<br><br>after creation 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> GstBuffer *buffer,<br> GstPad *pad,<br> gpointer user_data)<br>{<br> static gboolean white = FALSE;<br><br> GTimeVal gtime;<br> g_get_current_time(&gtime);
<br><br> GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);<br><br> buffer->timestamp=gstClock;<br><br> memset (GST_BUFFER_DATA (buffer), white ? 0xff : 0x0,<br> GST_BUFFER_SIZE (buffer));<br> white = !white;
<br> <br>}<br><br>But the problems persists, there isn't a 1fps as set in the caps and cpu is still 100%.<br>I can'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's for any help.<br><br>Regards.<br><br><br><div><span class="gmail_quote">2007/6/5, Tim Muller <<a href="mailto:t.i.m@zen.co.uk">
t.i.m@zen.co.uk</a>>:</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 <<a href="mailto:coronariccardo@gmail.com">
coronariccardo@gmail.com</a>> wrote :<br><br>> Hi,I'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>> it works well and display black & white images but it also<br>> use all the cpu.Is there a way to avoid this<br>> behaviour?<br><br>Two problems here:<br><br> (a) fakesrc will send a newsegment event in BYTES format,
<br> not TIME format (which you could probably work around<br> by using gst_base_src_set_format() after creating the<br> fakesrc element (needs linking against libgstbase-0.10).<br><br> (b) the example doesn't set timestamps on the buffers it
<br> 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