Hi,<br>I&#39;m writing a source plugin, I&#39;m started from GstPluginTemplate to make a simple plugin that generate only B&amp;W frames...<br>The problem is that with this pipeline:<br><br>mysrc ! ffmpegcolorspace ! directdrawsink
<br><br>the pipeline is blocked on PREROLLING and in debug mode I can see that the last state of my plugin is PAUSED.<br>Here the snipped of code in which I set the buffer:<br><br><br><br>/* get_range function<br>&nbsp;* makes it a source of a stream
<br>&nbsp;*/<br>static gboolean gst_plugin_template_get_range (GstPad *pad, guint64 offset, guint lenght, GstBuffer **buf)<br>{<br>&nbsp;&nbsp;&nbsp; static&nbsp; gboolean white=1;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; GstPluginTemplate *plug= GST_PLUGIN_TEMPLATE (GST_OBJECT_PARENT (pad) );
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer *buffer;<br>&nbsp; &nbsp;&nbsp;&nbsp; gint size, width, height, bpp;<br>&nbsp; &nbsp;&nbsp;&nbsp; width = 320; height = 240; bpp = 16;<br>&nbsp; &nbsp;&nbsp;&nbsp; size = width * height * bpp;<br>&nbsp; &nbsp;&nbsp;&nbsp; buffer = gst_buffer_new();<br>&nbsp; &nbsp;&nbsp;&nbsp; GST_BUFFER_SIZE (buffer) = size;
<br><br>&nbsp;&nbsp;&nbsp; if (white)GST_BUFFER_MALLOCDATA (buffer) =&nbsp; g_memdup (0xff,size);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else GST_BUFFER_MALLOCDATA (buffer) =&nbsp; g_memdup (0x0,size);<br><br>&nbsp;&nbsp;&nbsp; white=!white;<br><br>&nbsp; &nbsp;&nbsp;&nbsp; GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer);
<br>&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; ts = gst_util_uint64_scale_int (frame_num * GST_SECOND, FPS_DEN,&nbsp; FPS_NUM);<br>&nbsp;&nbsp;&nbsp; next_ts = gst_util_uint64_scale_int ((frame_num + 1) * GST_SECOND, FPS_DEN,&nbsp; FPS_NUM);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; GST_BUFFER_TIMESTAMP (buffer) = ts;
<br>&nbsp;&nbsp;&nbsp; GST_BUFFER_DURATION (buffer) = next_ts-ts;<br><br>&nbsp;&nbsp;&nbsp; frame_num++;<br><br><br>&nbsp;&nbsp;&nbsp; return gst_pad_push (plug-&gt;srcpad, buffer);<br><br>}<br clear="all"><br><br>I thought that setting the timestamp is enough to have continuosly a stream of images but it seems that I&#39;m wrong.
<br>Do I must force the state of the plugin in PLAY mode?<br>Or maybe I&#39;m wrong with the buffer management?<br><br>Any help will be very appreciate becouse I&#39;m new to plugin writing...<br><br><br>Best Regards.<br>
<br><br><br>-- <br>Riccardo Corona