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