Hi Umakant,<div><br></div><div>In function '<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">g_timeout_add</span>' you pass the duration for which you want to run your pipeline,</div>
<div><br></div><div>On timeout you exit from main loop, you don't need to seek. seek will not exit from main loop and will continue to run till it reaches EOS.</div><div><br></div><div>I have tested the exit using the code as given below</div>
<div><br></div><div><div>static gboolean cb_print_position (GMainLoop *loop)</div><div>{</div><div> g_main_loop_quit(loop);</div><div> return TRUE;</div><div>}</div></div><div><br></div><div>gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);</div>
<div><div>g_timeout_add (1000, (GSourceFunc) cb_print_position, playerloop);</div><div>g_main_loop_run(playerloop);</div></div><div><br></div><div>Correct me If I'm wrong, you want to play a stream for a X duration of time and then exit correct.</div>
<div><br></div><div>Then above code will work for you.</div><div><br></div><div>With Warm Regards</div><div>Jesu Anuroop Suresh <br><br>"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."<br>
"Anyone who has never made a mistake has never tried anything new."<br><br><br><br><br>
<br><br><div class="gmail_quote">On Mon, Jan 17, 2011 at 12:15 PM, Umakant Goyal <span dir="ltr"><<a href="mailto:umakantgoyal1@gmail.com">umakantgoyal1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
Thanks, As i mentioned in my last reply i have also tried to give time<br>
unit as nanosecond. But it did not work for me.<br>
<br>
It would be great if you can help me by telling what i am doing wrong<br>
in seek method to specify the duration of pipeline.<br>
<br>
Thanks<br>
<div><div></div><div class="h5"><br>
On 1/17/11, Anuroop Jesu <<a href="mailto:jesuas@gmail.com">jesuas@gmail.com</a>> wrote:<br>
> Hi Umakant,<br>
><br>
> Below code should solve your problem<br>
><br>
> static gboolean<br>
> cb_end_stream (GstElement *pipeline)<br>
> {<br>
> g_main_loop_quit(loop);<br>
> }<br>
> return TRUE;<br>
> }<br>
><br>
><br>
> Have the above function in your code and add "g_timeout_add" with required<br>
> value before you do run on main loop.<br>
><br>
> gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);<br>
> g_timeout_add (1000, (GSourceFunc) cb_print_position, pipeline);<br>
> g_main_loop_run(playerloop);<br>
><br>
> With Warm Regards<br>
> Jesu Anuroop Suresh<br>
><br>
> "Any intelligent fool can make things bigger, more complex, and more<br>
> violent. It takes a touch of genius -- and a lot of courage -- to move in<br>
> the opposite direction."<br>
> "Anyone who has never made a mistake has never tried anything new."<br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Mon, Jan 17, 2011 at 11:06 AM, sudarshan bisht <<a href="mailto:bisht.sudarshan@gmail.com">bisht.sudarshan@gmail.com</a><br>
>> wrote:<br>
><br>
>> Time should be in nano-seconds .<br>
>><br>
>> For more info;<br>
>><br>
>> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html</a><br>
>> <<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html</a>><br>
>><br>
>> On Mon, Jan 17, 2011 at 1:04 AM, Umakant Goyal<br>
>> <<a href="mailto:umakantgoyal1@gmail.com">umakantgoyal1@gmail.com</a>>wrote:<br>
>><br>
>>> Hi Thiago,<br>
>>><br>
>>> I tried to run pipeline for specified period of time as suggested by you.<br>
>>> But it did not work for me. I want to run pipeline for 15 seconds for<br>
>>> that i<br>
>>> have done<br>
>>><br>
>>> bool flag = gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME,<br>
>>> (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),<br>
>>> GST_SEEK_TYPE_NONE, 0, GST_SEEK_TYPE_SET, 15*GST_SECOND);<br>
>>><br>
>>> i have also tried following line of code<br>
>>><br>
>>> bool falg = gst_element_seek (vBin, 1.0, GST_FORMAT_TIME,<br>
>>> (GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),<br>
>>> GST_SEEK_TYPE_SET, 0 * 15*GST_SECOND, GST_SEEK_TYPE_SET,<br>
>>> 15*GST_SECOND);<br>
>>><br>
>>> i have run above line of code in once in READY state and once in PAUSED<br>
>>> state. I have also tried GST_MSECOND instead of GST_SECOND. But nothing<br>
>>> works for me.<br>
>>><br>
>>> Please help by telling where i am doing wrong while calling above line of<br>
>>> code.<br>
>>><br>
>>> Thanks<br>
>>><br>
>>> On Sun, Jan 16, 2011 at 2:14 AM, Thiago Sousa Santos <<br>
>>> <a href="mailto:thiago.sousa.santos@collabora.co.uk">thiago.sousa.santos@collabora.co.uk</a>> wrote:<br>
>>><br>
>>>> On Sun, 2011-01-16 at 01:12 +0530, Umakant Goyal wrote:<br>
>>>> > Hi All,<br>
>>>> ><br>
>>>> > Can i make a pipeline to run for specific period of time?<br>
>>>><br>
>>>> Yes. You can send a seek event to the pipeline with a start and a stop<br>
>>>> time. Check<br>
>>>><br>
>>>> <a href="http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-seek" target="_blank">http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-seek</a><br>
>>>><br>
>>>> --<br>
>>>> Thiago<br>
>>>><br>
>>>> ><br>
>>>> > Thanks<br>
>>>> ><br>
>>>> ><br>
>>>> ------------------------------------------------------------------------------<br>
>>>> > Protect Your Site and Customers from Malware Attacks<br>
>>>> > Learn about various malware tactics and how to avoid them. Understand<br>
>>>> > malware threats, the impact they can have on your business, and how<br>
>>>> > you<br>
>>>> > can protect your company and customers by using code signing.<br>
>>>> > <a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>
>>>> > _______________________________________________<br>
>>>> > gstreamer-devel mailing list<br>
>>>> > <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
>>>> > <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> ------------------------------------------------------------------------------<br>
>>>> Protect Your Site and Customers from Malware Attacks<br>
>>>> Learn about various malware tactics and how to avoid them. Understand<br>
>>>> malware threats, the impact they can have on your business, and how you<br>
>>>> can protect your company and customers by using code signing.<br>
>>>> <a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>
>>>> _______________________________________________<br>
>>>> gstreamer-devel mailing list<br>
>>>> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
>>>> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> ------------------------------------------------------------------------------<br>
>>> Protect Your Site and Customers from Malware Attacks<br>
>>> Learn about various malware tactics and how to avoid them. Understand<br>
>>> malware threats, the impact they can have on your business, and how you<br>
>>> can protect your company and customers by using code signing.<br>
>>> <a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>
>>> _______________________________________________<br>
>>> gstreamer-devel mailing list<br>
>>> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
>>> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
>>><br>
>>><br>
>><br>
>><br>
>> --<br>
>> Regards,<br>
>><br>
>> Sudarshan Bisht<br>
>><br>
>><br>
>> ------------------------------------------------------------------------------<br>
>> Protect Your Site and Customers from Malware Attacks<br>
>> Learn about various malware tactics and how to avoid them. Understand<br>
>> malware threats, the impact they can have on your business, and how you<br>
>> can protect your company and customers by using code signing.<br>
>> <a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>
>> _______________________________________________<br>
>> gstreamer-devel mailing list<br>
>> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
>> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
>><br>
>><br>
><br>
<br>
------------------------------------------------------------------------------<br>
Protect Your Site and Customers from Malware Attacks<br>
Learn about various malware tactics and how to avoid them. Understand<br>
malware threats, the impact they can have on your business, and how you<br>
can protect your company and customers by using code signing.<br>
<a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div>