diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-07-26 12:19:32 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-07-26 12:20:05 +0200 |
commit | d73b4edc99c369c9dadd1418d797b9e7c7bbfb73 (patch) | |
tree | 3281e7f8cec586932426683a9d18e5d8d4e31289 /gst | |
parent | aa5ea6d80e21a3876d81878c0837a28f8842252c (diff) |
clock: debug the clock return values
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstclock.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gst/gstclock.c b/gst/gstclock.c index 707f88ba1..f7ef07dcf 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -193,6 +193,36 @@ G_STMT_START { \ GST_OBJECT_UNLOCK (clock); \ } G_STMT_END; +typedef struct +{ + const gint ret; + const gchar *name; + GQuark quark; +} GstClockQuarks; + +static GstClockQuarks clock_quarks[] = { + {GST_CLOCK_OK, "ok", 0}, + {GST_CLOCK_EARLY, "early", 0}, + {GST_CLOCK_UNSCHEDULED, "unscheduled", 0}, + {GST_CLOCK_BUSY, "busy", 0}, + {GST_CLOCK_BADTIME, "bad-time", 0}, + {GST_CLOCK_ERROR, "error", 0}, + {GST_CLOCK_UNSUPPORTED, "unsupported", 0}, + {GST_CLOCK_DONE, "done", 0} +}; + +static const gchar * +gst_clock_return_get_name (GstClockReturn ret) +{ + gint i; + + for (i = 0; i < G_N_ELEMENTS (clock_quarks); i++) { + if (ret == clock_quarks[i].ret) + return clock_quarks[i].name; + } + return "unknown"; +} + static void gst_clock_dispose (GObject * object); static void gst_clock_finalize (GObject * object); @@ -512,7 +542,8 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter) res = cclass->wait (clock, entry, jitter); GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock, - "done waiting entry %p, res: %d", id, res); + "done waiting entry %p, res: %d (%s)", id, res, + gst_clock_return_get_name (res)); if (entry->type == GST_CLOCK_ENTRY_PERIODIC) entry->time = requested + entry->interval; |