mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
Add number-of-iterations option.
Original commit message from CVS: Add number-of-iterations option.
This commit is contained in:
parent
ee5586e873
commit
c61bcbef1f
2 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,9 @@ Do not install a fault handler
|
||||||
.B \-t, \-\-trace
|
.B \-t, \-\-trace
|
||||||
Print memory allocation traces. The feature must be enabled at compile time to
|
Print memory allocation traces. The feature must be enabled at compile time to
|
||||||
work.
|
work.
|
||||||
|
.TP 8
|
||||||
|
.B \-i, \-\-iterations=N
|
||||||
|
Stop processing after N iterations.
|
||||||
|
|
||||||
.
|
.
|
||||||
.SH "GSTREAMER OPTIONS"
|
.SH "GSTREAMER OPTIONS"
|
||||||
|
|
|
@ -20,6 +20,7 @@ static void fault_restore (void);
|
||||||
static void fault_spin (void);
|
static void fault_spin (void);
|
||||||
static void sigint_restore (void);
|
static void sigint_restore (void);
|
||||||
|
|
||||||
|
static gint max_iterations = 0;
|
||||||
static guint64 iterations = 0;
|
static guint64 iterations = 0;
|
||||||
static guint64 sum = 0;
|
static guint64 sum = 0;
|
||||||
static guint64 min = G_MAXINT64;
|
static guint64 min = G_MAXINT64;
|
||||||
|
@ -51,7 +52,7 @@ idle_func (gpointer data)
|
||||||
min = MIN (min, diff);
|
min = MIN (min, diff);
|
||||||
max = MAX (max, diff);
|
max = MAX (max, diff);
|
||||||
|
|
||||||
if (!busy || caught_intr) {
|
if (!busy || caught_intr || (max_iterations>0 && iterations>=max_iterations)) {
|
||||||
gst_main_quit ();
|
gst_main_quit ();
|
||||||
g_print ("execution ended after %" G_GUINT64_FORMAT " iterations (sum %" G_GUINT64_FORMAT " ns, average %" G_GUINT64_FORMAT " ns, min %" G_GUINT64_FORMAT " ns, max %" G_GUINT64_FORMAT " ns)\n",
|
g_print ("execution ended after %" G_GUINT64_FORMAT " iterations (sum %" G_GUINT64_FORMAT " ns, average %" G_GUINT64_FORMAT " ns, min %" G_GUINT64_FORMAT " ns, max %" G_GUINT64_FORMAT " ns)\n",
|
||||||
iterations, sum, sum/iterations, min, max);
|
iterations, sum, sum/iterations, min, max);
|
||||||
|
@ -270,6 +271,8 @@ main(int argc, char *argv[])
|
||||||
"Do not install a fault handler", NULL},
|
"Do not install a fault handler", NULL},
|
||||||
{"trace", 't', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &trace, 0,
|
{"trace", 't', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &trace, 0,
|
||||||
"print alloc trace if enabled at compile time", NULL},
|
"print alloc trace if enabled at compile time", NULL},
|
||||||
|
{"iterations",'i',POPT_ARG_INT|POPT_ARGFLAG_STRIP, &max_iterations, 0,
|
||||||
|
"number of times to iterate pipeline", NULL},
|
||||||
POPT_TABLEEND
|
POPT_TABLEEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue