GNOME Bugzilla – Bug 605997
gst_clock_id_wait_async:getting callback even if the pipeline is paused or output window is closed!
Last modified: 2010-01-04 15:44:45 UTC
Created attachment 150768 [details] example code for testing callback: I captured the GstClockID of the pipeline in streaming-server using, id=gst_clock_new_periodic_id(media->media->pipeline->clock,start_time,interval); And then setted up the asynchronous callback using the following. gst_clock_id_wait_async(id,(GstClockCallback *)TickCallback,"Tick sending");* but evenif i "stopped" or "paused" the client side player , i am getting the callback " TickCallback" in the server side on specified intervals!!!!!!! I setted up these settings in *gst-rtsp-server/gst/rtsp-server/rtsp-client.c* ...inside the *handle_play()* function. But for checking the issue i am attaching an example clock.c here which has been compiled with , gcc -lpthread -Wall $(pkg-config --cflags --libs gstreamer-0.10) clock.c and run with ./a.out video.mp4 (mp4 conatins mpeg4 video and aac audio) if the choice you entered is "1" , the pipeline will moves to "PAUSE" state.But even if the pipeline is in PAUSED state or output window for video is closed,i am getting the callback message "Inside callback function TickCallback" in regular intervals of 9 seconds.And whatever be the "start time" i specified with id, getting many number of callbacks initially!!!
That is normal behaviour, a clock is allowed to keep running when the pipeline is paused. If you don't want the ticks in paused, simply ignore them.
But even we changed the state of pipeline to NULL,,still getting the callback.If we want to konw the amount of data being trasmitted, what we should do? (suppose we changed the rate of playback to twice the normal rate).And suppose the network is slow, still the callback is going(even if i specified the clock as the running pipeline's clock???
And in initial case, when the pipeline is just begining to run, the callback is calling continuously even i specified the the star time of clock id to a particular value!
I don't know what you want to do but the current position is usually requested with a position query. If you want to measure the amount of time spent in playing, you can calculate the running time of the pipeline (when in PLAYING). For the timeouts, you need to specify a start time relative to the current time of the clock. Again, I don't know what you are doing but it sounds like you are doing something wrong. In general, you usually don't want to deal with the clock from an application unless you understand how things work (see docs/design/part-synchronisation.txt).