#include <unistd.h>
#endif
-static gboolean output_is_tty = TRUE;
-
enum
{
PROP_0,
object_class->get_property = gst_validate_pipeline_monitor_get_property;
g_object_class_override_property (object_class, PROP_VERBOSITY, "verbosity");
-
-#ifdef HAVE_UNISTD_H
- output_is_tty = isatty (1);
-#endif
-
}
static void
{
GstQuery *query;
gint64 position, duration;
- JsonBuilder *jbuilder;
GstElement *pipeline =
GST_ELEMENT (gst_validate_monitor_get_pipeline (monitor));
gst_query_parse_segment (query, &rate, NULL, NULL, NULL);
gst_query_unref (query);
- jbuilder = json_builder_new ();
- json_builder_begin_object (jbuilder);
- json_builder_set_member_name (jbuilder, "type");
- json_builder_add_string_value (jbuilder, "position");
- json_builder_set_member_name (jbuilder, "position");
- json_builder_add_int_value (jbuilder, position);
- json_builder_set_member_name (jbuilder, "duration");
- json_builder_add_int_value (jbuilder, duration);
- json_builder_set_member_name (jbuilder, "speed");
- json_builder_add_double_value (jbuilder, rate);
- json_builder_end_object (jbuilder);
-
- gst_validate_send (json_builder_get_root (jbuilder));
- g_object_unref (jbuilder);
-
- gst_validate_printf (NULL,
- "<position: %" GST_TIME_FORMAT " duration: %" GST_TIME_FORMAT
- " speed: %f />%c", GST_TIME_ARGS (position), GST_TIME_ARGS (duration),
- rate, output_is_tty ? '\r' : '\n');
+ gst_validate_print_position (position, duration, rate, NULL);
done:
gst_object_unref (pipeline);
static GstValidateDebugFlags _gst_validate_flags = 0;
static GHashTable *_gst_validate_issues = NULL;
static FILE **log_files = NULL;
+static gboolean output_is_tty = TRUE;
/* Tcp server for communications with gst-validate-launcher */
GSocketClient *socket_client = NULL;
gst_validate_report_load_issues ();
}
+#ifdef HAVE_UNISTD_H
+ output_is_tty = isatty (1);
+#endif
server_env = g_getenv ("GST_VALIDATE_SERVER");
uuid = g_getenv ("GST_VALIDATE_UUID");
g_list_append (report->repeated_reports,
gst_validate_report_ref (repeated_report));
}
+
+
+void
+gst_validate_print_position (GstClockTime position, GstClockTime duration,
+ gdouble rate, gchar * extra_info)
+{
+ JsonBuilder *jbuilder;
+
+ gst_validate_printf (NULL,
+ "<position: %" GST_TIME_FORMAT " duration: %" GST_TIME_FORMAT
+ " speed: %f %s/>%c", GST_TIME_ARGS (position), GST_TIME_ARGS (duration),
+ rate, extra_info ? extra_info : "", output_is_tty ? '\r' : '\n');
+
+ if (!server_ostream)
+ return;
+
+ jbuilder = json_builder_new ();
+ json_builder_begin_object (jbuilder);
+ json_builder_set_member_name (jbuilder, "type");
+ json_builder_add_string_value (jbuilder, "position");
+ json_builder_set_member_name (jbuilder, "position");
+ json_builder_add_int_value (jbuilder, position);
+ json_builder_set_member_name (jbuilder, "duration");
+ json_builder_add_int_value (jbuilder, duration);
+ json_builder_set_member_name (jbuilder, "speed");
+ json_builder_add_double_value (jbuilder, rate);
+ json_builder_end_object (jbuilder);
+
+ gst_validate_send (json_builder_get_root (jbuilder));
+ g_object_unref (jbuilder);
+
+ g_free (extra_info);
+}
void gst_validate_report_add_repeated_report (GstValidateReport *report, GstValidateReport *repeated_report);
GST_VALIDATE_API
GstValidateReportLevel gst_validate_report_level_from_name (const gchar *level_name);
+GST_VALIDATE_API
+void gst_validate_print_position(GstClockTime position, GstClockTime duration, gdouble rate, gchar* extra_info);
G_END_DECLS
min_avg = MIN (min_avg, mssim);
min_min = MIN (lowest, min_min);
total_avg += mssim;
- gst_validate_printf (NULL,
- "<position: %" GST_TIME_FORMAT " duration: %" GST_TIME_FORMAT
- " %d / %d avg: %f min: %f (Passed: %d failed: %d)/>\n",
- GST_TIME_ARGS (frame->position), GST_TIME_ARGS (GST_CLOCK_TIME_NONE),
- i + 1, nfiles, mssim, lowest, npassed, nfailures);
-
- g_free (bname);
+ gst_validate_print_position(frame->position, GST_CLOCK_TIME_NONE, 1.0,
+ g_strdup_printf(" %d / %d avg: %f min: %f (Passed: %d failed: %d)",
+ i + 1, nfiles, mssim, lowest, npassed, nfailures));
+ g_free(bname);
}
gst_validate_printf (NULL,