mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
tools: Fix compilation if option parsing is disabled
Fixes bug #587976.
This commit is contained in:
parent
5f6bfb816b
commit
9501767704
2 changed files with 12 additions and 0 deletions
|
@ -1403,6 +1403,7 @@ main (int argc, char *argv[])
|
||||||
gboolean plugin_name = FALSE;
|
gboolean plugin_name = FALSE;
|
||||||
gboolean print_aii = FALSE;
|
gboolean print_aii = FALSE;
|
||||||
gboolean uri_handlers = FALSE;
|
gboolean uri_handlers = FALSE;
|
||||||
|
#ifndef GST_DISABLE_OPTION_PARSING
|
||||||
GOptionEntry options[] = {
|
GOptionEntry options[] = {
|
||||||
{"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
|
{"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
|
||||||
N_("Print all elements"), NULL},
|
N_("Print all elements"), NULL},
|
||||||
|
@ -1422,6 +1423,7 @@ main (int argc, char *argv[])
|
||||||
};
|
};
|
||||||
GOptionContext *ctx;
|
GOptionContext *ctx;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||||
|
@ -1432,6 +1434,7 @@ main (int argc, char *argv[])
|
||||||
if (!g_thread_supported ())
|
if (!g_thread_supported ())
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
|
|
||||||
|
#ifndef GST_DISABLE_OPTION_PARSING
|
||||||
ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
|
ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
|
||||||
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
|
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
|
||||||
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
||||||
|
@ -1440,6 +1443,9 @@ main (int argc, char *argv[])
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
#else
|
||||||
|
gst_init (&argc, &argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_tools_print_version ("gst-inspect");
|
gst_tools_print_version ("gst-inspect");
|
||||||
|
|
||||||
|
|
|
@ -666,6 +666,7 @@ main (int argc, char *argv[])
|
||||||
gboolean eos_on_shutdown = FALSE;
|
gboolean eos_on_shutdown = FALSE;
|
||||||
gchar *savefile = NULL;
|
gchar *savefile = NULL;
|
||||||
gchar *exclude_args = NULL;
|
gchar *exclude_args = NULL;
|
||||||
|
#ifndef GST_DISABLE_OPTION_PARSING
|
||||||
GOptionEntry options[] = {
|
GOptionEntry options[] = {
|
||||||
{"tags", 't', 0, G_OPTION_ARG_NONE, &tags,
|
{"tags", 't', 0, G_OPTION_ARG_NONE, &tags,
|
||||||
N_("Output tags (also known as metadata)"), NULL},
|
N_("Output tags (also known as metadata)"), NULL},
|
||||||
|
@ -692,6 +693,7 @@ main (int argc, char *argv[])
|
||||||
};
|
};
|
||||||
GOptionContext *ctx;
|
GOptionContext *ctx;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
#endif
|
||||||
gchar **argvn;
|
gchar **argvn;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gint res = 0;
|
gint res = 0;
|
||||||
|
@ -709,6 +711,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
|
gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
|
||||||
|
|
||||||
|
#ifndef GST_DISABLE_OPTION_PARSING
|
||||||
ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
|
ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
|
||||||
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
|
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
|
||||||
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
||||||
|
@ -720,6 +723,9 @@ main (int argc, char *argv[])
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
#else
|
||||||
|
gst_init (&argc, &argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_tools_print_version ("gst-launch");
|
gst_tools_print_version ("gst-launch");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue