mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
clock: simplify internal gst_clock_return_get_name() helper
This commit is contained in:
parent
44811ab650
commit
a4f2720be4
1 changed files with 22 additions and 23 deletions
|
@ -193,35 +193,34 @@ G_STMT_START { \
|
||||||
GST_OBJECT_UNLOCK (clock); \
|
GST_OBJECT_UNLOCK (clock); \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
typedef struct
|
#ifndef GST_DISABLE_GST_DEBUG
|
||||||
{
|
|
||||||
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 *
|
static const gchar *
|
||||||
gst_clock_return_get_name (GstClockReturn ret)
|
gst_clock_return_get_name (GstClockReturn ret)
|
||||||
{
|
{
|
||||||
gint i;
|
switch (ret) {
|
||||||
|
case GST_CLOCK_OK:
|
||||||
for (i = 0; i < G_N_ELEMENTS (clock_quarks); i++) {
|
return "ok";
|
||||||
if (ret == clock_quarks[i].ret)
|
case GST_CLOCK_EARLY:
|
||||||
return clock_quarks[i].name;
|
return "early";
|
||||||
|
case GST_CLOCK_UNSCHEDULED:
|
||||||
|
return "unscheduled";
|
||||||
|
case GST_CLOCK_BUSY:
|
||||||
|
return "busy";
|
||||||
|
case GST_CLOCK_BADTIME:
|
||||||
|
return "bad-time";
|
||||||
|
case GST_CLOCK_ERROR:
|
||||||
|
return "error";
|
||||||
|
case GST_CLOCK_UNSUPPORTED:
|
||||||
|
return "unsupported";
|
||||||
|
case GST_CLOCK_DONE:
|
||||||
|
return "done";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
#endif /* GST_DISABLE_GST_DEBUG */
|
||||||
|
|
||||||
static void gst_clock_dispose (GObject * object);
|
static void gst_clock_dispose (GObject * object);
|
||||||
static void gst_clock_finalize (GObject * object);
|
static void gst_clock_finalize (GObject * object);
|
||||||
|
|
Loading…
Reference in a new issue