mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
gst-inspect: print plugin error/warning/info status messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3832>
This commit is contained in:
parent
bc4f7040fa
commit
28f262b9ad
1 changed files with 47 additions and 0 deletions
|
@ -78,6 +78,7 @@ GMainLoop *loop = NULL;
|
||||||
/* Console colors */
|
/* Console colors */
|
||||||
|
|
||||||
/* Escape values for colors */
|
/* Escape values for colors */
|
||||||
|
#define RED "\033[31m"
|
||||||
#define BLUE "\033[34m"
|
#define BLUE "\033[34m"
|
||||||
#define BRBLUE "\033[94m"
|
#define BRBLUE "\033[94m"
|
||||||
#define BRCYAN "\033[96m"
|
#define BRCYAN "\033[96m"
|
||||||
|
@ -1677,6 +1678,50 @@ print_plugin_features (GstPlugin * plugin)
|
||||||
n_print ("\n");
|
n_print ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_plugin_status_message (const gchar * label, const gchar * msg,
|
||||||
|
const gchar * color)
|
||||||
|
{
|
||||||
|
if (msg != NULL) {
|
||||||
|
/* TODO: do something fancy with multi-line strings to preserve indentation */
|
||||||
|
n_print ("%s%s:%s %s\n\n", color, label, RESET_COLOR, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_plugin_status (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
gchar **msgs, **s;
|
||||||
|
|
||||||
|
push_indent ();
|
||||||
|
|
||||||
|
msgs = gst_plugin_get_status_infos (plugin);
|
||||||
|
for (s = msgs; s != NULL && *s != NULL; ++s) {
|
||||||
|
const gchar *info_msg = *s;
|
||||||
|
|
||||||
|
print_plugin_status_message ("Info", info_msg, GREEN);
|
||||||
|
}
|
||||||
|
g_strfreev (msgs);
|
||||||
|
|
||||||
|
msgs = gst_plugin_get_status_warnings (plugin);
|
||||||
|
for (s = msgs; s != NULL && *s != NULL; ++s) {
|
||||||
|
const gchar *warning_msg = *s;
|
||||||
|
|
||||||
|
print_plugin_status_message ("Warning", warning_msg, YELLOW);
|
||||||
|
}
|
||||||
|
g_strfreev (msgs);
|
||||||
|
|
||||||
|
msgs = gst_plugin_get_status_errors (plugin);
|
||||||
|
for (s = msgs; s != NULL && *s != NULL; ++s) {
|
||||||
|
const gchar *err_msg = *s;
|
||||||
|
|
||||||
|
print_plugin_status_message ("Error", err_msg, RED);
|
||||||
|
}
|
||||||
|
g_strfreev (msgs);
|
||||||
|
|
||||||
|
pop_indent ();
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
print_feature_info (const gchar * feature_name, gboolean print_all)
|
print_feature_info (const gchar * feature_name, gboolean print_all)
|
||||||
{
|
{
|
||||||
|
@ -2322,6 +2367,7 @@ real_main (int argc, char *argv[])
|
||||||
print_plugin_automatic_install_info (plugin);
|
print_plugin_automatic_install_info (plugin);
|
||||||
} else {
|
} else {
|
||||||
print_plugin_info (plugin);
|
print_plugin_info (plugin);
|
||||||
|
print_plugin_status (plugin);
|
||||||
print_plugin_features (plugin);
|
print_plugin_features (plugin);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2335,6 +2381,7 @@ real_main (int argc, char *argv[])
|
||||||
print_plugin_automatic_install_info (plugin);
|
print_plugin_automatic_install_info (plugin);
|
||||||
} else {
|
} else {
|
||||||
print_plugin_info (plugin);
|
print_plugin_info (plugin);
|
||||||
|
print_plugin_status (plugin);
|
||||||
print_plugin_features (plugin);
|
print_plugin_features (plugin);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue