mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
gst/gstsystemclock.c: Add debug that can be enabled using a #define at the top of the file, for dumping stats about h...
Original commit message from CVS: * gst/gstsystemclock.c: (gst_system_clock_id_wait_unlocked): Add debug that can be enabled using a #define at the top of the file, for dumping stats about how late/early we were when waking up from waiting on the clock.
This commit is contained in:
parent
f55a023510
commit
2e168d69ce
2 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-05-30 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
|
* gst/gstsystemclock.c: (gst_system_clock_id_wait_unlocked):
|
||||||
|
Add debug that can be enabled using a #define at the top of the file,
|
||||||
|
for dumping stats about how late/early we were when waking up from
|
||||||
|
waiting on the clock.
|
||||||
|
|
||||||
2006-05-30 Wim Taymans <wim@fluendo.com>
|
2006-05-30 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_check_pads):
|
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_check_pads):
|
||||||
|
|
|
@ -43,6 +43,9 @@
|
||||||
|
|
||||||
#include "gstsystemclock.h"
|
#include "gstsystemclock.h"
|
||||||
|
|
||||||
|
/* Define this to get some extra debug about jitter from each clock_wait */
|
||||||
|
#undef WAIT_DEBUGGING
|
||||||
|
|
||||||
/* the one instance of the systemclock */
|
/* the one instance of the systemclock */
|
||||||
static GstClock *_the_system_clock = NULL;
|
static GstClock *_the_system_clock = NULL;
|
||||||
|
|
||||||
|
@ -385,6 +388,10 @@ gst_system_clock_id_wait_unlocked (GstClock * clock, GstClockEntry * entry)
|
||||||
if (diff > 0) {
|
if (diff > 0) {
|
||||||
GTimeVal tv;
|
GTimeVal tv;
|
||||||
|
|
||||||
|
#ifdef WAIT_DEBUGGING
|
||||||
|
GstClockTime result, final;
|
||||||
|
#endif
|
||||||
|
|
||||||
GST_TIME_TO_TIMEVAL (target, tv);
|
GST_TIME_TO_TIMEVAL (target, tv);
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
|
@ -393,6 +400,20 @@ gst_system_clock_id_wait_unlocked (GstClock * clock, GstClockEntry * entry)
|
||||||
/* timeout, this is fine, we can report success now */
|
/* timeout, this is fine, we can report success now */
|
||||||
GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked after timeout", entry);
|
GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked after timeout", entry);
|
||||||
entry->status = GST_CLOCK_OK;
|
entry->status = GST_CLOCK_OK;
|
||||||
|
|
||||||
|
#ifdef WAIT_DEBUGGING
|
||||||
|
real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
|
||||||
|
result = gst_clock_adjust_unlocked (clock, real);
|
||||||
|
final = gst_system_clock_get_internal_time (clock);
|
||||||
|
GST_CAT_DEBUG (GST_CAT_CLOCK, "Waited for %" G_GINT64_FORMAT
|
||||||
|
" got %" G_GINT64_FORMAT " diff %" G_GINT64_FORMAT
|
||||||
|
" %g target-offset %" G_GINT64_FORMAT " %g", entryt, result,
|
||||||
|
result - entryt,
|
||||||
|
(double) (GstClockTimeDiff) (result - entryt) / GST_SECOND,
|
||||||
|
(final - target),
|
||||||
|
((double) (GstClockTimeDiff) (final - target)) / GST_SECOND);
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
/* the waiting is interrupted because the GCond was signaled. This can
|
/* the waiting is interrupted because the GCond was signaled. This can
|
||||||
|
|
Loading…
Reference in a new issue