tools: Fix compilation if option parsing is disabled
authorPhilip Jägenstedt <philipj@opera.com>
Wed, 8 Jul 2009 13:15:04 +0000 (15:15 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 8 Jul 2009 13:15:04 +0000 (15:15 +0200)
Fixes bug #587976.

tools/gst-inspect.c
tools/gst-launch.c

index 4cfebc7..c879c76 100644 (file)
@@ -1403,6 +1403,7 @@ main (int argc, char *argv[])
   gboolean plugin_name = FALSE;
   gboolean print_aii = FALSE;
   gboolean uri_handlers = FALSE;
+#ifndef GST_DISABLE_OPTION_PARSING
   GOptionEntry options[] = {
     {"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
         N_("Print all elements"), NULL},
@@ -1422,6 +1423,7 @@ main (int argc, char *argv[])
   };
   GOptionContext *ctx;
   GError *err = NULL;
+#endif
 
 #ifdef ENABLE_NLS
   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -1432,6 +1434,7 @@ main (int argc, char *argv[])
   if (!g_thread_supported ())
     g_thread_init (NULL);
 
+#ifndef GST_DISABLE_OPTION_PARSING
   ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
   g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
   g_option_context_add_group (ctx, gst_init_get_option_group ());
@@ -1440,6 +1443,9 @@ main (int argc, char *argv[])
     exit (1);
   }
   g_option_context_free (ctx);
+#else
+  gst_init (&argc, &argv);
+#endif
 
   gst_tools_print_version ("gst-inspect");
 
index 5e578e6..105dfaa 100644 (file)
@@ -666,6 +666,7 @@ main (int argc, char *argv[])
   gboolean eos_on_shutdown = FALSE;
   gchar *savefile = NULL;
   gchar *exclude_args = NULL;
+#ifndef GST_DISABLE_OPTION_PARSING
   GOptionEntry options[] = {
     {"tags", 't', 0, G_OPTION_ARG_NONE, &tags,
         N_("Output tags (also known as metadata)"), NULL},
@@ -692,6 +693,7 @@ main (int argc, char *argv[])
   };
   GOptionContext *ctx;
   GError *err = NULL;
+#endif
   gchar **argvn;
   GError *error = NULL;
   gint res = 0;
@@ -709,6 +711,7 @@ main (int argc, char *argv[])
 
   gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
 
+#ifndef GST_DISABLE_OPTION_PARSING
   ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
   g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
   g_option_context_add_group (ctx, gst_init_get_option_group ());
@@ -720,6 +723,9 @@ main (int argc, char *argv[])
     exit (1);
   }
   g_option_context_free (ctx);
+#else
+  gst_init (&argc, &argv);
+#endif
 
   gst_tools_print_version ("gst-launch");