[gst-devel] stream time vs. running time in level/spectrum messages

Stefan Kost ensonic at hora-obscura.de
Sat Aug 9 14:19:17 CEST 2008


hi,

wim, in
http://webcvs.freedesktop.org/gstreamer/gst-plugins-good/gst/level/gstlevel.c?r1=1.74&r2=1.75
you changed "endtime" to be returned as stream time instead of running time. 
Comment was that this is what the application wants. Either is miss something or 
don't agree here. I update level meters on the screen with the details from 
GstLevel. For a long time I just ignored the endtime and triggered resraws 
immediately. For a pipeline like src ! level ! fx1 ! level ! fx2 ! level ! sink
it had the consequense the meters where not in sync. Now I tried to sync them:

GstClockTime endtime;

if(gst_structure_get_clock_time (structure, "endtime", &endtime)) {
   gconstpointer *params=g_new(gconstpointer,2);
   GstClockID clock_id;
   GstClockTime waittime;
   GstClockTime basetime =
     gst_element_get_base_time(GST_ELEMENT(GST_MESSAGE_SRC(message)));

   /* this only work for the first loop :/
    * root cause is that level/spectrum send endtime as stream_time and not
    * as running_time
    */
   waittime=basetime+endtime;

   GST_DEBUG("target %"GST_TIME_FORMAT" %"GST_TIME_FORMAT,
     GST_TIME_ARGS(endtime),GST_TIME_ARGS(waittime));

   params[0]=(gpointer)self;
   params[1]=(gpointer)gst_message_copy(message);
   clock_id=gst_clock_new_single_shot_id(self->priv->clock,waittime);
   gst_clock_id_wait_async
     (clock_id,on_delayed_song_level_change,(gpointer)params);
   gst_clock_id_unref(clock_id);
}

Problem here is that I want to sync with the pipeline clock. Without having 
access to accum filed in segment I can see how to convert the stream_time to 
running_time. A segment-query unfortunately does not return the accum field :/

Any ideas? Should we change level back to return running_time or is there a way 
I can convert from the application.

And bt.w spectrum still uses gst_segment_to_running_time(), so we shoudl atleast 
make it consistent.


Stefan




More information about the gstreamer-devel mailing list