Tracking time for which a pipeline has been in Playing state.

Yogesh Marwaha yogeshm.007 at gmail.com
Wed Feb 23 03:02:14 PST 2011


Found the root cause of the problem.

gst_element_get_base_time(m_pPipeline) is only updated when pipeline is put
to Playing state. So, when the pipeline is in Paused state my code fails and
when the pipeline is again put to Playing state base time is update and
elapsed time is calculated correctly.

So, I'll have store elapsed time and only update it if in Playing state. OR
implement all these things on my own. Lets see what I do in the coming
weekend.

PS: My app can only (presently) rip audio cds. You can download latest svn
snapshot from
http://sparklemedia.svn.sourceforge.net/viewvc/sparklemedia/subprojects/sparklex/current-unstable/?view=tar

On 20 February 2011 20:16, Yogesh Marwaha <yogeshm.007 at gmail.com> wrote:

> Hi,
>
> I'm coding a transcoding application (not using encodebin).
>
> Upto now I had been using following code to get time for which the pipeline
> has been in Playing state (To show user information like xx minutes/seconds
> the operation has run for or to calcutate averate speed and estimate
> remaining
> time etc.): -
>        GstClockTime elapsedTime = GST_CLOCK_TIME_NONE;
>        GstClock *clock = gst_element_get_clock(m_pPipeline);
>        if(clock)
>            elapsedTime = (gst_clock_get_time(clock) -
> gst_element_get_base_time(m_pPipeline)) / GST_SECOND;
>
> Pipeline is like this: -
>        gst_bin_add_many(GST_BIN(m_pPipeline), source, queue, audioConvert,
> audioEncoder, container, sink, NULL);
>
> But then I added code to allow pausing the operation like this: -
>    gst_element_set_state(m_pPipeline, GST_STATE_PAUSED);
>
> Now pipeline is paused but the clock is not. It is running always.
>
> What should I do achieve my target?
>
> Regards,
>
> Yogesh Marwaha
> http://sparklemedia.sourceforge.net/
>



-- 
Yogesh M
http://sparklemedia.sourceforge.net/
http://mazedaar.wordpress.com/
http://snakeeyes.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110223/10585458/attachment.htm>


More information about the gstreamer-devel mailing list