4.2. The popt interface

You can also use a popt table to initialize your own parameters as shown in the next example:


#include <gst/gst.h>

int
main (int   argc,
      char *argv[])
{
  gboolean silent = FALSE;
  gchar *savefile = NULL;
  struct poptOption options[] = {
    {"silent",	's',  POPT_ARG_NONE|POPT_ARGFLAG_STRIP,   &silent,   0,
     "do not output status information", NULL},
    {"output",	'o',  POPT_ARG_STRING|POPT_ARGFLAG_STRIP, &savefile, 0,
     "save xml representation of pipeline to FILE and exit", "FILE"},
    POPT_TABLEEND
  };

  gst_init_with_popt_table (&argc, &argv, options);

  printf ("Run me with --help to see the Application options appended.\n");

  return 0;
}

    

As shown in this fragment, you can use a popt table to define your application-specific command line options, and pass this table to the function gst_init_with_popt_table. Your application options will be parsed in addition to the standard GStreamer options.