<div dir="ltr"><br>Hi guys. I need some help with a plugin I wrote.<br><br>It&#39;s a CURL based source plugin. I know I&#39;m reinventing the wheel but, I really need to finish this plugin and use it.<br><br>I can add a link in my next reply, but I need to know if anyone is willing to help me. The plugin works just fine, but if I need to make it repeat the request the buffer just goes crazy.<br>
<br>Here is the code that might interest you for a start (just ignore the g_print() ):<br><br>static GstFlowReturn<br>gst_curlsrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)<br>{<br>&nbsp;&nbsp;&nbsp; GstCUrlSrc *src;<br>&nbsp;&nbsp;&nbsp; src = GST_CURLSRC (psrc);<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; g_print(&quot;curl_create_start\n&quot;);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (src-&gt;buf_total)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!src-&gt;repeatread)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return GST_FLOW_UNEXPECTED;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //*<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; src-&gt;buf_size = 0;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return GST_FLOW_OK;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }//*/<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; src-&gt;outbuf = outbuf;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (src-&gt;curl) <br>&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; curl_easy_perform(src-&gt;curl);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return GST_FLOW_ERROR;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (src-&gt;repeatread) gst_buffer_ref(src-&gt;outbuf[0]);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; g_print(&quot;curl_create_end\n&quot;);<br>
<br>&nbsp;&nbsp;&nbsp; return GST_FLOW_OK;<br>}<br clear="all"><br>-- <br>----------------------------------------------------------------- <br>Cristian - Dragos, Cirjan<br>----------------------------------------------------------------- <br>
Email: <a href="mailto:dragos.cirjan@yahoo.com">dragos.cirjan@yahoo.com</a><br>Email: <a href="mailto:dragos.cirjan@itmediaconnect.ro">dragos.cirjan@itmediaconnect.ro</a>, <a href="mailto:doru@bocancul-literar.ro">doru@bocancul-literar.ro</a><br>
Telefon: +40726355762<br>
</div>