Gstreamer

Name

Gstreamer -- Media library supporting arbitrary formats and filter graphs.

Synopsis


#include <gst/gst.h>


void        gst_init                        (int *argc,
                                             char **argv[]);
void        gst_init_with_popt_table        (int *argc,
                                             char **argv[],
                                             const struct poptOption *popt_options);
void        gst_version                     (guint *major,
                                             guint *minor,
                                             guint *micro);
void        gst_main                        (void);
void        gst_main_quit                   (void);
extern      const char             *g_log_domain_gstreamer;
#define     GST_VERSION_MAJOR
#define     GST_VERSION_MINOR
#define     GST_VERSION_MICRO

Description

GStreamer is a framework for constructing graphs of various filters (termed elements here) that will handle streaming media. Any discreet (packetizable) media type is supported, with provisions for automatically determining source type. Metadata can be passed with all data to provide formatting/framing information. Plugins are heavily used to provide for all elements, allowing one to construct plugins outside of the GST library, even released binary-only if license require (please don't).

GStreamer borrows heavily from both the OGI media pipeline and Microsoft's DirectShow, hopefully taking the best of both and leaving the cruft behind. Its interface is still very fluid (I've redesigned the metadata handling twice already), and thus can be changed to increase the sanity/noise ratio.

The GStreamer library should be initialized with gst_init() before it can be used. You should pass a pointer to the main argc and argv variables so that GStreamer can process its own command line options, as shown in the following example.
  int 
  main (int argc, char *argv[])
  {
    /* initialize the GStreamer library */
    gst_init (&argc, &argv);
    ...
  }
  

You can also use a popt table to initialize your own parameters as shown in the next code fragment:
  static gboolean stats = FALSE;
  ...

  int 
  main (int argc, char *argv[])
  {
    struct poptOption options[] = {
      { "stats",  's',  POPT_ARG_NONE|POPT_ARGFLAG_STRIP,   &stats,   0,
          "Show pad stats", NULL},
        POPT_TABLEEND
      };

    /* initialize the GStreamer library */
    gst_init_with_popt_table (&argc, &argv, options);
      
    ...
  }
  

Use gst_version() to query the library version at runtime or use the GST_VERSION_* macros to find the version at compile time.

gst_main() and gst_main_quit() enter and exit the main loop.

Details

gst_init ()

void        gst_init                        (int *argc,
                                             char **argv[]);

Initializes the GStreamer library, setting up internal path lists, registering built-in elements, and loading standard plugins.


gst_init_with_popt_table ()

void        gst_init_with_popt_table        (int *argc,
                                             char **argv[],
                                             const struct poptOption *popt_options);

Initializes the GStreamer library, parsing the options, setting up internal path lists, registering built-in elements, and loading standard plugins.


gst_version ()

void        gst_version                     (guint *major,
                                             guint *minor,
                                             guint *micro);

Gets the version number of the GStreamer library


gst_main ()

void        gst_main                        (void);

Enter the main GStreamer processing loop


gst_main_quit ()

void        gst_main_quit                   (void);

Exits the main GStreamer processing loop


g_log_domain_gstreamer

extern const char             *g_log_domain_gstreamer;


GST_VERSION_MAJOR

#define GST_VERSION_MAJOR 0

The major version of GStreamer at compile time


GST_VERSION_MINOR

#define GST_VERSION_MINOR 3

The minor version of GStreamer at compile time


GST_VERSION_MICRO

#define GST_VERSION_MICRO 4

The micro version of GStreamer at compile time

See Also

Check out both OGI's pipeline and Microsoft's DirectShow for some background.