Chapter 16. Bins

16.1. Creating a bin

Bins are created in the same way that other elements are created. ie. using an element factory, or any of the associated convenience functions:


  GstElement *bin, *thread, *pipeline;
  
  /* create a new bin called 'mybin'. this bin will be only for organizational purposes; a normal
     GstBin doesn't affect plan generation */
  bin = gst_element_factory_make ("bin", "mybin");

  /* create a new thread, and give it a unique name */
  thread = gst_element_factory_make ("thread", NULL);

  /* the core bins (GstBin, GstThread, GstPipeline) also have convenience APIs,
     gst_<bintype>_new (). these are equivalent to the gst_element_factory_make () syntax. */
  pipeline = gst_pipeline_new ("pipeline_name");