[gst-devel] Duration of Pipeline
Anuroop Jesu
jesuas at gmail.com
Mon Jan 17 07:35:11 CET 2011
Hi Umakant,
Below code should solve your problem
static gboolean
cb_end_stream (GstElement *pipeline)
{
g_main_loop_quit(loop);
}
return TRUE;
}
Have the above function in your code and add "g_timeout_add" with required
value before you do run on main loop.
gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);
g_timeout_add (1000, (GSourceFunc) cb_print_position, pipeline);
g_main_loop_run(playerloop);
With Warm Regards
Jesu Anuroop Suresh
"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."
"Anyone who has never made a mistake has never tried anything new."
On Mon, Jan 17, 2011 at 11:06 AM, sudarshan bisht <bisht.sudarshan at gmail.com
> wrote:
> Time should be in nano-seconds .
>
> For more info;
>
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html
> <http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html>
>
> On Mon, Jan 17, 2011 at 1:04 AM, Umakant Goyal <umakantgoyal1 at gmail.com>wrote:
>
>> Hi Thiago,
>>
>> I tried to run pipeline for specified period of time as suggested by you.
>> But it did not work for me. I want to run pipeline for 15 seconds for that i
>> have done
>>
>> bool flag = gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME,
>> (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
>> GST_SEEK_TYPE_NONE, 0, GST_SEEK_TYPE_SET, 15*GST_SECOND);
>>
>> i have also tried following line of code
>>
>> bool falg = gst_element_seek (vBin, 1.0, GST_FORMAT_TIME,
>> (GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
>> GST_SEEK_TYPE_SET, 0 * 15*GST_SECOND, GST_SEEK_TYPE_SET, 15*GST_SECOND);
>>
>> i have run above line of code in once in READY state and once in PAUSED
>> state. I have also tried GST_MSECOND instead of GST_SECOND. But nothing
>> works for me.
>>
>> Please help by telling where i am doing wrong while calling above line of
>> code.
>>
>> Thanks
>>
>> On Sun, Jan 16, 2011 at 2:14 AM, Thiago Sousa Santos <
>> thiago.sousa.santos at collabora.co.uk> wrote:
>>
>>> On Sun, 2011-01-16 at 01:12 +0530, Umakant Goyal wrote:
>>> > Hi All,
>>> >
>>> > Can i make a pipeline to run for specific period of time?
>>>
>>> Yes. You can send a seek event to the pipeline with a start and a stop
>>> time. Check
>>>
>>> http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-seek
>>>
>>> --
>>> Thiago
>>>
>>> >
>>> > Thanks
>>> >
>>> >
>>> ------------------------------------------------------------------------------
>>> > Protect Your Site and Customers from Malware Attacks
>>> > Learn about various malware tactics and how to avoid them. Understand
>>> > malware threats, the impact they can have on your business, and how you
>>> > can protect your company and customers by using code signing.
>>> > http://p.sf.net/sfu/oracle-sfdevnl
>>> > _______________________________________________
>>> > gstreamer-devel mailing list
>>> > gstreamer-devel at lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Protect Your Site and Customers from Malware Attacks
>>> Learn about various malware tactics and how to avoid them. Understand
>>> malware threats, the impact they can have on your business, and how you
>>> can protect your company and customers by using code signing.
>>> http://p.sf.net/sfu/oracle-sfdevnl
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Protect Your Site and Customers from Malware Attacks
>> Learn about various malware tactics and how to avoid them. Understand
>> malware threats, the impact they can have on your business, and how you
>> can protect your company and customers by using code signing.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>
>
> --
> Regards,
>
> Sudarshan Bisht
>
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110117/135fd56f/attachment.htm>
More information about the gstreamer-devel
mailing list