*
* Returns: (transfer floating): a new element on success, %NULL on failure. If
* more than one toplevel element is specified by the @pipeline_description,
- * all elements are put into a #GstPipeline, which then is returned.
+ * all elements are put into a #GstPipeline, which then is returned (unless
+ * the GST_PARSE_FLAG_PLACE_IN_BIN flag is set, in which case they are put
+ * in a #GstBin instead).
*/
GstElement *
gst_parse_launch_full (const gchar * pipeline_description,
* in some cases)
* @GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS: If a bin only has a single element,
* just return the element.
+ * @GST_PARSE_FLAG_PLACE_IN_BIN: If more than one toplevel element is described
+ * by the pipeline description string, put them in a #GstBin instead of a
+ * #GstPipeline. (Since 1.10)
*
* Parsing options.
*/
{
GST_PARSE_FLAG_NONE = 0,
GST_PARSE_FLAG_FATAL_ERRORS = (1 << 0),
- GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS = (1 << 1)
+ GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS = (1 << 1),
+ GST_PARSE_FLAG_PLACE_IN_BIN = (1 << 2)
} GstParseFlags;
#define GST_TYPE_PARSE_CONTEXT (gst_parse_context_get_type())
GstElement *bin;
bin = gst_parse_bin_from_description_full (set->value_str, TRUE, NULL,
- GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS, NULL);
+ GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS | GST_PARSE_FLAG_PLACE_IN_BIN, NULL);
if (bin) {
g_value_set_object (&v, bin);
got_value = TRUE;
GstElement *bin;
bin = gst_parse_bin_from_description_full (pos, TRUE, NULL,
- GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS, NULL);
+ GST_PARSE_FLAG_NO_SINGLE_ELEMENT_BINS | GST_PARSE_FLAG_PLACE_IN_BIN, NULL);
if (bin) {
g_value_set_object (&v, bin);
got_value = TRUE;
/* put all elements in our bin if necessary */
if(g.chain->elements->next){
- bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
+ if (flags & GST_PARSE_FLAG_PLACE_IN_BIN)
+ bin = GST_BIN (gst_element_factory_make ("bin", NULL));
+ else
+ bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
g_assert (bin);
for (walk = g.chain->elements; walk; walk = walk->next) {