# define YYDEBUG 1
#endif
-#endif // G_HAVE_ISO_VARARGS
+#endif /* G_HAVE_ISO_VARARGS */
-#define GST_BIN_MAKE(res, type, chain, assign) G_STMT_START{ \
+#define GST_BIN_MAKE(res, type, chainval, assign) G_STMT_START{ \
+ chain_t *chain = chainval; \
GSList *walk; \
GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \
- if (!bin) { \
- ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No bin \"%s\"", type); \
+ if (!chain) { \
+ ERROR (GST_PARSE_ERROR_EMPTY_BIN, "Specified empty bin \"%s\", not allowed", type); \
+ g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
+ g_slist_free (assign); \
+ YYERROR; \
+ } else if (!bin) { \
+ ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No bin \"%s\", omitting...", type); \
+ g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
+ g_slist_free (assign); \
+ res = chain; \
} else { \
walk = chain->elements; \
while (walk) { \
%%
element: IDENTIFIER { $$ = gst_element_factory_make ($1, NULL);
- if (!$$) ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No element \"%s\"", $1);
+ if (!$$)
+ ERROR (GST_PARSE_ERROR_NO_SUCH_ELEMENT, "No element \"%s\"", $1);
gst_parse_strfree ($1);
+ if (!$$)
+ YYERROR;
}
| element ASSIGNMENT { gst_parse_element_set ($2, $1, graph);
$$ = $1;
| BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2);
gst_parse_strfree ($1);
}
+ | '{' assignments '}' { GST_BIN_MAKE ($$, "thread", NULL, $2); }
+ | '(' assignments '}' { GST_BIN_MAKE ($$, "thread", NULL, $2); }
+ | BINREF assignments ')' { GST_BIN_MAKE ($$, $1, NULL, $2);
+ gst_parse_strfree ($1);
+ }
+ | '{' assignments error '}' { GST_BIN_MAKE ($$, "thread", NULL, $2); }
+ | '(' assignments error '}' { GST_BIN_MAKE ($$, "thread", NULL, $2); }
+ | BINREF assignments error ')' { GST_BIN_MAKE ($$, $1, NULL, $2);
+ gst_parse_strfree ($1);
+ }
;
pads: PADREF { $$ = g_slist_prepend (NULL, $1); }
linkpart: reference { $$ = $1; }
| pads { MAKE_REF ($$, NULL, $1); }
| /* NOP */ { MAKE_REF ($$, NULL, NULL); }
+ | linkpart error { $$ = $1; }
;
link: linkpart '!' linkpart { $$ = $1;
linklist: link { $$ = g_slist_prepend (NULL, $1); }
| link linklist { $$ = g_slist_prepend ($2, $1); }
+ | linklist error { $$ = $1; }
;
chain: element { $$ = gst_parse_chain_new ();
g_slist_free ($2);
$$ = $1;
}
+ | chain error { $$ = $1; }
;
graph: chain { $$ = (graph_t *) graph;
dstr = g_strdup (str);
_gst_parse_yy_scan_string (dstr);
-#ifdef DEBUG
+#ifdef GST_DEBUG_ENABLED
yydebug = 1;
#endif