Hi,<br>I'm writing a source plugin, I'm started from GstPluginTemplate to make a simple plugin that generate only B&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> * makes it a source of a stream
<br> */<br>static gboolean gst_plugin_template_get_range (GstPad *pad, guint64 offset, guint lenght, GstBuffer **buf)<br>{<br> static gboolean white=1;<br> <br> GstPluginTemplate *plug= GST_PLUGIN_TEMPLATE (GST_OBJECT_PARENT (pad) );
<br><br> GstBuffer *buffer;<br> gint size, width, height, bpp;<br> width = 320; height = 240; bpp = 16;<br> size = width * height * bpp;<br> buffer = gst_buffer_new();<br> GST_BUFFER_SIZE (buffer) = size;
<br><br> if (white)GST_BUFFER_MALLOCDATA (buffer) = g_memdup (0xff,size);<br> else GST_BUFFER_MALLOCDATA (buffer) = g_memdup (0x0,size);<br><br> white=!white;<br><br> GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer);
<br> <br><br> ts = gst_util_uint64_scale_int (frame_num * GST_SECOND, FPS_DEN, FPS_NUM);<br> next_ts = gst_util_uint64_scale_int ((frame_num + 1) * GST_SECOND, FPS_DEN, FPS_NUM);<br> <br> GST_BUFFER_TIMESTAMP (buffer) = ts;
<br> GST_BUFFER_DURATION (buffer) = next_ts-ts;<br><br> frame_num++;<br><br><br> return gst_pad_push (plug->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'm wrong.
<br>Do I must force the state of the plugin in PLAY mode?<br>Or maybe I'm wrong with the buffer management?<br><br>Any help will be very appreciate becouse I'm new to plugin writing...<br><br><br>Best Regards.<br>
<br><br><br>-- <br>Riccardo Corona