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:

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 playbin element.)

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

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