GStreamer Application Development Manual | ||
---|---|---|
<<< Previous | Next >>> |
A Bin is a container element. You can add elements to a bin. Since a bin is an GstElement itself, it can also be added to another bin.
Bins allow you to combine connected elements into one logical element. You do not deal with the individual elements anymore but with just one element, the bin. We will see that this is extremely powerfull when you are going to construct complex pipelines since it allows you to break up the pipeline in smaller chunks.
The bin will also manage the elements contained in it. It will figure out how the data will flow in the bin and generate an optimal plan for that data flow. Plan generation is one of the most complicated procedures in GStreamer.
There are two standard bins available to the GStreamer programmer:
A pipeline (GstPipeline). Which is a generic container you will use most of the time.
A thread (GstThread). All the elements in the thread bin will run in a separate thread. You will haver to use this bin if you carfully have to synchronize audio and video for example. You will learn more about threads in..
You create a bin with a specified name 'mybin' with:
GstElement *bin; gst_bin_new ("mybin"); ... |
A thread can be created with:
GstElement *thread; gst_thread_new ("mythread"); ... |
Pipelines are created with gst_pipeline_new ("name");
<<< Previous | Home | Next >>> |
Connecting elements | Up | Adding elements to a bin |