How to reset a GST Clock ? gst_clock_set_time () ?

Sebastian Dröge sebastian at centricular.com
Fri Dec 13 10:56:28 PST 2013


On So, 2013-12-08 at 03:14 +0530, Cigarah Truta wrote:
> I am pushing buffers got from network using appsrc. There are two
> pipelines audio and video.  I have set the timestamp to these buffers
> using GST_BUFFER_TIMESTAMP.
> 
> 
> 
> Now when I scroll the stream in forward or reverse direction, both the
> pipelines pause. After pushing play, the data start coming with the
> new timestamp.  
> 
> 
> So I just flush (using send event ) the pipelines before the PLAYING
> state and use the API gst_element_set_start_time(pipeline, newPTS).
> This seems to be working fine. Status bar is updated fine as I am
> sending the correct position to the application.
> 
> 
> But when I go in reverse direction and set the same (start_time) API,
> the data does not play. It hangs. Instead only the status bar is
> updated. The data plays after some time from the position where I
> started scrolling. 
> 
> 
> This may be due to a GstClock element was running in the
> monotonoically increasing direction and hence could not play into
> backward direction from the start time. 
> 
> 
> Could you help that how can I debug ?
> 
> 
> 
> Is there a way to reset a clock of the pipeline or to set time in it.
> I tried using use_clock () and set_base_time () APIs too.
> 
> 
> What is the difference between set_base_time() and set_start_time()
> API. I read somewhere that start_time() API first calls base_time()
> API. ? Is it true?
> 
> 
> One more issue is why is it working in forward direction but not
> reverse direction ?

For seeking you, in general, should not use gst_element_set_base_time()
and gst_element_set_start_time(). Please read in the documentation about
synchronization and time in GStreamer:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-queryevents.html
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-clocks.html

http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-synchronisation.txt


What should happen in your case is that the elements provide the correct
segment information and put correct timestamps on the buffers. The
base/start time handling is to be done by the GStreamer core. Also the
clock is mostly irrelevant, and especially you should not reset it or do
anything else with it (and it must continue to increase monotonically,
independent of playback direction).

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131213/7e6ced42/attachment-0001.pgp>


More information about the gstreamer-devel mailing list