gstreamer_core/gst/parse/grammar.tab.c
branchRCL_3
changeset 29 567bb019e3e3
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
6:9b2c3c7a1a9c 29:567bb019e3e3
     1 #ifdef HAVE_CONFIG_H
     1 #ifdef HAVE_CONFIG_H
     2 #ifdef __SYMBIAN32__
       
     3 #include "config.h"
       
     4 #else
       
     5 #include <config.h>
     2 #include <config.h>
     6 #endif
     3 #endif
     7 #endif
       
     8 
       
     9 
       
    10 /* A Bison parser, made by GNU Bison 2.3.  */
     4 /* A Bison parser, made by GNU Bison 2.3.  */
    11 
     5 
    12 /* Skeleton implementation for Bison's Yacc-like parsers in C
     6 /* Skeleton implementation for Bison's Yacc-like parsers in C
    13 
     7 
    14    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
     8    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   110 #include <glib-object.h>
   104 #include <glib-object.h>
   111 #include <glib.h>
   105 #include <glib.h>
   112 #include <stdio.h>
   106 #include <stdio.h>
   113 #include <string.h>
   107 #include <string.h>
   114 #include <stdlib.h>
   108 #include <stdlib.h>
       
   109 #ifdef __SYMBIAN32__
       
   110 #include <glib_global.h>
       
   111 #endif
   115 
   112 
   116 #include "../gst_private.h"
   113 #include "../gst_private.h"
   117 #include "../gst-i18n-lib.h"
   114 #include "../gst-i18n-lib.h"
   118 
   115 
   119 #include "../gstconfig.h"
   116 #include "../gstconfig.h"
   120 #include "../gstparse.h"
   117 #include "../gstparse.h"
   121 #include "../gstinfo.h"
   118 #include "../gstinfo.h"
   122 #include "../gsterror.h"
   119 #include "../gsterror.h"
       
   120 #include "../gststructure.h"
   123 #include "../gsturi.h"
   121 #include "../gsturi.h"
   124 #include "../gstutils.h"
   122 #include "../gstutils.h"
   125 #include "../gstvalue.h"
   123 #include "../gstvalue.h"
   126 #include "../gstchildproxy.h"
   124 #include "../gstchildproxy.h"
   127 #include "types.h"
   125 #include "types.h"
   233     g_set_error ((error), GST_PARSE_ERROR, (type), __VA_ARGS__); \
   231     g_set_error ((error), GST_PARSE_ERROR, (type), __VA_ARGS__); \
   234   } \
   232   } \
   235 } G_STMT_END
   233 } G_STMT_END
   236 
   234 
   237 #  define ERROR(type, ...) \
   235 #  define ERROR(type, ...) \
   238   SET_ERROR (((graph_t *) graph)->error, (type), __VA_ARGS__ )
   236   SET_ERROR (graph->error, (type), __VA_ARGS__ )
   239 
   237 
   240 #elif defined(G_HAVE_GNUC_VARARGS)
   238 #elif defined(G_HAVE_GNUC_VARARGS)
   241 
   239 
   242 #  define SET_ERROR(error, type, args...) \
   240 #  define SET_ERROR(error, type, args...) \
   243 G_STMT_START { \
   241 G_STMT_START { \
   246     g_set_error ((error), GST_PARSE_ERROR, (type), args ); \
   244     g_set_error ((error), GST_PARSE_ERROR, (type), args ); \
   247   } \
   245   } \
   248 } G_STMT_END
   246 } G_STMT_END
   249 
   247 
   250 #  define ERROR(type, args...) \
   248 #  define ERROR(type, args...) \
   251   SET_ERROR (((graph_t *) graph)->error,(type) , args )
   249   SET_ERROR (graph->error,(type) , args )
   252 
   250 
   253 #else
   251 #else
   254 
   252 
   255 static inline void
   253 static inline void
   256 SET_ERROR (GError **error, gint type, const char *format, ...)
   254 SET_ERROR (GError **error, gint type, const char *format, ...)
   319 
   317 
   320 #  endif /* G_HAVE_ISO_VARARGS */
   318 #  endif /* G_HAVE_ISO_VARARGS */
   321 
   319 
   322 #endif /* GST_DISABLE_GST_DEBUG */
   320 #endif /* GST_DISABLE_GST_DEBUG */
   323 
   321 
       
   322 #define ADD_MISSING_ELEMENT(graph,name) G_STMT_START {                      \
       
   323     if ((graph)->ctx) {                                                     \
       
   324       (graph)->ctx->missing_elements =                                      \
       
   325           g_list_append ((graph)->ctx->missing_elements, g_strdup (name));  \
       
   326     } } G_STMT_END
       
   327 
   324 #define GST_BIN_MAKE(res, type, chainval, assign, free_string) \
   328 #define GST_BIN_MAKE(res, type, chainval, assign, free_string) \
   325 G_STMT_START { \
   329 G_STMT_START { \
   326   chain_t *chain = chainval; \
   330   chain_t *chain = chainval; \
   327   GSList *walk; \
   331   GSList *walk; \
   328   GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \
   332   GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \
   329   if (!chain) { \
   333   if (!chain) { \
   330     SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY_BIN, \
   334     SET_ERROR (graph->error, GST_PARSE_ERROR_EMPTY_BIN, \
   331         _("specified empty bin \"%s\", not allowed"), type); \
   335         _("specified empty bin \"%s\", not allowed"), type); \
   332     g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
   336     g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
   333     g_slist_free (assign); \
   337     g_slist_free (assign); \
   334     gst_object_unref (bin); \
   338     gst_object_unref (bin); \
   335     if (free_string) \
   339     if (free_string) \
   336       gst_parse_strfree (type); /* Need to clean up the string */ \
   340       gst_parse_strfree (type); /* Need to clean up the string */ \
   337     YYERROR; \
   341     YYERROR; \
   338   } else if (!bin) { \
   342   } else if (!bin) { \
   339     SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \
   343     ADD_MISSING_ELEMENT(graph, type); \
       
   344     SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \
   340         _("no bin \"%s\", skipping"), type); \
   345         _("no bin \"%s\", skipping"), type); \
   341     g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
   346     g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
   342     g_slist_free (assign); \
   347     g_slist_free (assign); \
   343     res = chain; \
   348     res = chain; \
   344   } else { \
   349   } else { \
   388   GValue v = { 0, }; 
   393   GValue v = { 0, }; 
   389   GstObject *target = NULL;
   394   GstObject *target = NULL;
   390   GType value_type;
   395   GType value_type;
   391 
   396 
   392   if (gst_child_proxy_lookup (GST_OBJECT (set->parent), set->name, &target, &pspec)) { 
   397   if (gst_child_proxy_lookup (GST_OBJECT (set->parent), set->name, &target, &pspec)) { 
       
   398     gboolean got_value = FALSE;
       
   399 
   393     value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
   400     value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
   394 
   401 
   395     GST_CAT_LOG (GST_CAT_PIPELINE, "parsing delayed property %s as a %s from %s", pspec->name,
   402     GST_CAT_LOG (GST_CAT_PIPELINE, "parsing delayed property %s as a %s from %s", pspec->name,
   396       g_type_name (value_type), set->value_str);
   403       g_type_name (value_type), set->value_str);
   397     g_value_init (&v, value_type);
   404     g_value_init (&v, value_type);
   398     if (gst_value_deserialize (&v, set->value_str)) {
   405     if (gst_value_deserialize (&v, set->value_str))
   399       g_object_set_property (G_OBJECT (target), pspec->name, &v);
   406       got_value = TRUE;
       
   407     else if (g_type_is_a (value_type, GST_TYPE_ELEMENT)) {
       
   408        GstElement *bin;
       
   409        
       
   410        bin = gst_parse_bin_from_description (set->value_str, TRUE, NULL);
       
   411        if (bin) {
       
   412          g_value_set_object (&v, bin);
       
   413          got_value = TRUE;
       
   414        }
   400     }
   415     }
   401     g_signal_handler_disconnect (child_proxy, set->signal_id);
   416     g_signal_handler_disconnect (child_proxy, set->signal_id);
   402     g_free(set->name);
   417     g_free(set->name);
   403     g_free(set->value_str);
   418     g_free(set->value_str);
   404     g_free(set);
   419     g_free(set);
       
   420     if (!got_value)
       
   421       goto error;
       
   422     g_object_set_property (G_OBJECT (target), pspec->name, &v);
   405   }
   423   }
   406 
   424 
       
   425 out:
   407   if (G_IS_VALUE (&v))
   426   if (G_IS_VALUE (&v))
   408     g_value_unset (&v);
   427     g_value_unset (&v);
   409   if (target)
   428   if (target)
   410     gst_object_unref (target);
   429     gst_object_unref (target);
   411   return;
   430   return;
   412 }
   431 
   413 #ifdef __SYMBIAN32__
   432 error:
   414 #include<glib_global.h>
   433   GST_CAT_ERROR (GST_CAT_PIPELINE, "could not set property \"%s\" in element \"%s\"",
   415 #endif
   434 	 pspec->name, GST_ELEMENT_NAME (target));
       
   435   goto out;
       
   436 }
       
   437 
   416 
   438 
   417 static void
   439 static void
   418 gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph)
   440 gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph)
   419 {
   441 {
   420   GParamSpec *pspec;
   442   GParamSpec *pspec;
   421   gchar *pos = value;
   443   gchar *pos = value;
   422   GValue v = { 0, }; 
   444   GValue v = { 0, }; 
   423   GstObject *target = NULL;
   445   GstObject *target = NULL;
   424   GType value_type;
   446   GType value_type;
       
   447 
       
   448   /* do nothing if assignment is for missing element */
       
   449   if (element == NULL)
       
   450     goto out;
   425 
   451 
   426   /* parse the string, so the property name is null-terminated an pos points
   452   /* parse the string, so the property name is null-terminated an pos points
   427      to the beginning of the value */
   453      to the beginning of the value */
   428   while (!g_ascii_isspace (*pos) && (*pos != '=')) pos++; 
   454   while (!g_ascii_isspace (*pos) && (*pos != '=')) pos++; 
   429   if (*pos == '=') { 
   455   if (*pos == '=') { 
   440     pos[strlen (pos) - 1] = '\0';
   466     pos[strlen (pos) - 1] = '\0';
   441   }
   467   }
   442   gst_parse_unescape (pos);
   468   gst_parse_unescape (pos);
   443 
   469 
   444   if (gst_child_proxy_lookup (GST_OBJECT (element), value, &target, &pspec)) { 
   470   if (gst_child_proxy_lookup (GST_OBJECT (element), value, &target, &pspec)) { 
       
   471     gboolean got_value = FALSE;
       
   472 
   445     value_type = G_PARAM_SPEC_VALUE_TYPE (pspec); 
   473     value_type = G_PARAM_SPEC_VALUE_TYPE (pspec); 
       
   474 
   446     GST_CAT_LOG (GST_CAT_PIPELINE, "parsing property %s as a %s", pspec->name,
   475     GST_CAT_LOG (GST_CAT_PIPELINE, "parsing property %s as a %s", pspec->name,
   447       g_type_name (value_type));
   476       g_type_name (value_type));
   448     g_value_init (&v, value_type);
   477     g_value_init (&v, value_type);
   449     if (!gst_value_deserialize (&v, pos))
   478     if (gst_value_deserialize (&v, pos))
       
   479       got_value = TRUE;
       
   480     else if (g_type_is_a (value_type, GST_TYPE_ELEMENT)) {
       
   481        GstElement *bin;
       
   482        
       
   483        bin = gst_parse_bin_from_description (pos, TRUE, NULL);
       
   484        if (bin) {
       
   485          g_value_set_object (&v, bin);
       
   486          got_value = TRUE;
       
   487        }
       
   488     }
       
   489     if (!got_value)
   450       goto error;
   490       goto error;
   451     g_object_set_property (G_OBJECT (target), pspec->name, &v);
   491     g_object_set_property (G_OBJECT (target), pspec->name, &v);
   452   } else { 
   492   } else { 
   453     /* do a delayed set */
   493     /* do a delayed set */
   454     if (GST_IS_CHILD_PROXY (element)) {
   494     if (GST_IS_CHILD_PROXY (element)) {
   458       data->name = g_strdup(value);
   498       data->name = g_strdup(value);
   459       data->value_str = g_strdup(pos);
   499       data->value_str = g_strdup(pos);
   460       data->signal_id = g_signal_connect(GST_OBJECT (element),"child-added", G_CALLBACK (gst_parse_new_child), data);
   500       data->signal_id = g_signal_connect(GST_OBJECT (element),"child-added", G_CALLBACK (gst_parse_new_child), data);
   461     }
   501     }
   462     else {
   502     else {
   463       SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_PROPERTY, \
   503       SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_PROPERTY, \
   464           _("no property \"%s\" in element \"%s\""), value, \
   504           _("no property \"%s\" in element \"%s\""), value, \
   465           GST_ELEMENT_NAME (element));
   505           GST_ELEMENT_NAME (element));
   466     }
   506     }
   467   }
   507   }
   468 
   508 
   473   if (target)
   513   if (target)
   474     gst_object_unref (target);
   514     gst_object_unref (target);
   475   return;
   515   return;
   476   
   516   
   477 error:
   517 error:
   478   SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
   518   SET_ERROR (graph->error, GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
   479          _("could not set property \"%s\" in element \"%s\" to \"%s\""), 
   519          _("could not set property \"%s\" in element \"%s\" to \"%s\""), 
   480 	 value, GST_ELEMENT_NAME (element), pos); 
   520 	 value, GST_ELEMENT_NAME (element), pos); 
   481   goto out;
   521   goto out;
   482 }
   522 }
   483 static inline void
   523 static inline void
   615 success:
   655 success:
   616   gst_parse_free_link (link);
   656   gst_parse_free_link (link);
   617   return 0;
   657   return 0;
   618   
   658   
   619 error:
   659 error:
   620   SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
   660   SET_ERROR (graph->error, GST_PARSE_ERROR_LINK,
   621       _("could not link %s to %s"), GST_ELEMENT_NAME (src),
   661       _("could not link %s to %s"), GST_ELEMENT_NAME (src),
   622       GST_ELEMENT_NAME (sink));
   662       GST_ELEMENT_NAME (sink));
   623   gst_parse_free_link (link);
   663   gst_parse_free_link (link);
   624   return -1;
   664   return -1;
   625 }
   665 }
   646 # define YYTOKEN_TABLE 0
   686 # define YYTOKEN_TABLE 0
   647 #endif
   687 #endif
   648 
   688 
   649 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
   689 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
   650 typedef union YYSTYPE
   690 typedef union YYSTYPE
   651 #line 521 "./grammar.y"
   691 #line 566 "./grammar.y"
   652 {
   692 {
   653     gchar *s;
   693     gchar *s;
   654     chain_t *c;
   694     chain_t *c;
   655     link_t *l;
   695     link_t *l;
   656     GstElement *e;
   696     GstElement *e;
   657     GSList *p;
   697     GSList *p;
   658     graph_t *g;
   698     graph_t *g;
   659 }
   699 }
   660 /* Line 187 of yacc.c.  */
   700 /* Line 187 of yacc.c.  */
   661 #line 651 "grammar.tab.c"
   701 #line 696 "grammar.tab.c"
   662 	YYSTYPE;
   702 	YYSTYPE;
   663 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
   703 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
   664 # define YYSTYPE_IS_DECLARED 1
   704 # define YYSTYPE_IS_DECLARED 1
   665 # define YYSTYPE_IS_TRIVIAL 1
   705 # define YYSTYPE_IS_TRIVIAL 1
   666 #endif
   706 #endif
   669 
   709 
   670 /* Copy the second part of user declarations.  */
   710 /* Copy the second part of user declarations.  */
   671 
   711 
   672 
   712 
   673 /* Line 216 of yacc.c.  */
   713 /* Line 216 of yacc.c.  */
   674 #line 664 "grammar.tab.c"
   714 #line 709 "grammar.tab.c"
   675 
   715 
   676 #ifdef short
   716 #ifdef short
   677 # undef short
   717 # undef short
   678 #endif
   718 #endif
   679 
   719 
   811 #  endif
   851 #  endif
   812 #  ifndef YYMALLOC
   852 #  ifndef YYMALLOC
   813 #   define YYMALLOC malloc
   853 #   define YYMALLOC malloc
   814 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
   854 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
   815      || defined __cplusplus || defined _MSC_VER)
   855      || defined __cplusplus || defined _MSC_VER)
   816 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
   856 IMPORT_C void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
   817 #   endif
   857 #   endif
   818 #  endif
   858 #  endif
   819 #  ifndef YYFREE
   859 #  ifndef YYFREE
   820 #   define YYFREE free
   860 #   define YYFREE free
   821 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
   861 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
   822      || defined __cplusplus || defined _MSC_VER)
   862      || defined __cplusplus || defined _MSC_VER)
   823 void free (void *); /* INFRINGES ON USER NAME SPACE */
   863 IMPORT_C void free (void *); /* INFRINGES ON USER NAME SPACE */
   824 #   endif
   864 #   endif
   825 #  endif
   865 #  endif
   826 # endif
   866 # endif
   827 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
   867 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
   828 
   868 
   962 };
  1002 };
   963 
  1003 
   964 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
  1004 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
   965 static const yytype_uint16 yyrline[] =
  1005 static const yytype_uint16 yyrline[] =
   966 {
  1006 {
   967        0,   556,   556,   564,   568,   569,   571,   572,   575,   578,
  1007        0,   601,   601,   615,   619,   620,   622,   623,   626,   629,
   968      583,   584,   588,   589,   592,   593,   596,   597,   598,   601,
  1008      634,   635,   639,   640,   643,   644,   647,   648,   649,   652,
   969      614,   615,   616,   619,   624,   625,   660,   688,   689,   703,
  1009      665,   666,   667,   670,   675,   676,   711,   739,   740,   754,
   970      723,   748,   751
  1010      774,   799,   802
   971 };
  1011 };
   972 #endif
  1012 #endif
   973 
  1013 
   974 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  1014 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
   975 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  1015 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  1932 
  1972 
  1933   YY_REDUCE_PRINT (yyn);
  1973   YY_REDUCE_PRINT (yyn);
  1934   switch (yyn)
  1974   switch (yyn)
  1935     {
  1975     {
  1936         case 2:
  1976         case 2:
  1937 #line 556 "./grammar.y"
  1977 #line 601 "./grammar.y"
  1938     { (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL); 
  1978     { (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL); 
  1939 						if ((yyval.e) == NULL) {
  1979 						if ((yyval.e) == NULL) {
  1940 						  SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), (yyvsp[(1) - (1)].s));
  1980 						  ADD_MISSING_ELEMENT (graph, (yyvsp[(1) - (1)].s));
  1941 						  gst_parse_strfree ((yyvsp[(1) - (1)].s));
  1981 						  SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), (yyvsp[(1) - (1)].s));
  1942 						  YYERROR;
  1982 						  /* if FATAL_ERRORS flag is set, we don't have to worry about backwards
       
  1983 						   * compatibility and can continue parsing and check for other missing
       
  1984 						   * elements */
       
  1985 						  if ((graph->flags & GST_PARSE_FLAG_FATAL_ERRORS) == 0) {
       
  1986 						    gst_parse_strfree ((yyvsp[(1) - (1)].s));
       
  1987 						    YYERROR;
       
  1988 						  }
  1943 						}
  1989 						}
  1944 						gst_parse_strfree ((yyvsp[(1) - (1)].s));
  1990 						gst_parse_strfree ((yyvsp[(1) - (1)].s));
  1945                                               ;}
  1991                                               ;}
  1946     break;
  1992     break;
  1947 
  1993 
  1948   case 3:
  1994   case 3:
  1949 #line 564 "./grammar.y"
  1995 #line 615 "./grammar.y"
  1950     { gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph);
  1996     { gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph);
  1951 						(yyval.e) = (yyvsp[(1) - (2)].e);
  1997 						(yyval.e) = (yyvsp[(1) - (2)].e);
  1952 	                                      ;}
  1998 	                                      ;}
  1953     break;
  1999     break;
  1954 
  2000 
  1955   case 4:
  2001   case 4:
  1956 #line 568 "./grammar.y"
  2002 #line 619 "./grammar.y"
  1957     { (yyval.p) = NULL; ;}
  2003     { (yyval.p) = NULL; ;}
  1958     break;
  2004     break;
  1959 
  2005 
  1960   case 5:
  2006   case 5:
  1961 #line 569 "./grammar.y"
  2007 #line 620 "./grammar.y"
  1962     { (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s)); ;}
  2008     { (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s)); ;}
  1963     break;
  2009     break;
  1964 
  2010 
  1965   case 6:
  2011   case 6:
  1966 #line 571 "./grammar.y"
  2012 #line 622 "./grammar.y"
  1967     { GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), FALSE); ;}
  2013     { GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), FALSE); ;}
  1968     break;
  2014     break;
  1969 
  2015 
  1970   case 7:
  2016   case 7:
  1971 #line 572 "./grammar.y"
  2017 #line 623 "./grammar.y"
  1972     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), TRUE); 
  2018     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), TRUE); 
  1973 						gst_parse_strfree ((yyvsp[(1) - (4)].s));
  2019 						gst_parse_strfree ((yyvsp[(1) - (4)].s));
  1974 					      ;}
  2020 					      ;}
  1975     break;
  2021     break;
  1976 
  2022 
  1977   case 8:
  2023   case 8:
  1978 #line 575 "./grammar.y"
  2024 #line 626 "./grammar.y"
  1979     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL, (yyvsp[(2) - (3)].p), TRUE); 
  2025     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL, (yyvsp[(2) - (3)].p), TRUE); 
  1980 						gst_parse_strfree ((yyvsp[(1) - (3)].s));
  2026 						gst_parse_strfree ((yyvsp[(1) - (3)].s));
  1981 					      ;}
  2027 					      ;}
  1982     break;
  2028     break;
  1983 
  2029 
  1984   case 9:
  2030   case 9:
  1985 #line 578 "./grammar.y"
  2031 #line 629 "./grammar.y"
  1986     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL, (yyvsp[(2) - (4)].p), TRUE); 
  2032     { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL, (yyvsp[(2) - (4)].p), TRUE); 
  1987 						gst_parse_strfree ((yyvsp[(1) - (4)].s));
  2033 						gst_parse_strfree ((yyvsp[(1) - (4)].s));
  1988 					      ;}
  2034 					      ;}
  1989     break;
  2035     break;
  1990 
  2036 
  1991   case 10:
  2037   case 10:
  1992 #line 583 "./grammar.y"
  2038 #line 634 "./grammar.y"
  1993     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s)); ;}
  2039     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s)); ;}
  1994     break;
  2040     break;
  1995 
  2041 
  1996   case 11:
  2042   case 11:
  1997 #line 584 "./grammar.y"
  2043 #line 635 "./grammar.y"
  1998     { (yyval.p) = (yyvsp[(2) - (2)].p);
  2044     { (yyval.p) = (yyvsp[(2) - (2)].p);
  1999 						(yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s));
  2045 						(yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s));
  2000 					      ;}
  2046 					      ;}
  2001     break;
  2047     break;
  2002 
  2048 
  2003   case 12:
  2049   case 12:
  2004 #line 588 "./grammar.y"
  2050 #line 639 "./grammar.y"
  2005     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s)); ;}
  2051     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s)); ;}
  2006     break;
  2052     break;
  2007 
  2053 
  2008   case 13:
  2054   case 13:
  2009 #line 589 "./grammar.y"
  2055 #line 640 "./grammar.y"
  2010     { (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s)); ;}
  2056     { (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s)); ;}
  2011     break;
  2057     break;
  2012 
  2058 
  2013   case 14:
  2059   case 14:
  2014 #line 592 "./grammar.y"
  2060 #line 643 "./grammar.y"
  2015     { MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL); ;}
  2061     { MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL); ;}
  2016     break;
  2062     break;
  2017 
  2063 
  2018   case 15:
  2064   case 15:
  2019 #line 593 "./grammar.y"
  2065 #line 644 "./grammar.y"
  2020     { MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p)); ;}
  2066     { MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p)); ;}
  2021     break;
  2067     break;
  2022 
  2068 
  2023   case 16:
  2069   case 16:
  2024 #line 596 "./grammar.y"
  2070 #line 647 "./grammar.y"
  2025     { (yyval.l) = (yyvsp[(1) - (1)].l); ;}
  2071     { (yyval.l) = (yyvsp[(1) - (1)].l); ;}
  2026     break;
  2072     break;
  2027 
  2073 
  2028   case 17:
  2074   case 17:
  2029 #line 597 "./grammar.y"
  2075 #line 648 "./grammar.y"
  2030     { MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p)); ;}
  2076     { MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p)); ;}
  2031     break;
  2077     break;
  2032 
  2078 
  2033   case 18:
  2079   case 18:
  2034 #line 598 "./grammar.y"
  2080 #line 649 "./grammar.y"
  2035     { MAKE_REF ((yyval.l), NULL, NULL); ;}
  2081     { MAKE_REF ((yyval.l), NULL, NULL); ;}
  2036     break;
  2082     break;
  2037 
  2083 
  2038   case 19:
  2084   case 19:
  2039 #line 601 "./grammar.y"
  2085 #line 652 "./grammar.y"
  2040     { (yyval.l) = (yyvsp[(1) - (3)].l);
  2086     { (yyval.l) = (yyvsp[(1) - (3)].l);
  2041 						if ((yyvsp[(2) - (3)].s)) {
  2087 						if ((yyvsp[(2) - (3)].s)) {
  2042 						  (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s));
  2088 						  (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s));
  2043 						  if ((yyval.l)->caps == NULL)
  2089 						  if ((yyval.l)->caps == NULL)
  2044 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s));
  2090 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s));
  2045 						  gst_parse_strfree ((yyvsp[(2) - (3)].s));
  2091 						  gst_parse_strfree ((yyvsp[(2) - (3)].s));
  2046 						}
  2092 						}
  2047 						(yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name;
  2093 						(yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name;
  2048 						(yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads;
  2094 						(yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads;
  2049 						gst_parse_link_free ((yyvsp[(3) - (3)].l));
  2095 						gst_parse_link_free ((yyvsp[(3) - (3)].l));
  2050 					      ;}
  2096 					      ;}
  2051     break;
  2097     break;
  2052 
  2098 
  2053   case 20:
  2099   case 20:
  2054 #line 614 "./grammar.y"
  2100 #line 665 "./grammar.y"
  2055     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l)); ;}
  2101     { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l)); ;}
  2056     break;
  2102     break;
  2057 
  2103 
  2058   case 21:
  2104   case 21:
  2059 #line 615 "./grammar.y"
  2105 #line 666 "./grammar.y"
  2060     { (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l)); ;}
  2106     { (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l)); ;}
  2061     break;
  2107     break;
  2062 
  2108 
  2063   case 22:
  2109   case 22:
  2064 #line 616 "./grammar.y"
  2110 #line 667 "./grammar.y"
  2065     { (yyval.p) = (yyvsp[(1) - (2)].p); ;}
  2111     { (yyval.p) = (yyvsp[(1) - (2)].p); ;}
  2066     break;
  2112     break;
  2067 
  2113 
  2068   case 23:
  2114   case 23:
  2069 #line 619 "./grammar.y"
  2115 #line 670 "./grammar.y"
  2070     { (yyval.c) = gst_parse_chain_new ();
  2116     { (yyval.c) = gst_parse_chain_new ();
  2071 						(yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e);
  2117 						(yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e);
  2072 						(yyval.c)->front = (yyval.c)->back = NULL;
  2118 						(yyval.c)->front = (yyval.c)->back = NULL;
  2073 						(yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e));
  2119 						(yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e));
  2074 					      ;}
  2120 					      ;}
  2075     break;
  2121     break;
  2076 
  2122 
  2077   case 24:
  2123   case 24:
  2078 #line 624 "./grammar.y"
  2124 #line 675 "./grammar.y"
  2079     { (yyval.c) = (yyvsp[(1) - (1)].c); ;}
  2125     { (yyval.c) = (yyvsp[(1) - (1)].c); ;}
  2080     break;
  2126     break;
  2081 
  2127 
  2082   case 25:
  2128   case 25:
  2083 #line 625 "./grammar.y"
  2129 #line 676 "./grammar.y"
  2084     { if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) {
  2130     { if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) {
  2085 						  if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
  2131 						  if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
  2086 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2132 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2087 						    gst_parse_free_link ((yyvsp[(1) - (2)].c)->back);
  2133 						    gst_parse_free_link ((yyvsp[(1) - (2)].c)->back);
  2088 						  } else {
  2134 						  } else {
  2089 						    ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(1) - (2)].c)->back);
  2135 						    graph->links = g_slist_prepend (graph->links, (yyvsp[(1) - (2)].c)->back);
  2090 						  }
  2136 						  }
  2091 						  if (!(yyvsp[(2) - (2)].c)->front->src_name) {
  2137 						  if (!(yyvsp[(2) - (2)].c)->front->src_name) {
  2092 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2138 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2093 						    gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
  2139 						    gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
  2094 						  } else {
  2140 						  } else {
  2095 						    ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(2) - (2)].c)->front);
  2141 						    graph->links = g_slist_prepend (graph->links, (yyvsp[(2) - (2)].c)->front);
  2096 						  }
  2142 						  }
  2097 						  (yyvsp[(1) - (2)].c)->back = NULL;
  2143 						  (yyvsp[(1) - (2)].c)->back = NULL;
  2098 						} else if ((yyvsp[(1) - (2)].c)->back) {
  2144 						} else if ((yyvsp[(1) - (2)].c)->back) {
  2099 						  if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
  2145 						  if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
  2100 						    (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first;
  2146 						    (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first;
  2105 						  }
  2151 						  }
  2106 						  (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->front;
  2152 						  (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->front;
  2107 						}
  2153 						}
  2108 						
  2154 						
  2109 						if ((yyvsp[(1) - (2)].c)->back) {
  2155 						if ((yyvsp[(1) - (2)].c)->back) {
  2110 						  ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(1) - (2)].c)->back);
  2156 						  graph->links = g_slist_prepend (graph->links, (yyvsp[(1) - (2)].c)->back);
  2111 						}
  2157 						}
  2112 						(yyvsp[(1) - (2)].c)->last = (yyvsp[(2) - (2)].c)->last;
  2158 						(yyvsp[(1) - (2)].c)->last = (yyvsp[(2) - (2)].c)->last;
  2113 						(yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->back;
  2159 						(yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->back;
  2114 						(yyvsp[(1) - (2)].c)->elements = g_slist_concat ((yyvsp[(1) - (2)].c)->elements, (yyvsp[(2) - (2)].c)->elements);
  2160 						(yyvsp[(1) - (2)].c)->elements = g_slist_concat ((yyvsp[(1) - (2)].c)->elements, (yyvsp[(2) - (2)].c)->elements);
  2115 						if ((yyvsp[(2) - (2)].c))
  2161 						if ((yyvsp[(2) - (2)].c))
  2117 						(yyval.c) = (yyvsp[(1) - (2)].c);
  2163 						(yyval.c) = (yyvsp[(1) - (2)].c);
  2118 					      ;}
  2164 					      ;}
  2119     break;
  2165     break;
  2120 
  2166 
  2121   case 26:
  2167   case 26:
  2122 #line 660 "./grammar.y"
  2168 #line 711 "./grammar.y"
  2123     { GSList *walk;
  2169     { GSList *walk;
  2124 						if ((yyvsp[(1) - (2)].c)->back) {
  2170 						if ((yyvsp[(1) - (2)].c)->back) {
  2125 						  (yyvsp[(2) - (2)].p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].c)->back);
  2171 						  (yyvsp[(2) - (2)].p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].c)->back);
  2126 						  (yyvsp[(1) - (2)].c)->back = NULL;
  2172 						  (yyvsp[(1) - (2)].c)->back = NULL;
  2127 						} else {
  2173 						} else {
  2130 						  }						  
  2176 						  }						  
  2131 						}
  2177 						}
  2132 						for (walk = (yyvsp[(2) - (2)].p); walk; walk = walk->next) {
  2178 						for (walk = (yyvsp[(2) - (2)].p); walk; walk = walk->next) {
  2133 						  link_t *link = (link_t *) walk->data;
  2179 						  link_t *link = (link_t *) walk->data;
  2134 						  if (!link->sink_name && walk->next) {
  2180 						  if (!link->sink_name && walk->next) {
  2135 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2181 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2136 						    gst_parse_free_link (link);
  2182 						    gst_parse_free_link (link);
  2137 						  } else if (!link->src_name && !link->src) {
  2183 						  } else if (!link->src_name && !link->src) {
  2138 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2184 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2139 						    gst_parse_free_link (link);
  2185 						    gst_parse_free_link (link);
  2140 						  } else {
  2186 						  } else {
  2141 						    if (walk->next) {
  2187 						    if (walk->next) {
  2142 						      ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, link);
  2188 						      graph->links = g_slist_prepend (graph->links, link);
  2143 						    } else {
  2189 						    } else {
  2144 						      (yyvsp[(1) - (2)].c)->back = link;
  2190 						      (yyvsp[(1) - (2)].c)->back = link;
  2145 						    }
  2191 						    }
  2146 						  }
  2192 						  }
  2147 						}
  2193 						}
  2149 						(yyval.c) = (yyvsp[(1) - (2)].c);
  2195 						(yyval.c) = (yyvsp[(1) - (2)].c);
  2150 					      ;}
  2196 					      ;}
  2151     break;
  2197     break;
  2152 
  2198 
  2153   case 27:
  2199   case 27:
  2154 #line 688 "./grammar.y"
  2200 #line 739 "./grammar.y"
  2155     { (yyval.c) = (yyvsp[(1) - (2)].c); ;}
  2201     { (yyval.c) = (yyvsp[(1) - (2)].c); ;}
  2156     break;
  2202     break;
  2157 
  2203 
  2158   case 28:
  2204   case 28:
  2159 #line 689 "./grammar.y"
  2205 #line 740 "./grammar.y"
  2160     { if ((yyvsp[(2) - (2)].c)->front) {
  2206     { if ((yyvsp[(2) - (2)].c)->front) {
  2161 						  if (!(yyvsp[(2) - (2)].c)->front->src_name) {
  2207 						  if (!(yyvsp[(2) - (2)].c)->front->src_name) {
  2162 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2208 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2163 						    gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
  2209 						    gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
  2164 						  } else {
  2210 						  } else {
  2165 						    ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(2) - (2)].c)->front);
  2211 						    graph->links = g_slist_prepend (graph->links, (yyvsp[(2) - (2)].c)->front);
  2166 						  }
  2212 						  }
  2167 						}
  2213 						}
  2168 						if (!(yyvsp[(1) - (2)].l)->sink_name) {
  2214 						if (!(yyvsp[(1) - (2)].l)->sink_name) {
  2169 						  (yyvsp[(1) - (2)].l)->sink = (yyvsp[(2) - (2)].c)->first;
  2215 						  (yyvsp[(1) - (2)].l)->sink = (yyvsp[(2) - (2)].c)->first;
  2170 						}
  2216 						}
  2172 						(yyval.c) = (yyvsp[(2) - (2)].c);
  2218 						(yyval.c) = (yyvsp[(2) - (2)].c);
  2173 					      ;}
  2219 					      ;}
  2174     break;
  2220     break;
  2175 
  2221 
  2176   case 29:
  2222   case 29:
  2177 #line 703 "./grammar.y"
  2223 #line 754 "./grammar.y"
  2178     { (yyval.c) = (yyvsp[(2) - (2)].c);
  2224     { (yyval.c) = (yyvsp[(2) - (2)].c);
  2179 						if ((yyval.c)->front) {
  2225 						if ((yyval.c)->front) {
  2180 						  GstElement *element = 
  2226 						  GstElement *element = 
  2181 							  gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL);
  2227 							  gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL);
  2182 						  if (!element) {
  2228 						  if (!element) {
  2183 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, 
  2229 						    SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, 
  2184 							    _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s));
  2230 							    _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s));
  2185 						  } else {
  2231 						  } else {
  2186 						    (yyval.c)->front->src = element;
  2232 						    (yyval.c)->front->src = element;
  2187 						    ((graph_t *) graph)->links = g_slist_prepend (
  2233 						    graph->links = g_slist_prepend (
  2188 							    ((graph_t *) graph)->links, (yyval.c)->front);
  2234 							    graph->links, (yyval.c)->front);
  2189 						    (yyval.c)->front = NULL;
  2235 						    (yyval.c)->front = NULL;
  2190 						    (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element);
  2236 						    (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element);
  2191 						  }
  2237 						  }
  2192 						} else {
  2238 						} else {
  2193 						  SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, 
  2239 						  SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, 
  2194 							  _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s));
  2240 							  _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s));
  2195 						}
  2241 						}
  2196 						g_free ((yyvsp[(1) - (2)].s));
  2242 						g_free ((yyvsp[(1) - (2)].s));
  2197 					      ;}
  2243 					      ;}
  2198     break;
  2244     break;
  2199 
  2245 
  2200   case 30:
  2246   case 30:
  2201 #line 723 "./grammar.y"
  2247 #line 774 "./grammar.y"
  2202     { GstElement *element =
  2248     { GstElement *element =
  2203 							  gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL);
  2249 							  gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL);
  2204 						if (!element) {
  2250 						if (!element) {
  2205 						  SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, 
  2251 						  SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, 
  2206 							  _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
  2252 							  _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
  2207 						  gst_parse_link_free ((yyvsp[(1) - (2)].l));
  2253 						  gst_parse_link_free ((yyvsp[(1) - (2)].l));
  2208 						  g_free ((yyvsp[(2) - (2)].s));
  2254 						  g_free ((yyvsp[(2) - (2)].s));
  2209 						  YYERROR;
  2255 						  YYERROR;
  2210 						} else if ((yyvsp[(1) - (2)].l)->sink_name || (yyvsp[(1) - (2)].l)->sink_pads) {
  2256 						} else if ((yyvsp[(1) - (2)].l)->sink_name || (yyvsp[(1) - (2)].l)->sink_pads) {
  2211                                                   gst_object_unref (element);
  2257                                                   gst_object_unref (element);
  2212 						  SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, 
  2258 						  SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, 
  2213 							  _("could not link sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
  2259 							  _("could not link sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
  2214 						  gst_parse_link_free ((yyvsp[(1) - (2)].l));
  2260 						  gst_parse_link_free ((yyvsp[(1) - (2)].l));
  2215 						  g_free ((yyvsp[(2) - (2)].s));
  2261 						  g_free ((yyvsp[(2) - (2)].s));
  2216 						  YYERROR;
  2262 						  YYERROR;
  2217 						} else {
  2263 						} else {
  2224 						g_free ((yyvsp[(2) - (2)].s));
  2270 						g_free ((yyvsp[(2) - (2)].s));
  2225 					      ;}
  2271 					      ;}
  2226     break;
  2272     break;
  2227 
  2273 
  2228   case 31:
  2274   case 31:
  2229 #line 748 "./grammar.y"
  2275 #line 799 "./grammar.y"
  2230     { SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY, _("empty pipeline not allowed"));
  2276     { SET_ERROR (graph->error, GST_PARSE_ERROR_EMPTY, _("empty pipeline not allowed"));
  2231 						(yyval.g) = (graph_t *) graph;
  2277 						(yyval.g) = graph;
  2232 					      ;}
  2278 					      ;}
  2233     break;
  2279     break;
  2234 
  2280 
  2235   case 32:
  2281   case 32:
  2236 #line 751 "./grammar.y"
  2282 #line 802 "./grammar.y"
  2237     { (yyval.g) = (graph_t *) graph;
  2283     { (yyval.g) = graph;
  2238 						if ((yyvsp[(1) - (1)].c)->front) {
  2284 						if ((yyvsp[(1) - (1)].c)->front) {
  2239 						  if (!(yyvsp[(1) - (1)].c)->front->src_name) {
  2285 						  if (!(yyvsp[(1) - (1)].c)->front->src_name) {
  2240 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2286 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element"));
  2241 						    gst_parse_free_link ((yyvsp[(1) - (1)].c)->front);
  2287 						    gst_parse_free_link ((yyvsp[(1) - (1)].c)->front);
  2242 						  } else {
  2288 						  } else {
  2243 						    (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front);
  2289 						    (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front);
  2244 						  }
  2290 						  }
  2245 						  (yyvsp[(1) - (1)].c)->front = NULL;
  2291 						  (yyvsp[(1) - (1)].c)->front = NULL;
  2246 						}
  2292 						}
  2247 						if ((yyvsp[(1) - (1)].c)->back) {
  2293 						if ((yyvsp[(1) - (1)].c)->back) {
  2248 						  if (!(yyvsp[(1) - (1)].c)->back->sink_name) {
  2294 						  if (!(yyvsp[(1) - (1)].c)->back->sink_name) {
  2249 						    SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2295 						    SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without sink element"));
  2250 						    gst_parse_free_link ((yyvsp[(1) - (1)].c)->back);
  2296 						    gst_parse_free_link ((yyvsp[(1) - (1)].c)->back);
  2251 						  } else {
  2297 						  } else {
  2252 						    (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back);
  2298 						    (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back);
  2253 						  }
  2299 						  }
  2254 						  (yyvsp[(1) - (1)].c)->back = NULL;
  2300 						  (yyvsp[(1) - (1)].c)->back = NULL;
  2257 					      ;}
  2303 					      ;}
  2258     break;
  2304     break;
  2259 
  2305 
  2260 
  2306 
  2261 /* Line 1267 of yacc.c.  */
  2307 /* Line 1267 of yacc.c.  */
  2262 #line 2252 "grammar.tab.c"
  2308 #line 2303 "grammar.tab.c"
  2263       default: break;
  2309       default: break;
  2264     }
  2310     }
  2265   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  2311   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  2266 
  2312 
  2267   YYPOPSTACK (yylen);
  2313   YYPOPSTACK (yylen);
  2471   /* Make sure YYID is used.  */
  2517   /* Make sure YYID is used.  */
  2472   return YYID (yyresult);
  2518   return YYID (yyresult);
  2473 }
  2519 }
  2474 
  2520 
  2475 
  2521 
  2476 #line 774 "./grammar.y"
  2522 #line 825 "./grammar.y"
  2477 
  2523 
  2478 
  2524 
  2479 
  2525 
  2480 static int
  2526 static int
  2481 yyerror (void *scanner, graph_t *graph, const char *s)
  2527 yyerror (void *scanner, graph_t *graph, const char *s)
  2485   return -1;
  2531   return -1;
  2486 }
  2532 }
  2487 
  2533 
  2488 
  2534 
  2489 GstElement *
  2535 GstElement *
  2490 _gst_parse_launch (const gchar *str, GError **error)
  2536 _gst_parse_launch (const gchar *str, GError **error, GstParseContext *ctx,
       
  2537     GstParseFlags flags)
  2491 {
  2538 {
  2492   graph_t g;
  2539   graph_t g;
  2493   gchar *dstr;
  2540   gchar *dstr;
  2494   GSList *walk;
  2541   GSList *walk;
  2495   GstBin *bin = NULL;
  2542   GstBin *bin = NULL;
  2496   GstElement *ret;
  2543   GstElement *ret;
  2497   yyscan_t scanner;
  2544   yyscan_t scanner;
  2498 
  2545 
  2499   g_return_val_if_fail (str != NULL, NULL);
  2546   g_return_val_if_fail (str != NULL, NULL);
       
  2547   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
  2500 
  2548 
  2501   g.chain = NULL;
  2549   g.chain = NULL;
  2502   g.links = NULL;
  2550   g.links = NULL;
  2503   g.error = error;
  2551   g.error = error;
       
  2552   g.ctx = ctx;
       
  2553   g.flags = flags;
  2504   
  2554   
  2505 #ifdef __GST_PARSE_TRACE
  2555 #ifdef __GST_PARSE_TRACE
  2506   GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
  2556   GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
  2507   __strings = __chains = __links = 0;
  2557   __strings = __chains = __links = 0;
  2508 #endif /* __GST_PARSE_TRACE */
  2558 #endif /* __GST_PARSE_TRACE */
  2531       g.chain ? g_slist_length (g.chain->elements) : 0,
  2581       g.chain ? g_slist_length (g.chain->elements) : 0,
  2532       g_slist_length (g.links));
  2582       g_slist_length (g.links));
  2533   
  2583   
  2534   if (!g.chain) {
  2584   if (!g.chain) {
  2535     ret = NULL;
  2585     ret = NULL;
  2536   } else if (!(((chain_t *) g.chain)->elements->next)) {
  2586   } else if (!g.chain->elements->next) {
  2537     /* only one toplevel element */  
  2587     /* only one toplevel element */  
  2538     ret = (GstElement *) ((chain_t *) g.chain)->elements->data;
  2588     ret = (GstElement *) g.chain->elements->data;
  2539     g_slist_free (((chain_t *) g.chain)->elements);
  2589     g_slist_free (g.chain->elements);
  2540     if (GST_IS_BIN (ret))
  2590     if (GST_IS_BIN (ret))
  2541       bin = GST_BIN (ret);
  2591       bin = GST_BIN (ret);
  2542     gst_parse_chain_free (g.chain);
  2592     gst_parse_chain_free (g.chain);
  2543   } else {  
  2593   } else {  
  2544     /* put all elements in our bin */
  2594     /* put all elements in our bin */
  2567         } else {
  2617         } else {
  2568           l->src = strcmp (GST_ELEMENT_NAME (ret), l->src_name) == 0 ? ret : NULL;
  2618           l->src = strcmp (GST_ELEMENT_NAME (ret), l->src_name) == 0 ? ret : NULL;
  2569         }
  2619         }
  2570       }
  2620       }
  2571       if (!l->src) {
  2621       if (!l->src) {
  2572         SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
  2622         if (l->src_name) {
  2573             "No element named \"%s\" - omitting link", l->src_name);
  2623           SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
       
  2624               "No element named \"%s\" - omitting link", l->src_name);
       
  2625         } else {
       
  2626           /* probably a missing element which we've handled already */
       
  2627         }
  2574         gst_parse_free_link (l);
  2628         gst_parse_free_link (l);
  2575         continue;
  2629         continue;
  2576       }
  2630       }
  2577     }
  2631     }
  2578     if (!l->sink) {
  2632     if (!l->sink) {
  2584         } else {
  2638         } else {
  2585           l->sink = strcmp (GST_ELEMENT_NAME (ret), l->sink_name) == 0 ? ret : NULL;
  2639           l->sink = strcmp (GST_ELEMENT_NAME (ret), l->sink_name) == 0 ? ret : NULL;
  2586         }
  2640         }
  2587       }
  2641       }
  2588       if (!l->sink) {
  2642       if (!l->sink) {
  2589         SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
  2643         if (l->sink_name) {
  2590             "No element named \"%s\" - omitting link", l->sink_name);
  2644           SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
       
  2645               "No element named \"%s\" - omitting link", l->sink_name);
       
  2646         } else {
       
  2647           /* probably a missing element which we've handled already */
       
  2648         }
  2591         gst_parse_free_link (l);
  2649         gst_parse_free_link (l);
  2592         continue;
  2650         continue;
  2593       }
  2651       }
  2594     }
  2652     }
  2595     gst_parse_perform_link (l, &g);
  2653     gst_parse_perform_link (l, &g);