Custom bins

The application programmer can create custom bins packed with elements to perform a specific task. This allow you to write an MPEG audio decoder with just the follwing lines of code:

  // create the mp3player element
  GstElement *mp3player = gst_elementfactory_make("mp3player","mp3player");
  // set the source mp3 audio file
  gtk_object_set(GTK_OBJECT(mp3player), "location", "helloworld.mp3", NULL);
  // start playback
  gst_element_set_state(GST_ELEMENT(mp3player),GST_STATE_PLAYING);
   ...
  // pause playback
  gst_element_set_state(GST_ELEMENT(mp3player),GST_STATE_PAUSED);
   ...
  // stop
  gst_element_set_state(GST_ELEMENT(mp3player),GST_STATE_NULL);
      
Custom bins can be created with a plugin or an XML description. You will find more information about creating custom bin in the Filter-Writers-Guide.