Custom bins

The application programmer can create custom bins packed with elements to perform a specific task. This allows you, for example, to write an Ogg/Vorbis decoder with just the following lines of code:


int
main (int   argc,
      char *argv[])
{
  GstElement *player;

  /* init */
  gst_init (&argc, &argv);

  /* create player */
  player = gst_element_factory_make ("oggvorbisplayer", "player");

  /* set the source audio file */
  g_object_set (player, "location", "helloworld.ogg", NULL);

  /* start playback */
  gst_element_set_state (GST_ELEMENT (player), GST_STATE_PLAYING);
[..]
}
    

(This is a silly example of course, there already exists a much more powerful and versatile custom bin like this: the playbin2 element.)

Custom bins can be created with a plugin or an XML description. You will find more information about creating custom bin in the Plugin Writers Guide.

Examples of such custom bins are the playbin2 and uridecodebin elements from gst-plugins-base.